{"id":27810,"library":"ghga-service-chassis-lib","title":"GHGA Service Chassis Library","description":"A library providing the base chassis functionality for microservices at GHGA (German Human Genome-Phenome Archive). It includes common patterns for API configuration, logging, error handling, and HTTP client utilities. Current version: 0.17.8. Release cadence: irregular, roughly monthly.","status":"active","version":"0.17.8","language":"python","source_language":"en","source_url":"https://github.com/ghga-de/ghga-service-chassis-lib","tags":["ghga","service","chassis","microservice","configuration","logging","error-handling"],"install":[{"cmd":"pip install ghga-service-chassis-lib","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"ApiConfigBase is in the api submodule, not top-level.","wrong":"from ghga_service_chassis_lib import ApiConfigBase","symbol":"ApiConfigBase","correct":"from ghga_service_chassis_lib.api import ApiConfigBase"},{"note":"Logging utilities are in the logging submodule.","wrong":"from ghga_service_chassis_lib import configure_logging","symbol":"configure_logging","correct":"from ghga_service_chassis_lib.logging import configure_logging"},{"note":"The class is capitalized 'HttpyExpect'.","wrong":"from ghga_service_chassis_lib.httpyexpect import httpyexpect","symbol":"HttpyExpect","correct":"from ghga_service_chassis_lib.httpyexpect import HttpyExpect"}],"quickstart":{"code":"from ghga_service_chassis_lib.api import ApiConfigBase\nfrom ghga_service_chassis_lib.logging import configure_logging\n\nclass MyConfig(ApiConfigBase):\n    service_name: str = \"my-service\"\n    service_instance_id: str = \"001\"\n\nconfig = MyConfig()\nconfigure_logging(config)\nprint(f\"Service {config.service_name} ready.\")","lang":"python","description":"Quickstart demonstrates creating a config class and setting up logging."},"warnings":[{"fix":"Update config models: replace 'class Config' with 'model_config = ConfigDict()' and use 'Field()' for validators if needed.","message":"Breaking change: In v0.17.0, the dependency pydantic was updated to v2. Config classes must now use pydantic v2 syntax.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Catch 'HttpyExpectError' instead of older exception types.","message":"Breaking change: In v0.16.0, the httpyexpect library was updated, changing the exception hierarchy.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Always install via pip; avoid manually copying packages into site-packages.","message":"The library uses a namespace package structure. Installing multiple 'ghga-' packages may cause issues if not installed via pip.","severity":"gotcha","affected_versions":"all"},{"fix":"Use FastAPI's lifespan context manager instead of 'configure_app'.","message":"The 'api' submodule's 'configure_app' function is deprecated in favor of direct usage of FastAPI lifespan.","severity":"deprecated","affected_versions":">=0.17.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run: pip install ghga-service-chassis-lib; then import as 'ghga_service_chassis_lib' (with underscores).","cause":"The library is installed with hyphens, but the import uses underscores.","error":"ModuleNotFoundError: No module named 'ghga_service_chassis_lib'"},{"fix":"Use: from ghga_service_chassis_lib.api import ApiConfigBase","cause":"Attempting to import from the top-level package instead of the api submodule.","error":"ImportError: cannot import name 'ApiConfigBase' from 'ghga_service_chassis_lib'"},{"fix":"Use pydantic v2 validators: @field_validator('fieldname') or @model_validator.","cause":"Using pydantic v1 style validators with pydantic v2 (chassis v0.17+).","error":"pydantic.errors.PydanticUserError: A custom validator may not have the same name as a field."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}