mcai-worker-sdk-media


Namemcai-worker-sdk-media JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://gitlab.com/media-cloud-ai/sdks/py_mcai_worker_sdk
SummaryMCAI SDK to develop Python worker
upload_time2023-08-17 10:26:33
maintainer
docs_urlNone
authorValentin NOEL <valentin.noel@media-io.com>, Marc-Antoine Arnaud <maarnaud@media-io.com>, Thibaud Le Graverend <thibaud.legraverend@luminvent.com>
requires_python>=3.8
licenseMIT
keywords amqp micro-service python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python SDK for Media Cloud AI workers

Based on [mcai_worker_sdk](https://gitlab.com/media-cloud-ai/sdks/rs_mcai_worker_sdk), this SDK uses the [PyO3 crate](https://github.com/PyO3/pyo3) to export a compiled module compatible with CPython ABI.

## Documentation

Please, check the docs [here](https://media-cloud-ai.gitlab.io/sdks/py_mcai_worker_sdk/mcai_worker_sdk/) and [here](https://media-cloud-ai.gitlab.io/sdks/py_mcai_worker_sdk/mcai_worker_sdk_media/) 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](https://github.com/PyO3/maturin) to compile the module.

```bash
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):

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

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

```bash
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:

```python
import mcai_worker_sdk as mcai
```

Check out [maturin's docs](https://www.maturin.rs/distribution.html#build-wheels) 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:
- [x] CPython 3.8 : manylinux
- [x] CPython 3.9 : manylinux, macosx x86_64
- [x] CPython 3.10 : manylinux, macosx x86_64, macosx arm64
- [x] CPython 3.11 : manylinux, macosx arm54
- [x] Pypy 3.8 : manylinux
- [x] Pypy 3.9 : manylinux

And the following core architectures:
- [x] x86_64


## Test

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

```bash
pip install json-strong-typing
```

Then launch tests basically:

```bash
cargo test
cargo test --features media
```

### Running examples

#### Build the Python module

In your virtual environment:

```bash
maturin develop
```

#### Simple worker

```bash
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:

```bash
export SOURCE_PATH="/folder/filename.ext"
```

Then run the SDK with these parameters:

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


            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/media-cloud-ai/sdks/py_mcai_worker_sdk",
    "name": "mcai-worker-sdk-media",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "AMQP,micro-service,python",
    "author": "Valentin NOEL <valentin.noel@media-io.com>, Marc-Antoine Arnaud <maarnaud@media-io.com>, Thibaud Le Graverend <thibaud.legraverend@luminvent.com>",
    "author_email": "Valentin NOEL <valentin.noel@media-io.com>, Marc-Antoine Arnaud <maarnaud@media-io.com>, Thibaud Le Graverend <thibaud.legraverend@luminvent.com>",
    "download_url": "https://files.pythonhosted.org/packages/32/40/eb58e1c34b27f3cbc525e1230fb5bff31c4120a03c6c5bc67fce145fe538/mcai_worker_sdk_media-2.0.0.tar.gz",
    "platform": null,
    "description": "# Python SDK for Media Cloud AI workers\n\nBased on [mcai_worker_sdk](https://gitlab.com/media-cloud-ai/sdks/rs_mcai_worker_sdk), this SDK uses the [PyO3 crate](https://github.com/PyO3/pyo3) to export a compiled module compatible with CPython ABI.\n\n## Documentation\n\nPlease, check the docs [here](https://media-cloud-ai.gitlab.io/sdks/py_mcai_worker_sdk/mcai_worker_sdk/) and [here](https://media-cloud-ai.gitlab.io/sdks/py_mcai_worker_sdk/mcai_worker_sdk_media/) for the SDK with the media feature enabled.\n\n## Build\n\nBefore 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](https://github.com/PyO3/maturin) to compile the module.\n\n```bash\nvirtualenv venv # Create your environment\nsource venv/bin/activate # Launch it\n```\n\nYou can then either build the module in development mode (this will build and install the module in your virtualenv):\n\n```bash\nmaturin develop --features extension-module # Build and install the module\n```\n\nOr build the wheel file and install it manually via `pip`:\n\n```bash\nmaturin build --features extension-module # Build the wheel file to install the module\npip install path/to/generated/wheel/file\n```\n\nYou will now be able to import the module in your Python's scripts by doing:\n\n```python\nimport mcai_worker_sdk as mcai\n```\n\nCheck out [maturin's docs](https://www.maturin.rs/distribution.html#build-wheels) for more information on building the module!\n\n### Supported version\n\nWe 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.\n\nThis operation supposes that you have at least __Rust 1.62__.\n\nWe currently support the following version of Python implementations:\n- [x] CPython 3.8 : manylinux\n- [x] CPython 3.9 : manylinux, macosx x86_64\n- [x] CPython 3.10 : manylinux, macosx x86_64, macosx arm64\n- [x] CPython 3.11 : manylinux, macosx arm54\n- [x] Pypy 3.8 : manylinux\n- [x] Pypy 3.9 : manylinux\n\nAnd the following core architectures:\n- [x] x86_64\n\n\n## Test\n\nTo run tests you must have `json-strong-typing` installed:\n\n```bash\npip install json-strong-typing\n```\n\nThen launch tests basically:\n\n```bash\ncargo test\ncargo test --features media\n```\n\n### Running examples\n\n#### Build the Python module\n\nIn your virtual environment:\n\n```bash\nmaturin develop\n```\n\n#### Simple worker\n\n```bash\nRUST_LOG=debug \\\nSOURCE_ORDERS=\"examples/message.json\" \\\nPYTHON_WORKER_FILENAME=\"worker.py\" \\\nSOURCE_PATH=\"README.md\" \\\nDESTINATION_PATH=\"README.md.out\" \\\npython worker.py\n```\n\n#### Media worker\n\nFirst set the media filename:\n\n```bash\nexport SOURCE_PATH=\"/folder/filename.ext\"\n```\n\nThen run the SDK with these parameters:\n\n```bash\nRUST_LOG=debug \\\nSOURCE_ORDERS=\"examples/message.json\" \\\nPYTHON_WORKER_FILENAME=\"media_worker.py\" \\\nDESTINATION_PATH=\"results.json\" \\\ncargo run --features media\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MCAI SDK to develop Python worker",
    "version": "2.0.0",
    "project_urls": {
        "Documentation": "https://mcai-python-sdk-media.readthedocs.io/",
        "Homepage": "https://gitlab.com/media-cloud-ai/sdks/py_mcai_worker_sdk"
    },
    "split_keywords": [
        "amqp",
        "micro-service",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd44f159635f2a987115b0eae7593f6295c6b798a515b5778d358d5149ef6a97",
                "md5": "0c58535bfe28208baaa207d7d7f1deac",
                "sha256": "306bad17aa099d1670f9f2c50ee4aa7db83fa45dfeaecf25aa1e85d05799c337"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "0c58535bfe28208baaa207d7d7f1deac",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 38914793,
            "upload_time": "2023-08-17T10:25:57",
            "upload_time_iso_8601": "2023-08-17T10:25:57.206458Z",
            "url": "https://files.pythonhosted.org/packages/cd/44/f159635f2a987115b0eae7593f6295c6b798a515b5778d358d5149ef6a97/mcai_worker_sdk_media-2.0.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd0ddda7a6c8129eb7d1e93520e31cba5feeaae722aea18d9e07e3f4dc3a0a63",
                "md5": "5fb7ef427a1a4c241e96b647997ff6f4",
                "sha256": "203d003c8d9b092cf19ccfe5190bccbca70f6996a37587cad5e4c1b14c0a5132"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5fb7ef427a1a4c241e96b647997ff6f4",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 38914800,
            "upload_time": "2023-08-17T10:26:03",
            "upload_time_iso_8601": "2023-08-17T10:26:03.475295Z",
            "url": "https://files.pythonhosted.org/packages/dd/0d/dda7a6c8129eb7d1e93520e31cba5feeaae722aea18d9e07e3f4dc3a0a63/mcai_worker_sdk_media-2.0.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7757368190676b67d54de751f25a3868e4362198deed7ab0be936e4cca9adb2",
                "md5": "d3e226b141fd47a749b0274c9ae35d04",
                "sha256": "9f4efa5937f3194577a446d9e5f5d74a2667f1c141761ff818834c0543bd72de"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d3e226b141fd47a749b0274c9ae35d04",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 38914440,
            "upload_time": "2023-08-17T10:26:09",
            "upload_time_iso_8601": "2023-08-17T10:26:09.605839Z",
            "url": "https://files.pythonhosted.org/packages/d7/75/7368190676b67d54de751f25a3868e4362198deed7ab0be936e4cca9adb2/mcai_worker_sdk_media-2.0.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "28df22955c3eb3313253a6577432536fd0a9b6291fb58e54ed833391552e3747",
                "md5": "b71f63ff3fd304f27cd2067eaeeaca26",
                "sha256": "4c8e6c3a90ceed48f05eb500202e05d32ba0234452f5dacefdd378d1e684d9b2"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b71f63ff3fd304f27cd2067eaeeaca26",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 38915140,
            "upload_time": "2023-08-17T10:26:16",
            "upload_time_iso_8601": "2023-08-17T10:26:16.240408Z",
            "url": "https://files.pythonhosted.org/packages/28/df/22955c3eb3313253a6577432536fd0a9b6291fb58e54ed833391552e3747/mcai_worker_sdk_media-2.0.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "285664cee27208171297da4fa3363243ad9da9be8e3bc6d7812ed55f315b8173",
                "md5": "0d050419e7d7c941d5da5911fdea75e5",
                "sha256": "ba5271b43aaab6acf8c7ca4b6985c75dcd1c127d014fd76d7d58c4054d1ad218"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "0d050419e7d7c941d5da5911fdea75e5",
            "packagetype": "bdist_wheel",
            "python_version": "pp38",
            "requires_python": ">=3.8",
            "size": 38915971,
            "upload_time": "2023-08-17T10:26:22",
            "upload_time_iso_8601": "2023-08-17T10:26:22.670408Z",
            "url": "https://files.pythonhosted.org/packages/28/56/64cee27208171297da4fa3363243ad9da9be8e3bc6d7812ed55f315b8173/mcai_worker_sdk_media-2.0.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c227419aa58048889dfcb7c6789fbb52dfc7d0e94030ca3560651a0317ca16c1",
                "md5": "1ceda4e1d256df49bc0709fb995bea7d",
                "sha256": "ef7cc48f1d27662436a46d4561c4bc2676e9f5047a99486596f24997fceb7e7a"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "1ceda4e1d256df49bc0709fb995bea7d",
            "packagetype": "bdist_wheel",
            "python_version": "pp39",
            "requires_python": ">=3.8",
            "size": 38917117,
            "upload_time": "2023-08-17T10:26:30",
            "upload_time_iso_8601": "2023-08-17T10:26:30.789634Z",
            "url": "https://files.pythonhosted.org/packages/c2/27/419aa58048889dfcb7c6789fbb52dfc7d0e94030ca3560651a0317ca16c1/mcai_worker_sdk_media-2.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3240eb58e1c34b27f3cbc525e1230fb5bff31c4120a03c6c5bc67fce145fe538",
                "md5": "1ae32c1ec9a3fe9f67ab96e299ee95ae",
                "sha256": "e67e6f1ef99c5d85d12ace8be825e30b093e36fad119bb2909918968be01ba53"
            },
            "downloads": -1,
            "filename": "mcai_worker_sdk_media-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1ae32c1ec9a3fe9f67ab96e299ee95ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 52966,
            "upload_time": "2023-08-17T10:26:33",
            "upload_time_iso_8601": "2023-08-17T10:26:33.883338Z",
            "url": "https://files.pythonhosted.org/packages/32/40/eb58e1c34b27f3cbc525e1230fb5bff31c4120a03c6c5bc67fce145fe538/mcai_worker_sdk_media-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-17 10:26:33",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "media-cloud-ai",
    "gitlab_project": "sdks",
    "lcname": "mcai-worker-sdk-media"
}
        
Elapsed time: 0.10799s