From 1e53deac34d23738545271cc6ad7b8a8276aec62 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 8 Nov 2024 15:47:04 +0000 Subject: [PATCH] Remove pyhumps, pydantic already knows how to camelize --- scraper/pyproject.toml | 1 - scraper/src/mindtouch2zim/ui.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scraper/pyproject.toml b/scraper/pyproject.toml index 69ef69b..86df10f 100644 --- a/scraper/pyproject.toml +++ b/scraper/pyproject.toml @@ -14,7 +14,6 @@ dependencies = [ "types-requests==2.32.0.20240914", "kiwixstorage==0.9.0", "pydantic==2.9.1", - "pyhumps==3.8.0", "schedule==1.2.2", "beautifulsoup4==4.12.3", "types-beautifulsoup4==4.12.0.20240907", diff --git a/scraper/src/mindtouch2zim/ui.py b/scraper/src/mindtouch2zim/ui.py index 085216e..8a3d3e2 100644 --- a/scraper/src/mindtouch2zim/ui.py +++ b/scraper/src/mindtouch2zim/ui.py @@ -1,11 +1,11 @@ -from humps import camelize from pydantic import BaseModel, ConfigDict +from pydantic.alias_generators import to_camel class CamelModel(BaseModel): """Model to transform Python snake_case into JSON camelCase.""" - model_config = ConfigDict(alias_generator=camelize, populate_by_name=True) + model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) class PageModel(CamelModel):