Skip to main content

A metadata package for transaction and user Avro schemas

Project description

Transaction Metadata

transaction-metadata is a small Python package that exposes versioned Avro schemas for transaction and user data. It is useful for data pipelines and applications that need a reliable way to fetch schema definitions at runtime.

Installation

Install from PyPI:

pip install transaction-metadata

Or, if you are using a virtual environment:

python -m pip install transaction-metadata

Package Structure

transaction_metadata/
├── schemas/
│   ├── transaction/v1/transaction.avsc
│   └── user/v1/user.avsc
├── loader.py
└── version.py

Usage

Get a schema for a specific entity

from transaction_metadata.loader import get_schema

schema = get_schema(entity="transaction", version="v1")
print(schema)

Get the schema for a user entity

from transaction_metadata.loader import get_schema

user_schema = get_schema(entity="user", version="v1")
print(user_schema)

Example: inspect a few fields

from transaction_metadata.loader import get_schema

schema = get_schema(entity="transaction", version="v1")
for field in schema.get("fields", []):
    print(field["name"], field.get("type"))

PyPI Package

The package is published on PyPI here:

https://pypi.org/project/transaction-metadata/

Notes

  • The public API exposed by this package is get_schema(entity, version).
  • The schema files are stored under the package resources so they can be loaded safely at runtime.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transaction_metadata-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transaction_metadata-0.1.1-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file transaction_metadata-0.1.1.tar.gz.

File metadata

  • Download URL: transaction_metadata-0.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for transaction_metadata-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cf3e5fcf9ff1ec6e018577c2bfab49be003542c5facbf8ea06faef6f5340f17c
MD5 da66639628a132c07033ca949b1f7edc
BLAKE2b-256 64905ed48864b42da838bf8e3e8a5207e94859f7ef1083250de5571636c33afa

See more details on using hashes here.

File details

Details for the file transaction_metadata-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for transaction_metadata-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b1d1e33f6075d49dfc520d42713f5178f11daf1728e3edc268cc4554f64191a
MD5 92e35da5d2ea641674156d282cc7fd59
BLAKE2b-256 7a744a5c34812e460c9d1a2e7688b9f22b33d9c8819c16e1bda1c8f9b0cd6441

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page