# Lokalise API v2 official Python interface
![PyPI](https://img.shields.io/pypi/v/python-lokalise-api)
![CI](https://github.com/lokalise/python-lokalise-api/actions/workflows/ci.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/lokalise/python-lokalise-api/badge.svg?branch=master)](https://coveralls.io/github/lokalise/python-lokalise-api?branch=master)
[![Downloads](https://pepy.tech/badge/python-lokalise-api)](https://pepy.tech/project/python-lokalise-api)
[![Docs](https://readthedocs.org/projects/python-lokalise-api/badge/?version=latest&style=flat)](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://github.com/lokalise/python-lokalise-api",
"name": "python-lokalise-api",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "lokalise, api, client",
"author": "Ilya Krukowski",
"author_email": "golosizpru@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/98/a3/bd7df892b968f75d6234464c3901450b1c7c3a626551647827369319a687/python_lokalise_api-2.2.0.tar.gz",
"platform": null,
"description": "# Lokalise API v2 official Python interface\n\n![PyPI](https://img.shields.io/pypi/v/python-lokalise-api)\n![CI](https://github.com/lokalise/python-lokalise-api/actions/workflows/ci.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/lokalise/python-lokalise-api/badge.svg?branch=master)](https://coveralls.io/github/lokalise/python-lokalise-api?branch=master)\n[![Downloads](https://pepy.tech/badge/python-lokalise-api)](https://pepy.tech/project/python-lokalise-api)\n[![Docs](https://readthedocs.org/projects/python-lokalise-api/badge/?version=latest&style=flat)](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": "2.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/lokalise/python-lokalise-api/issues",
"Documentation": "https://python-lokalise-api.readthedocs.io/",
"Homepage": "https://github.com/lokalise/python-lokalise-api",
"Repository": "https://github.com/lokalise/python-lokalise-api"
},
"split_keywords": [
"lokalise",
" api",
" client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6282d786ed0be14b95bf623b52df5d9de4b53ace185a2419319b4ede9a2b94ed",
"md5": "6013b7992fe5c5773e5f554546fdbd71",
"sha256": "dc14886a371253d3363d178df021171f5d223be457d34c6d76d54d1c907496d9"
},
"downloads": -1,
"filename": "python_lokalise_api-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6013b7992fe5c5773e5f554546fdbd71",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 49861,
"upload_time": "2024-04-17T10:51:46",
"upload_time_iso_8601": "2024-04-17T10:51:46.297640Z",
"url": "https://files.pythonhosted.org/packages/62/82/d786ed0be14b95bf623b52df5d9de4b53ace185a2419319b4ede9a2b94ed/python_lokalise_api-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "98a3bd7df892b968f75d6234464c3901450b1c7c3a626551647827369319a687",
"md5": "b33b888865741d14a7c01441e2c45ad0",
"sha256": "b2037eb331bf9c928b5f96d71a5a208e63d88567d20ed088c1eff696b9964f1e"
},
"downloads": -1,
"filename": "python_lokalise_api-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b33b888865741d14a7c01441e2c45ad0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 24455,
"upload_time": "2024-04-17T10:51:47",
"upload_time_iso_8601": "2024-04-17T10:51:47.621539Z",
"url": "https://files.pythonhosted.org/packages/98/a3/bd7df892b968f75d6234464c3901450b1c7c3a626551647827369319a687/python_lokalise_api-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-17 10:51:47",
"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"
}