Object -> unicode mapper
Project description
obj2uni
=======
This packages defines the single function, `obj2uni`, which returns
Unicode strings for sequences of any objects. Each string
has the length equal to the length of the corresponding sequence.
Multiple sequences share the same character mapping.
This function can be useful for other packages which operate on strings faster,
e.g. for computing Levenshtein distance.
```Python
>>> from obj2uni import obj2uni
>>> obj2uni((1, 2, 3, None), ('test', 'ham', 'spam', 3.14159))
(('\x01\x02\x03\x00', '\x07\x05\x06\x04'),
{'\x00': None,
'\x01': 1,
'\x02': 2,
'\x03': 3,
'\x04': 3.14159,
'\x05': 'ham',
'\x06': 'spam',
'\x07': 'test'})
```
Released under MIT license. Copyright © 2016 Mail.Ru Group LLC.
=======
This packages defines the single function, `obj2uni`, which returns
Unicode strings for sequences of any objects. Each string
has the length equal to the length of the corresponding sequence.
Multiple sequences share the same character mapping.
This function can be useful for other packages which operate on strings faster,
e.g. for computing Levenshtein distance.
```Python
>>> from obj2uni import obj2uni
>>> obj2uni((1, 2, 3, None), ('test', 'ham', 'spam', 3.14159))
(('\x01\x02\x03\x00', '\x07\x05\x06\x04'),
{'\x00': None,
'\x01': 1,
'\x02': 2,
'\x03': 3,
'\x04': 3.14159,
'\x05': 'ham',
'\x06': 'spam',
'\x07': 'test'})
```
Released under MIT license. Copyright © 2016 Mail.Ru Group LLC.
Project details
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
obj2uni-1.0.tar.gz
(2.9 kB
view details)
File details
Details for the file obj2uni-1.0.tar.gz
.
File metadata
- Download URL: obj2uni-1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf55bf9c4afcef6c71538abc2d6f0b792ae0abad62822b61398685576098c1b8 |
|
MD5 | 5055aef3f2ec1c954927318582d19db6 |
|
BLAKE2b-256 | 42444073a12618bcaf75905d7eed5be93a35c5d8b08201d355dd128b04a9cb21 |