====
C3PO is Python module responsible for converting all .po files from locale directory into one .ods file
and sending it to the Google Docs (spreadsheet link provided by user), so users with access to that spreadsheet
can translate expression included there.
This module provides Communicator which deals with uploading, downloading these translations and synchronizing
whole content by merging it.
Package contains basic methods for converting po files into csv, ods formats and back. It also provides
methods for git push and git checkout po files into repository.
Getting started
---------------
### Settings
To manage all settings values module gives possibility to pass them directly as arguments to every method call
or define them in special settings file. Default settings can be found in settings_default.py file.
During the first usage, module copies this file to your home directory into .c3po/settings.py.
In order to change default user authentication info and url, you have to change values in this setting file.
Look into the file and feel free to change variables' standard values.
Module gives you possibility to overload settings.py values when executing from command line.
Execute script with -h option to see what can be changed. For example, executing with different email address:
$ python c3po.py upload -e email@email.com
### Using Communicator
To start communication with GDOcs you should import `c3po.mod.communicator.Communicator` and create `Communicator`
object. If you have your settings.py properly defined, just create Communicator without any arguments. It will then
take settings values and log in into your Google account.
Object provides methods:
- `synchronize()` - looks for all .po files, converts them into .csv, looks for differences between them and GDoc,
writes them into .ods file and uploads merged content to spreadsheet
- `upload()` - looks for all .po files, converts them into .ods and uploads it to spreadsheet
- `download()` - downloads two .csv files with translations and metadata from Google Spreadsheet and converts
it's content into .po files structure
- `clear()` - clears content of the spreadsheet
Package communicator also provides functions `git_push()` responsible for uploading locale folder into git
and `git_checkout()` doing branch checkout. It's values also can be defined in settings file
or passed to function directly as arguments.
### Converters
Package converters contains three functions used by communicator:
- `po_to_csv_merge()` - looks for .po files in locale directory structure, and merges new translations with gdoc.csv
writing them into two new csv files with translations and metadata
- `csv_to_po()` - converts translations and metadata csv files into .po files structure
- `po_to_ods()` - converts locale folder with po files into one ods file with two worksheets - translations
and metadata
- `csv_to_ods()` - converts two csv files with translations and metadata info one ods file
Metadata
Release files for C3PO 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| C3PO-0.3.0.tar.gz | 13.9 kB | Without provenance | Details for C3PO-0.3.0.tar.gz |
Release files / C3PO-0.3.0.tar.gz
| Download URL | C3PO-0.3.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d86d6ab8d228f3f4b91f22ff19c25c629aa5540fac9d4d9347efff697a7ba85
|
|
BLAKE2b-256 checksum How to use checksums |
bfab41fcd8f4e33fe5f49abe983ba66ee9188a7d74f7becfc96b4ea719db6511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for C3PO 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.