© 2019 Alice Bevan-McGregor and contributors.
Please describe the package here in few sentences; the goal is about a paragraph. Something easy to digest, but not too brief to give a good idea of what the package is for. For example, this is not a real package, it's a package template for "unpacking" on GitHub using their Repository Templates feature. You won't find this on the Python Package Index (Pypi).
Provide a more detailed or in-depth description here, being sure to cover both rationale and goals.
Installing bcp47
is easy, just execute the following in a terminal:
pip install bcp47
Note: We strongly recommend always using a container, virtualization, or sandboxing environment of some kind when developing using Python. We highly recommend use of the Python standard venv
("virtual environment") mechanism.
If you add bcp47
to the install_requires
argument of the call to setup()
in your application's setup.py
or setup.cfg
files, bcp47 will be automatically installed and made available when your own application or library is installed. Use bcp47 ~= 1.0.0
to get all bugfixes for the current release while ensuring that large breaking changes are not installed by limiting to the same major/minor, >= the given patch level.
This package has the following dependencies:
- A Python interpreter compatible with CPython 3.7 and or newer, i.e. official CPython or Pypy.
Development takes place on GitHub in the bcp47 project. Issue tracking, documentation, and downloads are provided there.
Installing the current development version requires Git), a distributed source code management system. If you have Git you can run the following to download and link the development version into your Python runtime:
git clone https://github.com/marrow/bcp47.git
pip install -e 'bcp47[development]'
You can then upgrade to the latest version at any time, from within that source folder:
git pull
pip install -e '.[development]'
If you would like to make changes and contribute them back to the project, fork the GitHub project, make your changes, and submit a pull request. This process is beyond the scope of this documentation; for more information see GitHub's documentation.
Describe the basic steps required to utilize this package. Provide additional sections or subsections as needed. If this documentation exceeds an additional section or two, consider writing a GitBook instead.
The identification and representation of languages has a long history.
In 1995 RFC 1766 was written to define how "to indicate the language used in an information object", and defines the Content-Language
MIME (also HTTP) header. It defines the basic structure of a serialized language tag:
-
A primary language tag, e.g.
en
, of between 1 and 8 alphanumeric characters. -
One or more optional hyphen-separated subtags, with each tag itself between 1 and 8 alphanumeric characters.
Whitespace is not permitted within a tag. Tags are handled case-insensitively and case should not be used to convey meaning. All two-letter codes within the first tag component are interpreted as per ISO 639. The value i
is reserved, x
is defined as for private use. Other values cannot be used.
The first subtag is usually an ISO 639 two-character country code indicating a regional variant (e.g. en-CA
v. en-US
) of the overall language, as defined in that ISO standard. This may also be a dialect declaration, such as en-cockney
. There are other cases, for example languages not listed, such as i-cherokee
. Lastly, there may be "script variations", e.g. az-arabic
v. az-cyrillic
.
This project has yet to make any releases. When it does, each release should be documented here with a sub-section for the version, and a bulleted list of itemized changes tagged with the kind of change, e.g. fixed, added, removed, or deprecated.
bcp47 has been released under the MIT Open Source license.
Copyright © 2019 Alice Bevan-McGregor and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.