Skip to content

Commit

Permalink
Updated version to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ojadeyemi committed Sep 7, 2024
1 parent d157d99 commit 56421f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

All notable changes to this project will be documented in this file.

## [2.0.0] - 2024-08-05
## v2.0.1

### Added
- Added **streak**, **home**, and **away** stats to `team_stats`.

### Changed

- Updated logger to format messages based on log level. DEBUG level includes state and name; other levels include only the message.

## v2.0.0

### Added

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "usports-basketball"
version = "2.0.0"
version = "2.0.1"
dependencies = [
"requests>=2.32",
"beautifulsoup4>=4.12",
Expand All @@ -13,7 +13,6 @@ dependencies = [
]
requires-python = ">=3.9"
authors = [{ name = "OJ Adeyemi", email = "[email protected]" }]
maintainers = [{ name = "OJ Adeyemi", email = "[email protected]" }]
description = "A Python package for current U Sports basketball stats."
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
4 changes: 2 additions & 2 deletions usports_basketball/team_stats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ async def __combine_data(gender: str, season_option: str) -> DataFrame:
raise ValueError(f"Invalid season_option: {season_option}. Must be one of {', '.join(SEASON_URLS.keys())}")

team_stats_url, standings_url = __construct_urls(gender, season_option)
logger.info(f"FETCHING {gender.upper()} {season_option.upper()} SEASON STANDINGS")
logger.debug(f"FETCHING {gender.upper()} {season_option.upper()} SEASON STANDINGS")
standings_df = await get_standings_df(standings_url)
logger.info(f"FETCHING {gender.upper()} {season_option.upper()} SEASON STATISTICS\n")
logger.debug(f"FETCHING {gender.upper()} {season_option.upper()} SEASON STATISTICS\n")
team_stats_df = await get_team_stats_df(team_stats_url)

# Update column names if necessary
Expand Down
8 changes: 7 additions & 1 deletion usports_basketball/utils/logging_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ def setup_logging():
"""Sets up logging configurations."""
log_level = os.getenv("LOG_LEVEL", "INFO").upper() # Default to INFO if LOG_LEVEL is not set

# Define log format based on log level
if log_level == "DEBUG":
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
else:
log_format = "%(message)s"

logging.basicConfig(
level=getattr(logging, log_level, logging.INFO), # Set the logging level from env variable
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
format=log_format,
handlers=[
logging.StreamHandler(), # Output logs to the console
],
Expand Down

0 comments on commit 56421f7

Please sign in to comment.