🧠 nemony
Deterministically encode text as mnemonic adjective-noun pairs.
The same text should be identically encoded across systems. While there are currently more than 800,000 combinations of adjective and noun, collisions (two texts having the same mnemonic) can happen.
Installation
The easy way
Install the pre-compiled version from PyPI:
pip install nemony
From source
Clone the repository, then cd into it. Then run:
pip install -e .
Usage
Command line
You can use nemony to encode lines of text from a file
(the header info goes to stderr).
$ printf 'hello\nworld' > tmp.txt
$ nemony tmp.txt
## MNEMO: Generate adjective-noun mnemonics
Word list version: fancy_telecom
- Number of adjectives: 581
- Number of nouns: 1450
- Combinations: 842450
decorous_block
late_kevin
Or pipe from from stdin.
$ printf 'hello\nworld' | nemony
## MNEMO: Generate adjective-noun mnemonics
Word list version: fancy_telecom
- Number of adjectives: 581
- Number of nouns: 1450
- Combinations: 842450
decorous_block
late_kevin
You can also run interactively to check one thing at a time. Bear in mind that this encodes the whole text, not one line a time.
$ nemony -i
## MNEMO: Generate adjective-noun mnemonics
Word list version: fancy_telecom
- Number of adjectives: 581
- Number of nouns: 1450
- Combinations: 842450
(Ctrl-C to exit.)
What would you like to encode?
?> hello
decorous_block
?> world
late_kevin
?> hello\nworld
warm_dominic
usage: nemony [-h] [--interactive] [--output [OUTPUT]] [input]
Encode lines of text deterministically as adjective-noun mnemonics.
positional arguments:
input File to read and emit one mnemonic per line. Default STDIN.
options:
-h, --help show this help message and exit
--interactive, -i Run interactively.
--output [OUTPUT], -o [OUTPUT]
Output file. Default STDOUT.
Python API
You can import nemony and use it to encode Python objects, as long as they can be converted to strings.
>>> import nemony as nm
>>> nm.encode('world', sep='-')
'late-kevin'
>>> nm.encode('world', sep='-', n=5)
'peppy-gabriel'
>>> nm.encode(5.)
'live_drum'
>>> nm.encode(['hello', 'world'])
'receding_cheese'
As a convenience, you can also use the SHA-256 hashing functions
(which use Python standard library hashlib).
>>> nm.hash('world')
'486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7'
>>> nm.hash('world', n=8)
'486ea462'
>>> nm.hash(5., n=8)
'a19a1584'
Documentation
Check the Python API at ReadTheDocs.
Metadata
Release files for nemony 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nemony-0.0.2.tar.gz | 17.3 kB | Without provenance | Details for nemony-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nemony-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for nemony-0.0.2-py3-none-any.whl |
Total release size: 33.4 kB
Release files / nemony-0.0.2.tar.gz
| Download URL | nemony-0.0.2.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fffb99721910caea5ee6bfc57483b49d68aeadd0beb974145a887ea4f4645080
|
|
BLAKE2b-256 checksum How to use checksums |
f6965bbe63e3ea3103cdc7ca951e0d143f0b7201726868fcf6adffe62c63700a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / nemony-0.0.2-py3-none-any.whl
| Download URL | nemony-0.0.2-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dcac87d1d472e3264a428e7bc43fc6fc51351e8eef5690e6024224e9b466284
|
|
BLAKE2b-256 checksum How to use checksums |
38477bc5565e920e9e3d04f6cb89e90d12e3d6ed010389e8465c93458c15f07d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for nemony 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.