[](https://github.com/transloadit/python-sdk/actions/workflows/ci.yml)
[](https://codecov.io/gh/transloadit/python-sdk)
# Transloadit python-sdk
A **Python** Integration for [Transloadit](https://transloadit.com)'s file uploading and encoding service.
## Intro
[Transloadit](https://transloadit.com) is a service that helps you handle file uploads, resize, crop and watermark your images, make GIFs, transcode your videos, extract thumbnails, generate audio waveforms, and so much more. In short, [Transloadit](https://transloadit.com) is the Swiss Army Knife for your files.
This is a **Python** SDK to make it easy to talk to the [Transloadit](https://transloadit.com) REST API.
Only Python 3.9+ versions are supported.
## Install
```bash
pip install pytransloadit
```
## Usage
```python
from transloadit import client
tl = client.Transloadit('TRANSLOADIT_KEY', 'TRANSLOADIT_SECRET')
assembly = tl.new_assembly()
assembly.add_file(open('PATH/TO/FILE.jpg', 'rb'))
assembly.add_step('resize', '/image/resize', {'width': 70, 'height': 70})
assembly_response = assembly.create(retries=5, wait=True)
print(assembly_response.data.get('assembly_id'))
# or
print(assembly_response.data['assembly_id'])
```
## Example
For fully working examples, take a look at [`examples/`](https://github.com/transloadit/python-sdk/tree/HEAD/examples).
## Documentation
See [readthedocs](https://transloadit.readthedocs.io) for full API documentation.
## Contributing
### Running tests
If you have a global installation of `poetry`, you can run the tests with:
```bash
poetry run pytest --cov=transloadit tests
```
If you can't use a global installation of `poetry`, e.g. when using Nix Home Manager, you can create a Python virtual environment and install Poetry there:
```bash
python -m venv .venv && source .venv/bin/activate && pip install poetry && poetry install
```
Then to run the tests:
```bash
source .venv/bin/activate && poetry run pytest --cov=transloadit tests
```
Generate a coverage report with:
```bash
poetry run pytest --cov=transloadit --cov-report=html tests
```
Then view the coverage report locally by opening `htmlcov/index.html` in your browser.
Raw data
{
"_id": null,
"home_page": "https://github.com/transloadit/python-sdk",
"name": "pytransloadit",
"maintainer": "Florian Kuenzig",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Ifedapo Olarewaju",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/cb/17/eaa353c2808224365150033975a68026b510a952c9d2b7db5030f32add6e/pytransloadit-1.0.2.tar.gz",
"platform": null,
"description": "[](https://github.com/transloadit/python-sdk/actions/workflows/ci.yml)\n[](https://codecov.io/gh/transloadit/python-sdk)\n\n# Transloadit python-sdk\n\nA **Python** Integration for [Transloadit](https://transloadit.com)'s file uploading and encoding service.\n\n## Intro\n\n[Transloadit](https://transloadit.com) is a service that helps you handle file uploads, resize, crop and watermark your images, make GIFs, transcode your videos, extract thumbnails, generate audio waveforms, and so much more. In short, [Transloadit](https://transloadit.com) is the Swiss Army Knife for your files.\n\nThis is a **Python** SDK to make it easy to talk to the [Transloadit](https://transloadit.com) REST API.\n\nOnly Python 3.9+ versions are supported.\n\n## Install\n\n```bash\npip install pytransloadit\n```\n\n## Usage\n\n```python\nfrom transloadit import client\n\ntl = client.Transloadit('TRANSLOADIT_KEY', 'TRANSLOADIT_SECRET')\nassembly = tl.new_assembly()\nassembly.add_file(open('PATH/TO/FILE.jpg', 'rb'))\nassembly.add_step('resize', '/image/resize', {'width': 70, 'height': 70})\nassembly_response = assembly.create(retries=5, wait=True)\n\nprint(assembly_response.data.get('assembly_id'))\n\n# or\nprint(assembly_response.data['assembly_id'])\n```\n\n## Example\n\nFor fully working examples, take a look at [`examples/`](https://github.com/transloadit/python-sdk/tree/HEAD/examples).\n\n## Documentation\n\nSee [readthedocs](https://transloadit.readthedocs.io) for full API documentation.\n\n## Contributing\n\n### Running tests\n\nIf you have a global installation of `poetry`, you can run the tests with:\n\n```bash\npoetry run pytest --cov=transloadit tests\n```\n\nIf you can't use a global installation of `poetry`, e.g. when using Nix Home Manager, you can create a Python virtual environment and install Poetry there:\n\n```bash\npython -m venv .venv && source .venv/bin/activate && pip install poetry && poetry install\n```\n\nThen to run the tests:\n\n```bash\nsource .venv/bin/activate && poetry run pytest --cov=transloadit tests\n```\n\nGenerate a coverage report with:\n\n```bash\npoetry run pytest --cov=transloadit --cov-report=html tests\n```\n\nThen view the coverage report locally by opening `htmlcov/index.html` in your browser.",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python Integration for Transloadit's file uploading and encoding service.",
"version": "1.0.2",
"project_urls": {
"Documentation": "https://transloadit.readthedocs.io",
"Homepage": "https://github.com/transloadit/python-sdk",
"Repository": "https://github.com/transloadit/python-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b75353dfdce72b1474ff4ccf1d01b532e6cb570eb10a6760e29bb456d720286f",
"md5": "ab56cea80fbf47192ca731253d5c2187",
"sha256": "43e44a515b873467d68bbdb516ad6c7f2c6e386f704f3f9e1f46626101ae4673"
},
"downloads": -1,
"filename": "pytransloadit-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab56cea80fbf47192ca731253d5c2187",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 10814,
"upload_time": "2024-12-03T11:31:40",
"upload_time_iso_8601": "2024-12-03T11:31:40.023796Z",
"url": "https://files.pythonhosted.org/packages/b7/53/53dfdce72b1474ff4ccf1d01b532e6cb570eb10a6760e29bb456d720286f/pytransloadit-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb17eaa353c2808224365150033975a68026b510a952c9d2b7db5030f32add6e",
"md5": "16e33358594fd4f7879f367c899fa15e",
"sha256": "a847076de7d8e483a62b7771e913dadd51e9974682dbc813ecbffe30e19adde6"
},
"downloads": -1,
"filename": "pytransloadit-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "16e33358594fd4f7879f367c899fa15e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 9570,
"upload_time": "2024-12-03T11:31:42",
"upload_time_iso_8601": "2024-12-03T11:31:42.539493Z",
"url": "https://files.pythonhosted.org/packages/cb/17/eaa353c2808224365150033975a68026b510a952c9d2b7db5030f32add6e/pytransloadit-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 11:31:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "transloadit",
"github_project": "python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pytransloadit"
}