Skip to main content

Common server 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 --index-url https://test.pypi.org/simple/ matrice_common

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.26.tar.gz (79.4 kB 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.26-py3-none-any.whl (88.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matrice_common-0.1.26.tar.gz
  • Upload date:
  • Size: 79.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for matrice_common-0.1.26.tar.gz
Algorithm Hash digest
SHA256 e45a4b8a1498ccebcd7f1e115bee83da586617d82068e810b50355306c830111
MD5 36d396bff70313ba5e14c24d243154ca
BLAKE2b-256 de0ac830f950e2f4bf48f916f3527b4b04c12d3980641b888ce6096a892fe890

See more details on using hashes here.

File details

Details for the file matrice_common-0.1.26-py3-none-any.whl.

File metadata

File hashes

Hashes for matrice_common-0.1.26-py3-none-any.whl
Algorithm Hash digest
SHA256 f4bf583a7edd5eb61e018d9f7d09b62e39fd81487590557429cf236b511d3232
MD5 0e458f0ed092ea49138156756ff6f9fd
BLAKE2b-256 9896cda2d56a1d00821d03905f917f13d77a30304147eb96ddf1f0854d05e1f9

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