Skip to main content

Common utilities for Matrice.ai services

Project description

matrice_common

matrice_common is a high-performance, Cython-compiled Python package providing reusable utilities for Matrice.ai services. It offers ready-to-use authentication classes, error handling helpers, and general-purpose functions with complete type stubs for IDEs.

Features

  • Cython Compiled – Optimized performance via C extensions.
  • Authentication Utilities – Refresh token and access key-based authentication.
  • Error Handling – Rich error logging with Kafka producer support.
  • Utility Functions – Helpers for caching, dependency management, and duplicate checks.
  • Type Hints & Stubs.pyi stubs for full IDE autocomplete and docstring support.
  • Modular Design – Clear separation of auth, utils, and RPC components.

Installation

pip install matrice_common --upgrade

Example Usage

from matrice_common.token_auth import RefreshToken, AuthToken
from matrice_common.utils import log_errors

# Example: Create auth instance
refresh = RefreshToken(access_key="YOUR_ACCESS_KEY", secret_key="YOUR_SECRET_KEY")
auth = AuthToken(access_key="YOUR_ACCESS_KEY", secret_key="YOUR_SECRET_KEY", refresh_token=refresh)

# Example: Use decorator for automatic error logging
@log_errors(default_return="failed")
def risky_function(x):
    return 10 / x

print(risky_function(0))

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matrice_common-0.1.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

matrice_common-0.1.0-py3-none-manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

File details

Details for the file matrice_common-0.1.0.tar.gz.

File metadata

  • Download URL: matrice_common-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for matrice_common-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd6f19ff8e028b9ea53685ce0e0c35cdbcccf53beaa9bda6b368d8b19fe0c4b6
MD5 ca7bbbddaebfcac86f5e0d1ffd1ed299
BLAKE2b-256 ae19f288006405a440d59ae79ba53eb6f4ab4c533de92ece107f25499a5455b5

See more details on using hashes here.

File details

Details for the file matrice_common-0.1.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for matrice_common-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0d4805c821a865b29d031679c8b8657135132dbada436c57e727d46558dde45b
MD5 f7d4b348004b85fd3bc947d679bb90be
BLAKE2b-256 48b8df4ed3a159ad54ecd24f899f4e3cd58a5fa23a071a5ad5a4f3392e90fd8b

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