# Lokalise API v2 official Python interface


[](https://coveralls.io/github/lokalise/python-lokalise-api?branch=master)
[](https://pepy.tech/project/python-lokalise-api)
[](https://python-lokalise-api.readthedocs.io)
Official Python 3 interface for the [Lokalise APIv2](https://developers.lokalise.com/reference/lokalise-rest-api) that represents returned data as Python objects.
## Quick start
This plugin requires Python 3.8 and above. Install it:
pip install python-lokalise-api
Obtain a Lokalise API token (in your *Personal profile*) and use it:
```python
import lokalise
client = lokalise.Client('YOUR_API_TOKEN')
project = client.project('123.abc')
print(project.name)
client.upload_file(project.project_id, {
"data": 'ZnI6DQogIHRlc3Q6IHRyYW5zbGF0aW9u',
"filename": 'python_upload.yml',
"lang_iso": 'en'
})
translation_keys = client.keys(project.project_id, {"page": 2,
"limit": 3,
"disable_references": "1"})
translation_keys.items[0].key_name['web'] # => "sign_up"
```
You can also use [OAuth 2 tokens](https://python-lokalise-api.readthedocs.io/en/latest/additional_info/oauth2_flow.html):
```python
client = lokalise.OAuthClient('YOUR_OAUTH2_API_TOKEN')
project = client.project('123.abc')
```
## Documentation
Find detailed documentation at [python-lokalise-api.readthedocs.io](https://python-lokalise-api.readthedocs.io).
## License
This plugin is licensed under the [BSD 3 Clause License](https://github.com/lokalise/python-lokalise-api/blob/master/LICENSE).
Copyright (c) [Lokalise group](https://lokalise.com) and [Ilya Krukowski](http://bodrovis.tech)
Raw data
{
"_id": null,
"home_page": "https://python-lokalise-api.readthedocs.io/",
"name": "python-lokalise-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "lokalise, api, client",
"author": "Ilya Krukowski",
"author_email": "golosizpru@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/85/38/bc1b7d47068b0de8ed115628ea9a5b097146521f0ef021782c3dacf8c06c/python_lokalise_api-3.2.0.tar.gz",
"platform": null,
"description": "# Lokalise API v2 official Python interface\n\n\n\n[](https://coveralls.io/github/lokalise/python-lokalise-api?branch=master)\n[](https://pepy.tech/project/python-lokalise-api)\n[](https://python-lokalise-api.readthedocs.io)\n\nOfficial Python 3 interface for the [Lokalise APIv2](https://developers.lokalise.com/reference/lokalise-rest-api) that represents returned data as Python objects.\n\n## Quick start\n\nThis plugin requires Python 3.8 and above. Install it:\n\n pip install python-lokalise-api\n\nObtain a Lokalise API token (in your *Personal profile*) and use it:\n\n```python\nimport lokalise\nclient = lokalise.Client('YOUR_API_TOKEN')\nproject = client.project('123.abc')\nprint(project.name)\n\nclient.upload_file(project.project_id, {\n \"data\": 'ZnI6DQogIHRlc3Q6IHRyYW5zbGF0aW9u',\n \"filename\": 'python_upload.yml',\n \"lang_iso\": 'en'\n})\n\ntranslation_keys = client.keys(project.project_id, {\"page\": 2,\n \"limit\": 3,\n \"disable_references\": \"1\"})\ntranslation_keys.items[0].key_name['web'] # => \"sign_up\"\n```\n\nYou can also use [OAuth 2 tokens](https://python-lokalise-api.readthedocs.io/en/latest/additional_info/oauth2_flow.html):\n\n```python\nclient = lokalise.OAuthClient('YOUR_OAUTH2_API_TOKEN')\n\nproject = client.project('123.abc')\n```\n\n## Documentation\n\nFind detailed documentation at [python-lokalise-api.readthedocs.io](https://python-lokalise-api.readthedocs.io).\n\n## License\n\nThis plugin is licensed under the [BSD 3 Clause License](https://github.com/lokalise/python-lokalise-api/blob/master/LICENSE).\n\nCopyright (c) [Lokalise group](https://lokalise.com) and [Ilya Krukowski](http://bodrovis.tech)\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Official Python interface for the Lokalise API v2",
"version": "3.2.0",
"project_urls": {
"Homepage": "https://python-lokalise-api.readthedocs.io/",
"Repository": "https://github.com/lokalise/python-lokalise-api/issues"
},
"split_keywords": [
"lokalise",
" api",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0b2e4dbbb5e7a6148c5c81942e968154897e5289a99d293c716b78065e362c4c",
"md5": "17bfb669e084effb093a5cf7bf26552f",
"sha256": "0227414b7e7fcff14b05a29ea3d612a99a117fc71d2452792df5903e3cc55404"
},
"downloads": -1,
"filename": "python_lokalise_api-3.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "17bfb669e084effb093a5cf7bf26552f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 66771,
"upload_time": "2025-02-17T16:56:28",
"upload_time_iso_8601": "2025-02-17T16:56:28.553437Z",
"url": "https://files.pythonhosted.org/packages/0b/2e/4dbbb5e7a6148c5c81942e968154897e5289a99d293c716b78065e362c4c/python_lokalise_api-3.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8538bc1b7d47068b0de8ed115628ea9a5b097146521f0ef021782c3dacf8c06c",
"md5": "56009f6b48c8d8eab3b4d6d804133c0f",
"sha256": "e68b5df24aee49688ca4bfa3fcd47f5aff8cb6604bd0ab2fee7c384380aeb61f"
},
"downloads": -1,
"filename": "python_lokalise_api-3.2.0.tar.gz",
"has_sig": false,
"md5_digest": "56009f6b48c8d8eab3b4d6d804133c0f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 24647,
"upload_time": "2025-02-17T16:56:30",
"upload_time_iso_8601": "2025-02-17T16:56:30.623264Z",
"url": "https://files.pythonhosted.org/packages/85/38/bc1b7d47068b0de8ed115628ea9a5b097146521f0ef021782c3dacf8c06c/python_lokalise_api-3.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 16:56:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lokalise",
"github_project": "python-lokalise-api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-lokalise-api"
}