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.0.tar.gz (2.2 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.0-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: transaction_metadata-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 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.0.tar.gz
Algorithm Hash digest
SHA256 75eef39cd23a8d9649c69dbf8a26812403a366f81c15cffa73bb7e82d04dbab7
MD5 3b499acae0140c3472f7973a9a88d5ee
BLAKE2b-256 dec570dd45f85013c2db9b9764dff34f08c8944ed32c22309e4d718402602897

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transaction_metadata-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7ee892cea0e2109d1df917de3b48f11fcef1c1f44c8266e12155c769059129
MD5 eb9ac37f778deedf1d8bb417071a9f1b
BLAKE2b-256 f001f743d518874e11d3b3469a7aa983a7a3295956e55547c9af5152515a3033

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