{"id":19703462,"url":"https://github.com/crowdin/crowdin-api-client-python","last_synced_at":"2025-05-16T16:03:33.186Z","repository":{"id":40304566,"uuid":"334999506","full_name":"crowdin/crowdin-api-client-python","owner":"crowdin","description":"Python client library for Crowdin API","archived":false,"fork":false,"pushed_at":"2025-03-31T06:56:54.000Z","size":961,"stargazers_count":59,"open_issues_count":2,"forks_count":33,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T17:54:39.726Z","etag":null,"topics":["api","client","crowdin-api","hacktoberfest","python","sdk"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/crowdin-api-client/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-01T15:45:02.000Z","updated_at":"2025-04-11T10:54:30.000Z","dependencies_parsed_at":"2024-01-02T10:38:55.262Z","dependency_job_id":"cdaf7f95-11c1-44fe-b4f6-242bdf6a873f","html_url":"https://github.com/crowdin/crowdin-api-client-python","commit_stats":{"total_commits":94,"total_committers":15,"mean_commits":6.266666666666667,"dds":0.6808510638297872,"last_synced_commit":"fa46eeebb3e6ed317881e59cef321f79047b876f"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdin","download_url":"https://codeload.github.com/crowdin/crowdin-api-client-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590452,"owners_count":21129821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","crowdin-api","hacktoberfest","python","sdk"],"created_at":"2024-11-11T21:17:56.397Z","updated_at":"2025-04-12T15:36:57.596Z","avatar_url":"https://github.com/crowdin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cWhite.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n# Crowdin Python client [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fcrowdin%2Fcrowdin-api-client-python\u0026text=The%20Crowdin%20Python%20client%20is%20a%20lightweight%20interface%20to%20the%20Crowdin%20API)\u0026nbsp;[![GitHub Repo stars](https://img.shields.io/github/stars/crowdin/crowdin-api-client-python?style=social\u0026cacheSeconds=1800)](https://github.com/crowdin/crowdin-api-client-python/stargazers)\n\nThe Crowdin Python client is a lightweight interface to the Crowdin API. It provides common services for making API requests.\n\nCrowdin API is a full-featured RESTful API that helps you to integrate localization into your development process. The endpoints that we use allow you to easily make calls to retrieve information and to execute actions needed.\n\n\u003cdiv align=\"center\"\u003e\n\n[**`API Client Docs`**](https://crowdin.github.io/crowdin-api-client-python/) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin API`**](https://developer.crowdin.com/api/v2/) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Enterprise API`**](https://developer.crowdin.com/enterprise/api/v2/)\n\n[![PyPI](https://img.shields.io/pypi/v/crowdin-api-client?cacheSeconds=3600)](https://pypi.org/project/crowdin-api-client/)\n[![Downloads](https://pepy.tech/badge/crowdin-api-client)](https://pepy.tech/project/crowdin-api-client)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/crowdin-api-client?cacheSeconds=3600)](https://pypi.org/project/crowdin-api-client/)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/crowdin/crowdin-api-client-python/python-package.yml?branch=main\u0026logo=github)\n[![codecov](https://codecov.io/gh/crowdin/crowdin-api-client-python/branch/main/graph/badge.svg?token=sOUWIcNjWO)](https://codecov.io/gh/crowdin/crowdin-api-client-python)\n[![GitHub issues](https://img.shields.io/github/issues/crowdin/crowdin-api-client-python?cacheSeconds=3600)](https://github.com/crowdin/crowdin-api-client-python/issues)\n[![License](https://img.shields.io/github/license/crowdin/crowdin-api-client-python?cacheSeconds=3600)](https://github.com/crowdin/crowdin-api-client-python/blob/master/LICENSE)\n\n\u003c/div\u003e\n\n## Installation\n\n```console\npip install crowdin-api-client\n```\n\n## Quick Start\n\n### Create and list projects\n\n```python\nfrom crowdin_api import CrowdinClient\n\nclass FirstCrowdinClient(CrowdinClient):\n    TOKEN = \"__token__\"\n    PROJECT_ID = 1 # Optional, set project id for all API's\n    ORGANIZATION = \"organizationName\" # Optional, for Crowdin Enterprise only\n    TIMEOUT = 60  # Optional, sets http request timeout.\n    RETRY_DELAY = 0.1  # Optional, sets the delay between failed requests \n    MAX_RETRIES = 5  # Optional, sets the number of retries\n    HEADERS = {\"Some-Header\": \"\"}  # Optional, sets additional http request headers\n    PAGE_SIZE = 25  # Optional, sets default page size\n    EXTENDED_REQUEST_PARAMS = {\"some-parameters\": \"\"}  # Optional, sets additional parameters for request\n\nclient = FirstCrowdinClient()\n\n# Create Project\nproject_response = client.projects.add_project(name=\"New project\", sourceLanguageId=\"en\")\n\n# Get list of Projects\nprojects = client.projects.list_projects()\n\n# Get list of Projects with offset and limit\nprojects = client.projects.list_projects(offset=10, limit=20)\n\n# Get list of Projects by page\nprojects = client.projects.list_projects(page=2) # offset=25, limit=25\n```\n\nAlternatively, you can create an instance of the CrowdinClient class with params like this:\n\n```python\nfrom crowdin_api import CrowdinClient\n\n# use the lower-case version of any of the constants above,\n# at least provide token\nclient = CrowdinClient(token='__token__')\n\n# ... continue as above\n\n```\n\n### Add a file\n\n```python\nfrom crowdin_api import CrowdinClient\n\nclient = CrowdinClient(token='__token__')\n\nfile_name = '__path_to_the_file__'\n\nstorage = client.storages.add_storage(open(file_name, 'rb'))\n\nmy_file = client.source_files.add_file(__project_id__, storage['data']['id'], file_name)\n\nprint(my_file)\n```\n\n### Fetch all records\n\nIt is possible to fetch all records from paginatable methods (where we have limit and offset in arguments).\n\n```python\nfrom crowdin_api import CrowdinClient\n\nclient = CrowdinClient(token='__token__')\n\n# get all projects\nprint(client.projects.with_fetch_all().list_projects())\n\n# get projects but not more than 1000\nprint(client.projects.with_fetch_all(1000).list_projects())\n```\n\n### Sorting\n\nAn optional `orderBy` parameter is used to apply sorting.\n\n```python\nfrom crowdin_api import CrowdinClient\nfrom crowdin_api.sorting import Sorting, SortingOrder, SortingRule\nfrom crowdin_api.api_resources.projects.enums import ListProjectsOrderBy\n\nclient = CrowdinClient(token='__token__')\n\nsorting = Sorting(\n    [\n        SortingRule(ListProjectsOrderBy.ID, SortingOrder.ASC),\n        SortingRule(ListProjectsOrderBy.NAME),\n        SortingRule(ListProjectsOrderBy.CREATED_AT, SortingOrder.DESC),\n    ]\n)\n\nprint(client.projects.list_projects(orderBy=sorting))\n```\n\nEnum `SortingOrder` is also optional (ascending order applied by default).\n\n### Extended request parameters\n\nThe `EXTENDED_REQUEST_PARAMS` parameter allows you to set additional parameters for requests. For example, you can configure proxies or certificates.\n\nThe Client uses the [requests](https://pypi.org/project/requests/) library to make HTTP requests. You can pass any parameters that `requests` supports:\n\n```python\ndef request(\n    self,\n    method,\n    url,\n    params=None,\n    data=None,\n    headers=None,\n    cookies=None,\n    files=None,\n    auth=None,\n    timeout=None,\n    allow_redirects=True,\n    proxies=None,\n    hooks=None,\n    stream=None,\n    verify=None,\n    cert=None,\n    json=None,\n):\n```\n\nFor example, you can set a [proxy](https://requests.readthedocs.io/en/latest/api/#requests.Session.proxies):\n\n```python\nfrom crowdin_api import CrowdinClient\n\nhttp_proxy = \"http://10.10.1.10:3128\"\nhttps_proxy = \"https://10.10.1.11:1080\"\nftp_proxy = \"ftp://10.10.1.10:3128\"\n\nproxies = {\n  \"http\": http_proxy,\n  \"https\": https_proxy,\n  \"ftp\": ftp_proxy\n}\n\nclass FirstCrowdinClient(CrowdinClient):\n    EXTENDED_REQUEST_PARAMS = {\"proxies\": proxies}\n```\n\n### GraphQL API\n\nThis library also provides the possibility to use [GraphQL API](https://developer.crowdin.com/graphql-api/):\n\n```python\nfrom crowdin_api import CrowdinClient\n\nclient = CrowdinClient(\n    token='{token}',\n    organization='{organization}'\n)\n\nquery = \"\"\"\nquery {\n  viewer {\n    id\n    name\n  }\n}\n\"\"\"\n\n# Execute the GraphQL query\nresponse = client.graphql(query=query)\n```\n\n## Seeking Assistance\n\nIf you find any problems or would like to suggest a feature, please read the [How can I contribute](https://github.com/crowdin/crowdin-api-client-python/blob/main/CONTRIBUTING.md#how-can-i-contribute) section in our contributing guidelines.\n\n## Contributing\n\nIf you would like to contribute please read the [Contributing](https://github.com/crowdin/crowdin-api-client-python/blob/main/CONTRIBUTING.md) guidelines.\n\n## License\n\n\u003cpre\u003e\nThe Crowdin Python client is licensed under the MIT License.\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nExcept as contained in the LICENSE file, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the sale,\nuse or other dealings in this Software without prior written authorization.\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-python/lists"}