{ "info": { "author": "PaulGregor", "author_email": "comixan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Internationalization", "Topic :: Software Development :: Localization" ], "description": "# Crowdin-cli-py --- 0.95.6\n[![Build Status](https://travis-ci.org/PaulGregor/crowdin-cli.svg?branch=master)](https://travis-ci.org/PaulGregor/crowdin-cli)\n\n[Crowdin Integration Utility Homepage](https://crowdin.com/page/cli-tool)\n | [Support](https://crowdin.com/contacts)\n | [crowdin.com Homepage](https://crowdin.com)\n\nA Command-Line Interface to sync files between local computer/server and [Crowdin](https://crowdin.com).\n\nIt is cross-platform and can be run in a terminal (Linux, MacOS X) or in cmd.exe (Windows).\n\n![ScreenShot](http://i.imgur.com/uZDUvPt.png)\n\n> **WARNING**: This is a development version: It contains the latest changes, but may also have several known issues, including crashes and data loss situations. In fact, it may not work at all.\n\n## Installation\n###**Windows**:\n\n[Download link](https://sourceforge.net/projects/crowdin/files/latest/download?source=files)\nAfter installing you need to get last version from PyPI using this command:\n```\npip install crowdin-cli-py --upgrade\n```\n###**Ubuntu/Debian**:\n```\n(sudo) pip install crowdin-cli-py\n```\n\nIf you don't have pip:\n```\n(sudo) apt-get install pip\n(sudo) pip install crowdin-cli-py\n```\n\n## Configuration\n\nWhen the tool is installed, you would have to configure your project. Basically, `crowdin-cli-py` go through project directory, and looks for `crowdin.yaml` file that contains project information.\n\nCreate `crowdin.yaml` YAML file in your root project directory with the following structure:\n\n```\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: /locale/en/LC_MESSAGES/messages.po\n translation: /locale/%two_letters_code%/LC_MESSAGES/%original_file_name%\n```\n\n* `api_key` - Crowdin Project API key\n* `project_identifier` - Crowdin project name\n* `base_url` - (default: https://api.crowdin.com)\n* `base_path` - defines what directory have to be scaned(default: current directory)\n* `files`\n * `source` - defines only files that should be uploaded as sources\n * `translation` - defines where translations should be placed after downloading (also the path have to be checked to detect and upload existing translations)\n\n Use the following placeholders to put appropriate variables into the resulting file name:\n * `%language%` - Language name (i.e. Ukrainian)\n * `%two_letters_code%` - Language code ISO 639-1 (i.e. uk)\n * `%three_letters_code%` - Language code ISO 639-2/T (i.e. ukr)\n * `%locale%` - Locale (like uk-UA)\n * `%locale_with_underscore%` - Locale (i.e. uk_UA)\n * `%original_file_name%` - Original file name\n * `%android_code%` - Android Locale identifier used to name \"values-\" directories\n * `%original_path%` - Take parent folders names in Crowdin project to build file path in resulted bundle\n * `%file_extension%` - Original file extension\n * `%file_name%` - File name without extension\n\t * `%osx_code%` - OS X Locale identifier used to name \".lproj\" directories\n * `%osx_xliff%` - OS X Locale used to name xliff files (i.e. uk.xliff)\n\n Example for Android projects:\n ```\n /values-%android_code%/%original_file_name%\n ```\n Example for Gettext projects:\n ```\n /locale/%two_letters_code%/LC_MESSAGES/%original_file_name%\n ```\n\nAlso you can add and upload all directories matching the pattern, including all nested files and localizable files.\n\nConfiguration example provided above has 'source' and 'translation' attributes containing standard wildcards (also known as globbing patterns) to make it easier to work with multiple files.\n\nHere's patterns you can use:\n\n* `*` (asterisk)\n\n Match zero or more characters in file name. A glob consisting of only the asterisk and no other characters will match all files in the directory. If you specified a `*.json` it will include all files like `messages.json`, `about_us.json` and anything that ends with `.json`.c* will match all files beginning with c; `*c` will match all files ending with c; and `*c*` will match all files that have c in them (including at the beginning or end). Equivalent to `/ .* /x` in regexp.\n\n* `**` (doubled asterisk)\n\n Match all the directories recursively. Note that you can use `**` in `source` and in `translation` pattern. When using `**` in `translation` pattern it will always contain sub-path from `source` for certain file. The mask `**` can be used only once in the pattern and must be surrounded by backslashes `/`.\n\n* `?` (question mark)\n\n Matches any one character.\n\n* `[set]`\n\n Matches any one character in set. Behaves exactly like character sets in `Regexp`, including set negation (`[^a-z]`).\n\n* `\\` (backslash)\n\n Escapes the next metacharacter.\n\n Say, you can have source: `/en/**/*.po` to upload all `*.po` files to Crowdin recursively. `translation` pattern will be `/translations/%two_letters_code%/**/%original_file_name%'`.\n\nSee sample configuration below::\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: /locale/en/**/*.po\n translation: /locale/%two_letters_code%/**/%original_file_name%\n```\n\n### API Credentials from environment variables\n\nYou could load the API Credentials from an environment variable, e.g.\n\n```\napi_key_env: 'CROWDIN_API_KEY'\nproject_identifier_env: 'CROWDIN_PROJECT_ID'\n\n```\n\nIf mix, `api_key` and `project_identifier` have priority:\n\n```\napi_key_env: CROWDIN_API_KEY # Low priority\nproject_identifier_env: CROWDIN_PROJECT # Low priority\napi_key: xxx # High priority\nproject_identifier: yyy # Hight priority\n```\n\n### Split project configuration and user credentials\n\nThe `crowdin.yaml` file contains project-specific configuration and user credentials(`api_key`, `project_identifier`).\nThis means that you can't commit this file in the code repository, because the API key would leak to other users. `crowdin-cli` allow 2 configuration files:\n\n* a project-specific, residing in the project directory (required)\n* a user-specific, probably residing in `$HOME/.crowdin.yaml` (optional)\n\n**NOTE**: user credentials in user-specific configuration file is higher priority than project-specific.\n\n### Languages mapping\n\nOften software projects have custom names for locale directories. `crowdin-cli` allows you to map your own languages to understandable by Crowdin.\n\nLet's say your locale directories named 'en', 'uk', 'fr', 'de'. All of them can be represented by `%two_letters_code%` placeholder. Still, you have one directory named 'zh_CH'. In order to make it work with `crowdin-cli` without changes in your project you can add `languages_mapping` section to your files set. See sample configuration below:\n\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: /locale/en/**/*.po\n translation: /locale/%two_letters_code%/**/%original_file_name%\n languages_mapping:\n two_letters_code:\n # crowdin_language_code: local_name\n ru: ros\n uk: ukr\n```\nMapping format is the following: `crowdin_language_code : code_use_use`.\n\nCheck [complete list of Crowdin language codes](https://crowdin.com/page/api/language-codes) that can be used for mapping.\n\nYou can also override language codes for other placeholders like `%android_code%`, `%locale%` etc...\n\n### Ignoring directories\n\nFrom time to time there are files and directories you don't want translate on Crowdin.\nLocal per-file rules can be added to the config file in your project.\n\n```\nfiles:\n -\n source: /locale/en/**/*.po\n translation: /locale/%two_letters_code%/**/%original_file_name%\n ignore:\n - /locale/en/templates\n - /locale/en/**/test-*.po\n - /locale/en/**/[^abc]*.po\n\n```\n\n### Preserving directories hierarchy\n\nBy default CLI tool tries to optimize your Crowdin project hierarchy and do not repeats complete path of local files online.\nIn case you need to keep directories structure same at Crowdin and locally you can add `preserve_hierarchy: true` option in main section of the configuration file.\n\nConfiguration sample is below:\n\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\npreserve_hierarchy: true\n```\n\n### Uploading CSV files via API\n\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: '/*.csv'\n translation: '%two_letters_code%/%original_file_name%'\n # Defines whether first line should be imported or it contains columns headers\n first_line_contains_header: true\n # Used only when uploading CSV file to define data columns mapping.\n scheme: \"identifier,source_phrase,translation,context,max_length\"\n```\n\n#### Multicolumn CSV\n\nIn case CSV file contains translations to all target languages you can use per-file option `multilingual_spreadsheet`.\n\nCSV file example:\n```\nidentifier,source_phrase,context,Ukrainian,Russian,French\nident1,Source 1,Context 1,,,\nident2,Source 2,Context 2,,,\nident3,Source 3,Context 3,,,\n```\n\nConfiguration file example:\n```\nfiles:\n -\n source: multicolumn.csv\n translation: multicolumn.csv\n first_line_contains_header: true\n scheme: \"identifier,source_phrase,context,uk,ru,fr\"\n multilingual_spreadsheet: true\n\n```\n\n\n## Configurations Examples\n\n### GetText Project\n\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: '/locale/en/**/*.po'\n translation: '/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%'\n languages_mapping:\n two_letters_code:\n 'zh-CN': 'zh_CH'\n 'fr-QC': 'fr'\n```\n\n### Android Project\n\n```\n---\nproject_identifier: test\napi_key: KeepTheAPIkeySecret\nbase_url: https://api.crowdin.com\nbase_path: /path/to/your/project\n\nfiles:\n -\n source: '/res/values/*.xml'\n translation: '/res/values-%android_code%/%original_file_name%'\n languages_mapping:\n android_code:\n # we need this mapping since Crowdin expects directories\n # to be named like \"values-uk-rUA\"\n # acording to specification instead of just \"uk\"\n de: de\n ru: ru\n```\n\n## Usage\n\nWhen the configuration file is created, you are ready to start using `crowdin-cli-py` to manage your localization resources and automate files synchronization.\n\nWe listed most typical commands that crowdin-cli-py is used for:\n\nUpload your source files to Crowdin:\n```\n$ crowdin-cli-py upload sources\n```\n\nUpload existing translations to Crowdin project (translations will be synchronized):\n```\n$ crowdin-cli-py upload translations\n```\n\nDownload latest translations from Crowdin:\n```\n$ crowdin-cli-py download\n```\n\nBuild latest Crowdin project configuration:\n```\n$ crowdin-cli-py build\n```\n\nList information about the files that already exists in current project:\n```\n$ crowdin-cli-py list project\n```\n\nList information about the sources files in current project that match the wild-card pattern:\n```\n$ crowdin-cli-py list sources\n```\n\nList information about the translations files in current project that match the wild-card pattern:\n```\n$ crowdin-cli-py list translations\n```\n\nBy default, `list` command print a list of all the files\n\n\nGet help on `upload` command:\n```\n$ crowdin-cli-py -h upload\n```\n\n\nUse `help` or `-h` provided with an application to get more information about available commands and options.\n\n\n## Supported Pythons\n\nTested with the following Python versions:\n\n- Python 2.6\n- Python 2.7\n- Python 3.2+\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Changelog\n**Version 0.95.6** - 12.02.2018:\n\n* Osx_code updated\n\n**Version 0.95.5** - 29.06.2016:\n\n* Fix some bugs in branches support \n\n**Version 0.95.4** - 25.04.2016:\n\n* Added branches support see https://support.crowdin.com/articles/versions-management/\n\n**Version 0.95.3** - 20.04.2016:\n\n* During download process directories for translations file will be created if not exist.\n\n**Version 0.95.2** - 19.11.2015:\n\n* Error with finding translations files path on Python 2.7 have been fixed.\n\n**Version 0.95.1** - 04.03.2015:\n\n* Errors with non-ascii characters and troubles with import have been fixed.\n\t\n**Version 0.94.5** - 28.02.2015:\n\n* Support for Python 3.2+ was implemented.\n* Environment variable for API Credentials.\n\n## License and Author\n\nAuthor: Paul Gregor (comixan@gmail.com)\n\nCopyright: 2012-2014 [crowdin.com](https://crowdin.com/)\n\nThis project is licensed under the MIT license, a copy of which can be found in the LICENSE file.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PaulGregor/crowdin-cli", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "crowdin-cli-py", "package_url": "https://pypi.org/project/crowdin-cli-py/", "platform": "", "project_url": "https://pypi.org/project/crowdin-cli-py/", "project_urls": { "Homepage": "https://github.com/PaulGregor/crowdin-cli" }, "release_url": "https://pypi.org/project/crowdin-cli-py/0.95.6/", "requires_dist": null, "requires_python": "", "summary": "Command-line client for the crowdin.com", "version": "0.95.6" }, "last_serial": 3575935, "releases": { "0.95.1": [ { "comment_text": "", "digests": { "md5": "a431e7c0ee766181af8d1e34140e37d3", "sha256": "637cb0a8d7bf2cf64e482196b4ee330da44c75177cb0ed22fba8ed7f9a6b5c64" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.1.zip", "has_sig": false, "md5_digest": "a431e7c0ee766181af8d1e34140e37d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28611, "upload_time": "2015-03-04T21:41:11", "url": "https://files.pythonhosted.org/packages/5d/24/5fc2325e647b9556e9f8819a50355d69c9f67bdadd4ae213eeda603ffa9a/crowdin-cli-py-0.95.1.zip" } ], "0.95.2": [ { "comment_text": "", "digests": { "md5": "cb3e263eb2a8d6aebaef0dd90817e542", "sha256": "37361578e844d2739413cfa5307d2871ece70a1ceaf4ff4a566ed3a3a0f97267" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.2.zip", "has_sig": false, "md5_digest": "cb3e263eb2a8d6aebaef0dd90817e542", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28732, "upload_time": "2015-11-18T22:23:38", "url": "https://files.pythonhosted.org/packages/50/12/24fe1c8d5860de45f521df54213ee3a92aefe00da1155b40fd1db462eaae/crowdin-cli-py-0.95.2.zip" } ], "0.95.3": [ { "comment_text": "", "digests": { "md5": "c98b143fde8c8746a118082ed8b6542e", "sha256": "802eac0c6c5ee034c753eecf3ea914196ca2ca02757d035c7f7efef096a4dbce" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.3.zip", "has_sig": false, "md5_digest": "c98b143fde8c8746a118082ed8b6542e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28772, "upload_time": "2016-04-20T17:24:45", "url": "https://files.pythonhosted.org/packages/bc/72/685ab0bf4a3cdf4d3ca52f621c8b21e5aebd7c0702172f5071ce11d486fa/crowdin-cli-py-0.95.3.zip" } ], "0.95.4": [ { "comment_text": "", "digests": { "md5": "ce2bd1d1df6436583eb3588f78cc2a0d", "sha256": "4553a8227eaca791b2f6bdaca7de0a90b1e3d8a57c17c110b9f8095d266c2ddf" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.4.zip", "has_sig": false, "md5_digest": "ce2bd1d1df6436583eb3588f78cc2a0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29941, "upload_time": "2016-06-05T11:31:06", "url": "https://files.pythonhosted.org/packages/cf/9d/534679d3ed7c4eaced5787e70a524bed533b0cff418634cde35dab44a947/crowdin-cli-py-0.95.4.zip" } ], "0.95.5": [ { "comment_text": "", "digests": { "md5": "f5293787ca7f48d4e937db3ed3c048b1", "sha256": "7eb245e615f103d1551f6ba6ac1dd9822181828db0eb775c4c92ed2bacd53b98" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.5.zip", "has_sig": false, "md5_digest": "f5293787ca7f48d4e937db3ed3c048b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29412, "upload_time": "2016-06-29T20:50:30", "url": "https://files.pythonhosted.org/packages/3a/01/fed05e397515b571c3b3c2047660b9c7bb34c0f82176ec8e55605e225861/crowdin-cli-py-0.95.5.zip" } ], "0.95.6": [ { "comment_text": "", "digests": { "md5": "0291e0c3c81f6ab553dda9d812254f71", "sha256": "85bd7a7eeafddc2274937af990eea1f752c1d4259c29c827e8eed94a85d7cb9b" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.6.zip", "has_sig": false, "md5_digest": "0291e0c3c81f6ab553dda9d812254f71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30224, "upload_time": "2018-02-12T18:48:40", "url": "https://files.pythonhosted.org/packages/33/50/647665bed6af8d936af58ede47ee06b7ff2371028bbaf0c63436d0eefdab/crowdin-cli-py-0.95.6.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0291e0c3c81f6ab553dda9d812254f71", "sha256": "85bd7a7eeafddc2274937af990eea1f752c1d4259c29c827e8eed94a85d7cb9b" }, "downloads": -1, "filename": "crowdin-cli-py-0.95.6.zip", "has_sig": false, "md5_digest": "0291e0c3c81f6ab553dda9d812254f71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30224, "upload_time": "2018-02-12T18:48:40", "url": "https://files.pythonhosted.org/packages/33/50/647665bed6af8d936af58ede47ee06b7ff2371028bbaf0c63436d0eefdab/crowdin-cli-py-0.95.6.zip" } ] }