Definitions for Cineon data formats
Project description
Cineon Format
This package contains a definition of a common data format to be used across Cineon repositories.
The CineonData format is a class that inherits from pydantic's BaseModel class, and as such the data validation is performed on class instantiation. If the data being ingested has a problem then class instantiation will fail. Simple. This is useful because downstream processing tasks can make valid assumptions about the data and therefore do not have to perform any explicit checks. This means that lots of downstream data-validation code can be deleted.
Prerequisites
To use the example script in the package you need to install uv, but you do not need uv in order to use the package in other Python code.
Usage
Add the cineon_format package into your project, with either:
poetry add git+https://github.com/cineon-ai/cineon_format.git
uv add git+https://github.com/cineon-ai/cineon_format.git
Then:
from cineon_format import CineonData
# Load from CSV
cineon_data = CineonData.from_csv("path/to/csv")
# Alternatively, load from JSON
cineon_data = CineonData.from_json("path/to/json")
Examples
Running the example script with either:
uv run scripts/example.py --csv=data/good.csv
uv run scripts/example.py --json=data/good.json
will load a file, convert that file into the CineonData format and then spit out a dictionary representation and a DataFrame representation to the terminal.
If you run the script with either:
uv run scripts/example.py --csv=data/bad.csv
uv run scripts/example.py --json=data/bad.json
you can see examples of data that does not conform to the format, and therefore errors out with helpful error messages printed to the terminal.
"Random" CineonData can be generated via the script:
uv run scripts/generate.py
This will print a summary of the CineonData to the terminal.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cineon_format-3.0.0.tar.gz.
File metadata
- Download URL: cineon_format-3.0.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69c1c80c475c25cf07b79d6564512017fe77fcd5fb76ef3c362310a5e170fb9e
|
|
| MD5 |
137edc490ce26c2631e269a6e7e0b466
|
|
| BLAKE2b-256 |
3207d64abb505ba92df51eb87a8949e8936d6f0173070afcbef2309eb01f6ef6
|
File details
Details for the file cineon_format-3.0.0-py3-none-any.whl.
File metadata
- Download URL: cineon_format-3.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
651a4c8b8192b925e5ed84e375e8082ae7c9ffbdcc5cdd3360f54332fd92c8e4
|
|
| MD5 |
a99ad4cb05011af22421018eb501bd0e
|
|
| BLAKE2b-256 |
23c7fec24451d548912a6b071c393eeea0e9cb13c9289677e2d50223dd4f1a72
|