Skip to main content

hm

Mnemonic tools: for now, the mnemonic major system, which turns numbers into pronounceable words you can remember.

pip install hm

Mnemonic Major System

The major system is a mnemonic technique used to aid in memorizing numbers.

It works as follows:

>>> from hm import MajorSystem
>>> m = MajorSystem()

The "Mnemonic Major System" (https://en.wikipedia.org/wiki/Mnemonic_major_system) assigns a set of similar phonemes to each digit:

>>> assert m.phones_for_num == {
...     0: {'S', 'Z'},
...     1: {'D', 'DH', 'T', 'TH'},
...     2: {'N'},
...     3: {'M'},
...     4: {'R'},
...     5: {'L'},
...     6: {'CH', 'JH', 'SH'},
...     7: {'G', 'K'},
...     8: {'F', 'V'},
...     9: {'B', 'P'}
... }

As a consequence these phonemes are mapped to numbers:

>>> assert m.num_of_phone == {
...     'B': 9,
...     'CH': 6,
...     'D': 1,
...     'DH': 1,
...     'F': 8,
...     'G': 7,
...     'JH': 6,
...     'K': 7,
...     'L': 5,
...     'M': 3,
...     'N': 2,
...     'P': 9,
...     'R': 4,
...     'S': 0,
...     'SH': 6,
...     'T': 1,
...     'TH': 1,
...     'V': 8,
...     'Z': 0
... }

Any sentence has a corresponding phoneme sequence:

>>> m.term_to_phones('wild cat')
['W', 'AY1', 'L', 'D', 'K', 'AE1', 'T']

The system doesn't contain all phonemes; only some of the consonant phonemes. So if we only keep those phonemes that the system covers, we get:

>>> m.term_to_mst_sequence('wild cat')
['L', 'D', 'K', 'T']

Which corresponds to a number.

>>> m.term_to_nums('wild cat')
[5, 1, 7, 1]

But really, the system is used to be able to create words (therefore images) that correspond to a sequence of numbers, so that one can remember them:

>>> m.terms_of_numstr['3214']  # doctest: +NORMALIZE_WHITESPACE
['hammontree', 'mahindra', 'manteer', 'mantra', 'mentor', 'minteer', 'mondry',
'monetary', 'monteiro', 'monterey', 'montero', 'monterrey', 'montrouis',
'montroy', 'montuori', 'omohundro']

Metadata

Release files for hm 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hm 0.0.8
File Size Uploaded Provenance Actions
hm-0.0.8.tar.gz 13.5 kB Without provenance Details for hm-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hm 0.0.8
File Interpreter ABI Platform Actions
hm-0.0.8-py3-none-any.whl Python 3 none any Details for hm-0.0.8-py3-none-any.whl

Total release size: 22.2 kB

Release files / hm-0.0.8.tar.gz

Download URL hm-0.0.8.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d4e3463e719c528b3e3ca2c2ce2bd4ee5748670dc6256da721a974fdec43ed4
BLAKE2b-256 checksum
How to use checksums
052c8a34baa1ff3879509a883b9d3a9957f308ebcfc4501d5e482f5a418cf10e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hm-0.0.8-py3-none-any.whl

Download URL hm-0.0.8-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c7df230386b435e7c29ce87dd3b237227f7267a97dfa671390fd1eecde70dca
BLAKE2b-256 checksum
How to use checksums
41344949287dcd45a531d2b4bee9a85642687be4bd144bf6efdf280c83e7a908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hm 0.0.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page