Python Bootstring
This is a Python implementation of the Bootstring encoding algorithm, as described in RFC 3492.
The Bootstring encoding algorithm is used to encode Unicode strings into ASCII strings, and is used by the Punycode encoding algorithm.
This implementation passes all the tests in the RFC 3492 test suite, however is is not optimized for performance and might fail on edge cases not covered by the test suite.
To use it, simply pip install git+https://github.com/frereit/bootstring/ and import bootstring:
>>> import bootstring
>>> bootstring.encode("hello, world!")
'hello, world!-'
>>> bootstring.decode("hello, world!-")
'hello, world!'
>>> bootstring.encode("döner")
'dner-5qa'
>>> bootstring.decode("dner-5qa")
'döner'
>>> bootstring.encode("他们为什么不说中文")
'ihqwcrb4cv8a8dqg056pqjye'
>>> bootstring.decode("ihqwcrb4cv8a8dqg056pqjye")
'他们为什么不说中文'
Metadata
Release files for bootstring 1.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 | |
|---|---|---|---|
| bootstring-1.0.1.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bootstring-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.9 kB
Release files / bootstring-1.0.1.tar.gz
| Download URL | bootstring-1.0.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3babe893dc0c0a0c9b3f785427036b4cbe5cc6b60493dee40af9eca6a8554ece
|
|
BLAKE2b-256 checksum How to use checksums |
4c38450e6c08c1e1b970904dfb11057ed805398b314773f278a231269b3af4ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / bootstring-1.0.1-py3-none-any.whl
| Download URL | bootstring-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5afa97c1647474b37f60683b5a5e8b62197d11a0913c79e3707bba4994cbc47a
|
|
BLAKE2b-256 checksum How to use checksums |
e41329c092ae3a35dcb61b1ea53288d97e6386e3cde78b420c0b3c8b70cefd2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|