Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

SQLAlchemy internationalisation

Project description

traduki: SQLAlchemy internationalisation

The traduki package provides internationalisation helper classes for SQLAlchemy-based projects.


pip install traduki


traduki usage example:

from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

import traduki

def get_current_language():
    """Current language callback for our project."""
    return request.locale

def get_language_chain():
    """Language chain (fallback rule) callback for our project."""
    return {'*': request.locale}

i18n_attributes = traduki.initialize(Base, ['en', 'ru'], get_current_language, get_language_chain)

Session = sessionmaker(bind=engine)
sess = Session()

class MyModel(Base)

    title_id = i18n_attributes.i18n_column(nullable=False, unique=False)
    title = i18n_attributes.i18n_relation(title_id)

my_object = MyModel()
my_object.title = {'en': 'English title', 'pt': 'Portugese title'}

assert sess.refresh(my_object).title.get_dict() == {'en': 'English title', 'pt': 'Portugese title'}


If you have questions, bug reports, suggestions, etc. please create an issue on the GitHub project page.


This software is licensed under the MIT license

See License

© 2013 Paylogic International.



  • Fix get_text_from_dict raising an exception when no language can be detected.


  • Initial public release

Project details

Release history Release notifications

This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
traduki-1.0.1.tar.gz (6.0 kB) Copy SHA256 hash SHA256 Source None Apr 12, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page