Skip to main content

Official Python client for the DataMasque data-masking API.

Project description

Official Python client for the DataMasque platform.

DataMasque is a data masking platform that replaces sensitive data with realistic but non-production values, so teams can use production-shaped data in non-production environments without exposing PII. This package is a thin Python wrapper around the DataMasque server’s HTTP API, covering connection management, ruleset and ruleset-library CRUD, masking run lifecycle, discovery results, user administration, and license management.

Installation

pip install datamasque-python

Python 3.9 or newer is required.

Quickstart

from datamasque.client import DataMasqueClient
from datamasque.client.models.dm_instance import DataMasqueInstanceConfig

config = DataMasqueInstanceConfig(
    base_url="https://datamasque.example.com",
    username="api_user",
    password="api_password",
)
client = DataMasqueClient(config)
client.authenticate()

for connection in client.list_connections():
    print(connection.name)

Authentication is performed on the first request if authenticate() is not called explicitly, and is automatically retried once on a 401 response. client.healthcheck() is available as a lightweight readiness probe that does not consume credentials.

Error handling

All methods raise subclasses of DataMasqueException on failure:

  • DataMasqueApiError — the server responded with a non-2xx status (excluding 502). The triggering Response is available on the .response attribute.

  • DataMasqueNotReadyError — the server responded with 502, typically because it is still starting up.

  • DataMasqueTransportError — the request failed before any response was received (connection refused, timeout, DNS failure, SSL handshake failure, etc.).

  • FailedToStartError / InvalidRulesetError / InvalidLibraryError — raised by start_masking_run when the server rejects the run.

  • DataMasqueUserError — raised by user-management methods when the input is invalid.

Documentation

Contributing

See CONTRIBUTING.rst for development setup, testing, and the pull request flow.

License

Apache License 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

datamasque_python-1.0.3.tar.gz (161.9 kB view details)

Uploaded Source

Built Distribution

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

datamasque_python-1.0.3-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for datamasque_python-1.0.3.tar.gz
Algorithm Hash digest
SHA256 294dc2f56de7b4e9b41032716276ff19b28e63ea8daad6548054d2cbda295ca9
MD5 d8048fbf704a9095150580e3719eee41
BLAKE2b-256 ea9b3ea629b00514ce6df9de8968ee1fd9b5c126f7d9d3049ebc25458239fcd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamasque_python-1.0.3.tar.gz:

Publisher: release.yml on datamasque/datamasque-python

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

File details

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

File metadata

File hashes

Hashes for datamasque_python-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e0a3323db7055f1d3bc272512f636ffdd7d88bd5881b92161c22a132f02102b
MD5 d29c6f58da47ec062214e4b7a2dee96f
BLAKE2b-256 d7ba628c490e06b328cde4efb047f4e119cb58ed0861081f51f6bd04ad1950ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamasque_python-1.0.3-py3-none-any.whl:

Publisher: release.yml on datamasque/datamasque-python

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