Registry / data / odd-models

odd-models

JSON →
library2.0.51pypypi✓ verified 83d ago

Open Data Discovery Models provides the data model schemas for Open Data Discovery (ODD) platform. Version 2.0.51 supports Python 3.9+ and defines entities like datasets, jobs, and metadata. The library is actively maintained with a focus on ODD protocol compatibility.

pip install odd-models
INSTALL
IMPORT
SIG · ODD-MODELS
O
odd-models
datapythonv2.0.51
Install
12.6s avg
Import
691ms
Disk
169MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.51 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.722s · 180.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 12.6s · import 0.660s · 175MB
169MB installed
● package 169MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataSet
from odd_models.models import DataSet
from odd_models import DataSet
DataSet is in the models submodule
DataTransformer
from odd_models.models import DataTransformer
DataSetField
from odd_models.models import DataSetField
MetadataExtension
from odd_models.models import MetadataExtension

Create a basic DataSet entity with one field.

from odd_models.models import DataSet, DataSetField, MetadataExtension import datetime # Create a dataset field = DataSetField( odd_path='my_db.public.users.id', name='id', type='int64', is_primary_key=True ) dataset = DataSet( odd_path='my_db.public.users', name='users', metadata=[MetadataExtension(metadata={'source': 'postgres'})], fields_list=[field], updated_at=datetime.datetime.now(datetime.timezone.utc) ) print(dataset)
Debug
Known issues
breakingIn version 2.0, the package was restructured: imports changed from `odd_models` namespace to `odd_models.models`. Old imports (e.g., `from odd_models import DataSet`) will fail.
fix
Use `from odd_models.models import DataSet`.
affects: >=2.0.0
gotchaAll `odd_path` fields must be unique across entities. Using duplicate values causes validation errors.
fix
Ensure each odd_path string is globally unique.
affects: >=1.0
deprecatedThe `DataConsumer` and `DataProducer` models are deprecated as of 2.0. Use `DataSet` with appropriate role fields instead.
fix
Migrate to DataSet and set `role` attribute accordingly.
affects: >=2.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'DataSet' from 'odd_models'
Common mistake: importing from the top-level package instead of the models submodule.
fix
Use: from odd_models.models import DataSet
ValidationError: 1 validation error for DataSetField type value is not a valid enumeration member; permitted: 'bool', 'int32', 'int64', 'float', 'double', 'string', 'binary', 'timestamp', 'date', 'time', 'list', 'map', 'struct', 'union', 'null'
Providing an invalid type string for DataSetField.type.
fix
Use one of the allowed enum values: bool, int32, int64, float, double, string, binary, timestamp, date, time, list, map, struct, union, null.
AttributeError: module 'odd_models' has no attribute 'models'
Possible outdated installation; or the import path changed in version 2.0.
fix
Install the latest version: pip install --upgrade odd-models
Upgrade
Version history
2.0.51latest on PyPI · released Oct 28, 2024
Audit
Dependencies
attrsrequiredUsed for data class definitions
python-dateutilrequiredDate/time handling
pydanticrequiredValidation and serialization
Agent activity
2 hits · last 30 days
node
2
Resources
odd-models — pip install odd-models · libregistry