{"id":27809,"library":"ghga-event-schemas","title":"GHGA Event Schemas","description":"A library collecting Pydantic-based event schemas used for events exchanged between GHGA services. Current version is 13.0.0, requiring Python >=3.12. Maintained actively by the GHGA community.","status":"active","version":"13.0.0","language":"python","source_language":"en","source_url":"https://github.com/ghga-de/ghga-event-schemas","tags":["event-schemas","pydantic","ghga","kafka","event-driven"],"install":[{"cmd":"pip install ghga-event-schemas","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Package uses underscores in module names, not dots.","wrong":"from ghga.event_schemas import EventPublisher","symbol":"EventPublisher","correct":"from ghga_event_schemas import EventPublisher"},{"note":"Event schemas are located under ghga_event_schemas.events, not top-level.","wrong":"from ghga_event_schemas import UploadAccepted","symbol":"UploadAccepted","correct":"from ghga_event_schemas.events import UploadAccepted"},{"note":"Data models are in the 'models' submodule.","wrong":"from ghga_event_schemas import FileUpload","symbol":"FileUpload","correct":"from ghga_event_schemas.models import FileUpload"}],"quickstart":{"code":"from ghga_event_schemas.events import UploadAccepted\nfrom ghga_event_schemas.models import FileUpload\n\n# Instantiate a FileUpload model\nfile_upload = FileUpload(\n    file_id=\"some-file-id\",\n    upload_id=\"upload-123\",\n    object_id=\"obj-456\",\n    bucket_id=\"bucket-789\",\n    file_size=1000,\n    upload_date=\"2023-01-01T00:00:00Z\"\n)\n\n# Create an UploadAccepted event event = UploadAccepted(payload=file_upload)\nprint(event)","lang":"python","description":"Basic usage: import event and model classes, create a model instance, then wrap it in an event."},"warnings":[{"fix":"Ensure all IDs are passed as uuid.UUID objects and date strings as datetime.datetime objects (with UTC timezone).","message":"In version 10.0.0, some ID fields changed from string to UUID4 and some string fields changed to UTCDatetime. If you are upgrading from pre-10.0.0, you must update your code to use UUID objects and datetime objects accordingly.","severity":"breaking","affected_versions":"<10.0.0"},{"fix":"Use 'id' instead of 'file_id' when constructing FileUpload models.","message":"The 'id' field in FileUpload was renamed in version 10.1.1; previously it was called 'file_id'.","severity":"deprecated","affected_versions":"<10.1.1"},{"fix":"Use 'import ghga_event_schemas' or 'from ghga_event_schemas import ...'","message":"The package name uses hyphens (ghga-event-schemas) but the import module uses underscores (ghga_event_schemas). Common mistake is to use dots or hyphens in imports.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'import ghga_event_schemas' (underscore) instead of 'import ghga.event_schemas' (dot).","cause":"Trying to import 'ghga.event_schemas' with a dot instead of underscore.","error":"ModuleNotFoundError: No module named 'ghga'"},{"fix":"Use 'from ghga_event_schemas.events import UploadAccepted'.","cause":"Importing directly from top-level package instead of the 'events' submodule.","error":"AttributeError: module 'ghga_event_schemas' has no attribute 'UploadAccepted'"},{"fix":"Convert the string to a uuid.UUID object: id=uuid.UUID('your-id-string')","cause":"Passing a string to a field that expects uuid.UUID4 (since v10.0.0).","error":"pydantic_core._pydantic_core.ValidationError: 1 validation error for FileUpload\nid"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}