Taal
Taal is a framework for translating your data. It plugs in to e.g. SQLAlchemy or Kaiso, providing a TranslatableString field type and a mechanism for storing and retrieving content in multiple languages.
For use-cases where the most common interaction with the translated data is for reading, an application can be set up so that language context and translations are handled centrally, after which business logic can be written almost as it would for a single-language app.
Philosophy
Taal uses a two-phase process for managing translatable data. Upon retrieval, data is marked up as “requires translation”. Subsequently (typically higher up in the stack, e.g. in some middleware), information about which particular language we are interested in may be supplied to find the actual translation string.
Example use
class MyModel(Base):
__tablename__ = "my_model"
id = Column(Integer, primary_key=True)
name = Column(TranslatableString())
>>> instance = session.query(MyModel).first()
>>> instance.name
<TranslatableString: (...)>
>>> translator = get_translator('en')
>>> translator.translate(instance.name)
"Spam"
Development
To make your life easier, create a setup.cfg file with a [pytest] section to define your database and neo4j connection strings:
$ cat setup.cfg [pytest] addopts= --neo4j_uri=http://... --db_uri=mysql://...
(Note that pytest gets upset if you indent the addopts line)
Metadata
Release files for taal 0.8.2
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 |
|---|---|---|---|---|
| taal-0.8.2.tar.gz | 13.0 kB | Without provenance | Details for taal-0.8.2.tar.gz |
Release files / taal-0.8.2.tar.gz
| Download URL | taal-0.8.2.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28078494fa2b7d05bce5614c0c36e4009cca1954da862f9d48c24f4ac15d2fbe
|
|
BLAKE2b-256 checksum How to use checksums |
f9918836591211ec4eb5430ee6015cc3abc3c840e2b7d44389044089b8da0464
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for taal 0.8.2
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.