Skip to main content

Python client for Masterly — extract governed data products and ingest records from your lakehouse

Project description

masterly — Python client

Extract governed data products and ingest records from Python — notebooks on Databricks, Microsoft Fabric, or anywhere else your pipelines run.

from masterly import Client

client = Client(
    base_url="https://app.example.com",       # your Masterly install
    token="<session or service-account token>",
    environment="env_prod_eu",
)

# Extract: page through a data product (cursor-managed for you)
for row in client.products.read("Customer 360"):
    ...

# Or straight into a DataFrame
df = client.products.read("Customer 360").to_pandas()

# Follow the change feed with a resumable cursor
feed = client.products.changes("Customer 360", cursor=saved_cursor)
for change in feed:
    ...
save(feed.cursor)  # persist for the next run

# Ingest: deliver records to a source (chunked automatically)
report = client.sources.ingest("crm", records)
print(report.records, "records in", report.batches, "batches")

Tokens: two personas

  • Consumer (extract in a Databricks/Fabric job): use a service-account token (minted under Users → Service accounts). It pins its Environment and consumes published products — reference them by product id (dp_…), since listing products needs a session. Access policies (row rules, masks) apply per consumer automatically.
  • Integrator (ingest + golden reads): use a session token. Sources and products can be referenced by name.

The client is a thin, typed wrapper over the stable /v1 REST contract — the same API every other channel uses. Errors raise masterly.ApiError carrying the server's error code and message. Re-delivery is idempotent: records upsert by their source key, so running the same notebook twice never duplicates data.

pandas is an optional dependency: pip install masterly[pandas].

License

Apache-2.0 — see LICENSE.

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

masterly-0.1.1.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

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

masterly-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: masterly-0.1.1.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for masterly-0.1.1.tar.gz
Algorithm Hash digest
SHA256 13fc8a428e412d7289541a007d447c1274f7e01d0df65b55c99e525fda83a09e
MD5 95553869277882498ccc9241801d039d
BLAKE2b-256 f8fd8af1efb1e64831073bef8caf72c15071fdb231e885961f9d9bcfdbfdd827

See more details on using hashes here.

Provenance

The following attestation bundles were made for masterly-0.1.1.tar.gz:

Publisher: release.yml on masterly-data/masterly-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: masterly-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for masterly-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19a8a5b4ed063ede919865a5e8d56cf786fb1aaee3f6dd537669f16f6d462234
MD5 f35f0848517c8d7caa8c88ff21fd47ee
BLAKE2b-256 d0a7199ff8d8b472e3b3c4767c9a4466254c39e6bdd19cd5a915fa06324538cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for masterly-0.1.1-py3-none-any.whl:

Publisher: release.yml on masterly-data/masterly-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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