Django World Languages
Django World Languages (DWL) provides you with language related models:
Language
Family - Both ISO 639-5 and Glottolog language families
Dialect - Slightly different dictions and pronunciations of languages
LexicalSimilarity - Similarities between languages
and language metadata:
UsedIn - Maps languages to countries they are spoken in
Characteristic - Common characteristics of languages (word type orders, number of speech sounds, subject/verb/object order, syllable patterns)
Script and ScriptStyle - Characters that are used in languages
DevelopmentNote - Development statuses of languages (tags, Bible translations, literacy rates)
Installation
Install it with pip:
pip install django-world-languagesAdd world_languages to the INSTALLED_APPS variable in your project’s settings.py file:
INSTALLED_APPS = [ # ... 'world_languages', # ... ]Create the database tables:
python manage.py migrate world_languages
Configuration
All configuration options should be specified in the LANGUAGE_SETTINGS variable in your project’s settings.py file.
PLUGINS - You can specify your own functions to run before and after a language is created. This should be specified as a dictionary mapping signal names to your custom function in dotted-module notation.
Example
LANGUAGE_SETTINGS = { 'PLUGINS': { 'pre_language': 'custom_app.utils.function_name' }, # ... }FILES - You can also specify your own URLs where files are hosted.
Example
LANGUAGE_SETINGS = { # ... 'FILES': { 'language': { 'filename': 'iso-languagecodes.txt', 'urls': [url_bases['geonames']['dump'] + '{filename}'], 'fields': [ 'iso639-3', 'iso639-2', 'iso639-1', 'name', ] }, 'glottolog': { 'filename': 'languages.yaml', 'urls': [url_bases['glottolog']['languoids'] + '{filename}'], } } }
Import Data
Once you have created the models and adjusted the settings to your liking, you will need to import data into your database with the provided world_languages management command:
python manage.py world_languages --import=all
TODO
Tests
Add import signals for all models, not just Language
Reporting Bugs
This package uses regexes to parse downloaded YAML, HTML, and text files from Glottolog, Wikipedia, and Geonames. If you find a bug, especially in the import script, please open an issue on Github.
Metadata
Release files for django-world-languages 0.1
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 |
|---|---|---|---|---|
| django-world-languages-0.1.tar.gz | 53.8 kB | Without provenance | Details for django-world-languages-0.1.tar.gz |
Release files / django-world-languages-0.1.tar.gz
| Download URL | django-world-languages-0.1.tar.gz |
|---|---|
| Size | 53.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d3cc0914af675f4c7daf34db7ad6391de340768e0518e5d4bf0b33b3e1e1e10
|
|
BLAKE2b-256 checksum How to use checksums |
100d4815340d40c1330dd5ebcce890f0957a1a62531b760249cb4398ef1039ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-world-languages 0.1
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.