Skip to main content

Python SDK for Media Cloud AI workers

Based on mcai_worker_sdk, this SDK uses the PyO3 crate to export a compiled module compatible with CPython ABI.

Documentation

Please, check the docs here and here for the SDK with the media feature enabled.

Build

Before using the Python module you should build it as a CPython library. This will require a virtualenv (where the module will be installed) and maturin to compile the module.

virtualenv venv # Create your environment
source venv/bin/activate # Launch it

You can then either build the module in development mode (this will build and install the module in your virtualenv):

maturin develop --features extension-module # Build and install the module

Or build the wheel file and install it manually via pip:

maturin build --features extension-module # Build the wheel file to install the module
pip install path/to/generated/wheel/file

You will now be able to import the module in your Python's scripts by doing:

import mcai_worker_sdk as mcai

Check out maturin's docs for more information on building the module!

Supported version

We intempt to support as many distribution and architecture as we can, however if pip doesn't find any compatible version for your installation it will download the source and try to compile them directly.

This operation supposes that you have at least Rust 1.62.

We currently support the following version of Python implementations:

  • CPython 3.8 : manylinux
  • CPython 3.9 : manylinux, macosx x86_64
  • CPython 3.10 : manylinux, macosx x86_64, macosx arm64
  • CPython 3.11 : manylinux, macosx arm54
  • Pypy 3.8 : manylinux
  • Pypy 3.9 : manylinux

And the following core architectures:

  • x86_64

Test

To run tests you must have json-strong-typing installed:

pip install json-strong-typing

Then launch tests basically:

cargo test
cargo test --features media

Running examples

Build the Python module

In your virtual environment:

maturin develop

Simple worker

RUST_LOG=debug \
SOURCE_ORDERS="examples/message.json" \
PYTHON_WORKER_FILENAME="worker.py" \
SOURCE_PATH="README.md" \
DESTINATION_PATH="README.md.out" \
python worker.py

Media worker

First set the media filename:

export SOURCE_PATH="/folder/filename.ext"

Then run the SDK with these parameters:

RUST_LOG=debug \
SOURCE_ORDERS="examples/message.json" \
PYTHON_WORKER_FILENAME="media_worker.py" \
DESTINATION_PATH="results.json" \
cargo run --features media

Metadata

Release files for mcai-worker-sdk 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcai-worker-sdk 2.1.1
File Size Uploaded Provenance Actions
mcai_worker_sdk-2.1.1.tar.gz 54.6 kB Without provenance Details for mcai_worker_sdk-2.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mcai-worker-sdk 2.1.1
File Actions
mcai_worker_sdk-2.1.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl PyPy 3.10 PyPy 3.10 7.3 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
mcai_worker_sdk-2.1.1-cp38-cp38-manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ x86-64 Details for mcai_worker_sdk-2.1.1-cp38-cp38-manylinux_2_28_x86_64.whl

Total release size: 62.9 MB

Release files / mcai_worker_sdk-2.1.1.tar.gz

Download URL mcai_worker_sdk-2.1.1.tar.gz
Size 54.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5892f825e9e96c1c5834b6aad992b99d28228d7b210b707e097ed81676db7707
BLAKE2b-256 checksum
How to use checksums
30b4627fc77d076420ca0dce973c0682b4f323e7e4a313476bf6624170854ee1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags Linux glibc 2.28+ x86-64 PyPy 3.10 PyPy 3.10 7.3
SHA-256 checksum
How to use checksums
468c4d87100a58f01fee0bd373a4890dd9870ed7c4ce5fb2390935165db52ff1
BLAKE2b-256 checksum
How to use checksums
9716b81d4b56189fcba34903b40a65d4c2faf8a17e917466903b29502ff43f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags Linux glibc 2.28+ x86-64 PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
fa9c480fe9361be4f95caf882b3e6cb65e3e0975d33960d59fb072188f6ed4fb
BLAKE2b-256 checksum
How to use checksums
ce495a059a14fd882c41c3a74592b3c1af36bba2cee923c31923bc254b32bd88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e7d178acf6f38307e85135e9044e08a1d42f70617a17b0cc18d79c6a28660f6d
BLAKE2b-256 checksum
How to use checksums
b4296cda4e6a9159d2c7b5acc7d3608b4faffdfeb7cfb5e14771b5c589c8e78c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cb0fa8cd24118f9533ed2bfc335802051228802556ba34dd63f51cc0a4ddc044
BLAKE2b-256 checksum
How to use checksums
fc64ef6ffd07afad2f8887b4aa8f2a310b9642f9498237c2904be978eed32472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
06f1837012d22bf3ddb465c9b97b5633c6ad2af0f3687cc5cc23840000d0ac10
BLAKE2b-256 checksum
How to use checksums
e44f15c0763f77f0f7dbeaf9898591168244596e49f16229942ace3a8b389a14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2cd50c8072e5f57764dc93a602cc27266e071a92e042024961f1adf0563d4690
BLAKE2b-256 checksum
How to use checksums
4147db87b9bddb9236208357421b2e22b43e3db2e7ac9590d0bdbbfb3ad3afbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / mcai_worker_sdk-2.1.1-cp38-cp38-manylinux_2_28_x86_64.whl

Download URL mcai_worker_sdk-2.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Size 9.0 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
843cb612efd9387382273040e1100891684e6826aa715540b5a0fedc1ea5baab
BLAKE2b-256 checksum
How to use checksums
fa24a82b284cffd5608b81311d4d1182e959bd5d5b09de49c42ac478335fc46d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Security for mcai-worker-sdk 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page