MJPN — Moroccan Jewish Phonetic Names
Phonetic root computation for Moroccan Jewish surnames — the exact engine behind yahasra.org's search across 32,000+ burial records from Jewish cemeteries in Morocco.
Moroccan Jewish surnames were written down by French, Spanish and Hebrew
scribes, each with their own orthography: the same family appears as
Ouaknine, Vaknin, Aknin, Boaknin, Oiknine… MJPN reduces every variant to a
stable phonetic root (AKNN), so records that belong together can be found
together.
Install
pip install mjpn
Command line
mjpn myfile.xlsx # xlsx with a "Names" column (case-insensitive)
mjpn # first .xlsx found in the current script folder
mjpn --name COHEN OUAKNINE "LEVY BENCHETON"
mjpn --selftest
The xlsx run writes <input>_mjpn.xlsx next to the input, with:
- sheet MJPN —
name, root, root2, subroot, subroot2, special_mapping, status(statusisok/compound/invalid/empty) - sheet Stats — totals, family-size distribution, top families, roots split by v4 subroot
and prints the stats summary to stdout.
Python API
from mjpn import normalize_to_phonetic, compute_compound_indices_v4
normalize_to_phonetic("OUAKNINE") # 'AKNN'
normalize_to_phonetic("BENARROCH") # 'HRSH'
compute_compound_indices_v4("levy bencheton")
# ('LB', 'SHTN', 'LB~A', 'SHTN~AO') — compound dual index + v4 subroots
How it works
Four normalization stages (engine v3.5.2, v4 subroot chain):
- Start patterns — Berber orthographic variants (OI→A) before anything else.
- Prefix stripping — patronymic prefixes (BEN, IBN, OU, HA, EL…) with structural-name exception lists so Hamou or Elfassy keep their prefix.
- Phonetic rules — digraphs (CH→SH…), context-dependent C, V/W→B, Spanish plural -IAS→-IA, smart vowel-pair handling (based on Beider's A Dictionary of Jewish Surnames from Maghreb, 2017).
- Consonant skeleton — the root; a vowel-class signature on top yields the v4 subroot that keeps genuinely different families apart.
Plus 149 exact and 2 regex special mappings for families whose variants defy the rules (Abuhatzeira, Azoulay, Zrihen…), curated from the yahasra.org adjudication process.
mjpn/mjpn_tool.py is generated from the production engine and verified
against it: identical output on all 3,933 distinct surnames of the yahasra.org
burials database (0 mismatches).
Citation
If you use MJPN in academic work, please cite:
Ouaknine, Y. (2026). MJPN: Moroccan Jewish Phonetic Names — the phonetic indexing engine of yahasra.org, the Moroccan Jewish cemeteries database. https://yahasra.org
License
MIT © Dr Yohanan Ouaknine
Provenance and AI disclosure
The engine (app/phonetic_normalizer.py in the Yahasra codebase) encodes
orthographic rules authored and adjudicated by Dr Yohanan Ouaknine, tuned
against Beider (2017) with page references recorded per rule. This package is
generated mechanically from that engine by scripts/build_mjpn_tool.py — no
hand-maintained copy exists — and each release is parity-checked against the
full live corpus (5,314 distinct surnames, zero mismatches required).
Portions of the engine's implementation code and this package's build tooling were produced with assistive AI (Anthropic Claude: Sonnet 4.x and Opus 4.x/5, 2025-06 through 2026-08) under human direction and review; all linguistic rules, special mappings and adjudications are human decisions. This disclosure follows the AI policy of the Journal of Cultural Analytics.
Version
Package 6.0.0 wraps engine 6.0.0 (v4 chain: subroots + compound dual indexing), generated 2026-11-16 with 98 exact + 1 regex special mappings.
Metadata
Release files for mjpn 6.0.0
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 |
|---|---|---|---|---|
| mjpn-6.0.0.tar.gz | 20.2 kB | Without provenance | Details for mjpn-6.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mjpn-6.0.0-py3-none-any.whl | Python 3 | none | any | Details for mjpn-6.0.0-py3-none-any.whl |
Total release size: 39.2 kB
Release files / mjpn-6.0.0.tar.gz
| Download URL | mjpn-6.0.0.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06d7ad1b160a78c6f759bede656cad1c671ba0708d21a7ee293c10f994b0a033
|
|
BLAKE2b-256 checksum How to use checksums |
e2a0e4abad4ec41d1104c479c5ec9d8ae597f6c2b4dff7c0bf9279f7093daa44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.20
|
Release files / mjpn-6.0.0-py3-none-any.whl
| Download URL | mjpn-6.0.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
038f453d94198f08661fb2c3b4f1ffa81bb5d861478111329d700be3ea6b1ae5
|
|
BLAKE2b-256 checksum How to use checksums |
97080f7cfee38f5d9e9df1b990f7eccadf475ba24ac75fdf75a3d3c9b554ac84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.20
|
Security for mjpn 6.0.0
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.