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.

Latest Version

Latest Version: 1.0.3

Please refer to: https://pypi.org/project/transaction-metadata/1.0.3/

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: transaction_metadata-1.0.3.tar.gz
  • Upload date:
  • Size: 4.1 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.3.tar.gz
Algorithm Hash digest
SHA256 351df0627167f330d05b2f535c476424673b9eeb6b588cccfd864d89c647e0fb
MD5 17195387a0ace1eaac2425f53d2e737d
BLAKE2b-256 d810764de729addd9d4ce4f47df77f62fd739c2397b3c4bb643c1d2caafd12af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transaction_metadata-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4eb948c32bdfdebc039a184143b1926e791139b7fa1310642e42d9298432d52c
MD5 ff075e138054cd49061942a415c8ef30
BLAKE2b-256 25fada62a9748dfc5b0d3b2986f565640262a79b79fd646da1eb7000343adc89

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