Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vmarkovtsev/obj2uni
Arbitrary object -> unicode mapper
https://github.com/vmarkovtsev/obj2uni
Last synced: 22 days ago
JSON representation
Arbitrary object -> unicode mapper
- Host: GitHub
- URL: https://github.com/vmarkovtsev/obj2uni
- Owner: vmarkovtsev
- License: mit
- Created: 2016-04-14T08:47:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-14T09:49:04.000Z (over 8 years ago)
- Last Synced: 2024-10-05T14:34:18.197Z (about 1 month ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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.