babelfish 0.6.1
pip install babelfish
Released:
A module to work with countries and languages
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD-3-Clause)
- Author: Antoine Bertin
- Tags language, country, locale
- Requires: Python <4.0, >=3.8
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
BabelFish
BabelFish is a Python library to work with countries and languages.
Usage
BabelFish provides scripts, countries and languages from their respective ISO standards and a handy way to manipulate them with converters.
Script
Script representation from 4-letter code (ISO-15924):
>>> import babelfish
>>> script = babelfish.Script('Hira')
>>> script
<Script [Hira]>
Country
Country representation from 2-letter code (ISO-3166):
>>> country = babelfish.Country('GB')
>>> country
<Country [GB]>
Built-in country converters (name):
>>> country = babelfish.Country.fromname('United Kingdom')
>>> country
<Country [GB]>
Language
Language representation from 3-letter code (ISO-639-3):
>>> language = babelfish.Language("eng")
>>> language
<Language [en]>
Country-specific language:
>>> language = babelfish.Language('por', 'BR')
>>> language
<Language [pt-BR]>
Language with specific script:
>>> language = babelfish.Language.fromalpha2('sr')
>>> language.script = babelfish.Script('Cyrl')
>>> language
<Language [sr-Cyrl]>
Built-in language converters (alpha2, alpha3b, alpha3t, name, scope, type and opensubtitles):
>>> language = babelfish.Language('por', 'BR')
>>> language.alpha2
'pt'
>>> language.name
'Portuguese'
>>> language.scope
'individual'
>>> language.type
'living'
>>> language.opensubtitles
'pob'
>>> babelfish.Language.fromalpha3b('fre')
<Language [fr]>
License
BabelFish is licensed under the 3-clause BSD license
Copyright (c) 2013, the BabelFish authors and contributors.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD-3-Clause)
- Author: Antoine Bertin
- Tags language, country, locale
- Requires: Python <4.0, >=3.8
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file babelfish-0.6.1.tar.gz
.
File metadata
- Download URL: babelfish-0.6.1.tar.gz
- Upload date:
- Size: 87.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | decb67a4660888d48480ab6998309837174158d0f1aa63bebb1c2e11aab97aab |
|
MD5 | a3ef27e5b12c795d48aa6fa4005d2826 |
|
BLAKE2b-256 | c58f17ff889327f8a1c36a28418e686727dabc06c080ed49c95e3e2424a77aa6 |
File details
Details for the file babelfish-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: babelfish-0.6.1-py3-none-any.whl
- Upload date:
- Size: 94.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 512f1501d4c8f7d38f0921f48660be7542de1a7b24abb6a6a65324a670150293 |
|
MD5 | b82dbf7639910d3908b6d717d71dfd1c |
|
BLAKE2b-256 | 95a1bd4f759db13cd8beb9c9f68682aced5d966781b9d7380cf514a306f56762 |