Skip to content

Commit

Permalink
Pydantic avro schema storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fireye04 committed Aug 22, 2024
1 parent 077886b commit 5f56bf2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/sasquatchbackpack/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Avro schemas."""
1 change: 0 additions & 1 deletion src/sasquatchbackpack/schemas/usgs.avsc

This file was deleted.

17 changes: 17 additions & 0 deletions src/sasquatchbackpack/schemas/usgs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""USGS Schemas."""

from dataclasses import dataclass, field

from dataclasses_avroschema import AvroModel


@dataclass
class EarthquakeSchema(AvroModel):
"""USGS Earthquake schema."""

timestamp: int
id: str = field(metadata={"description": "unique earthquake id"})
latitude: float = field(metadata={"units": "degree"})
longitude: float = field(metadata={"units": "degree"})
depth: float = field(metadata={"units": "km"})
magnitude: float = field(metadata={"units": "u.richter_magnitudes"})

0 comments on commit 5f56bf2

Please sign in to comment.