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.1.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.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: transaction_metadata-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 89db50ada3312227606ba9c644cd0ee8d0fde97c71268d666cbdf19e25022ea9
MD5 4c77a78d3523213127e650a25d6bce78
BLAKE2b-256 0b94bd3cde16477bfc02220aa51f457de6b1782ec48a9aaec4bf68ea1edaf5fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transaction_metadata-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9c23a711b2effba7405bbafd7236c5edf173786b9bfaa2c57811b12680bffe
MD5 748a32090819c958d2bb031527230ff6
BLAKE2b-256 8c1966379ad3a92fb4bcb84c62c9ced611c317e60c41eaf093648a98d5036405

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