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-1.0.2.tar.gz (4.0 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-1.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for transaction_metadata-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2f68b8bf9612b37927312608a8865d4f089f1281323267935b5ab26e006429b2
MD5 4ec02a5c71bf045f71c60e769a42d63d
BLAKE2b-256 4a1478e51bd1a72d8b6a3e917c79405325331113ea549d9cf0b5903c2879f53a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transaction_metadata-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98d830d87287d5a1b08a2ad7f73736026ba1cb945bfab348987b3ada77ddf60e
MD5 b504e3105a5aefe6014652771e403651
BLAKE2b-256 247f42597a8013baebe0b99e74c27ae66aa14af1b9ffb3e0016b02bab999125f

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