Skip to content

Commit

Permalink
httpx
Browse files Browse the repository at this point in the history
  • Loading branch information
peterHoburg committed Mar 4, 2024
1 parent 0d5cac6 commit 07b9319
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 12 deletions.
113 changes: 112 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python = "^3.10"
pydantic = "^2.6.3"
pydantic-settings = "^2.2.1"
typer = {extras = ["all"], version = "^0.9.0"}
httpx = "^0.27.0"


[tool.poetry.group.dev.dependencies]
Expand Down
1 change: 0 additions & 1 deletion src/f1_fantasy/data/input/ignore_constructors.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
name

8 changes: 2 additions & 6 deletions src/f1_fantasy/game_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,6 @@ def load_prices(cls, constructor_prices: list[ConstructorPriceModel]):
cls.get(constructor_price.name).price = float(constructor_price.price)


DRIVERS_IGNORE_LIST = [
# Drivers.MAX,
]
DRIVERS_IGNORE_LIST = []

CONSTRUCTORS_IGNORE_LIST = [
# Constructors.RED_BULL,
]
CONSTRUCTORS_IGNORE_LIST = []
12 changes: 8 additions & 4 deletions src/f1_fantasy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,15 @@ def set_ignores_from_csvs(ignore_constructors: Path, ignore_drivers: Path):


def write_csv_to_output(f: TextIO, csv_path: Path):
with csv_path.open() as cp_csv:
reader = csv.DictReader(cp_csv)
with csv_path.open() as read_csv:
reader = csv.DictReader(read_csv)
dict_writer = csv.DictWriter(f, reader.fieldnames)

f.write("\n" + "#" * 120)
f.write(f"\n{csv_path.name}:\n")
dict_writer.writeheader()
for row in reader:
f.write(str(row) + "\n")
dict_writer.writerow(row)


def main(
Expand Down Expand Up @@ -248,7 +252,7 @@ def main(
f.write(f"Total teams: {len(_max_score_teams)}\n")
for team in _max_score_teams:
print(team)
f.write(f"{team}\n")
f.write(f"{team}\n\n")

f.write("\n" + "#" * 120)
f.write("\n" + "#" * 120)
Expand Down
4 changes: 4 additions & 0 deletions test.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
###
GET https://fantasy.formula1.com/feeds/drivers/2_en.json


0 comments on commit 07b9319

Please sign in to comment.