Naming avoiding ambiguity automatically assigning valid identifiers
Naaaavi (pronounced nah-vee as if someone hadn't injected a load of ambiguous confusing a characters) is a simple Python tool for generating identifiers.
It is an ambitious attempt to solve one of the most difficult problems in computer science: naming things. Naaavi attempts to generate identifiers that:
- use a character set (or other system) that aims to be human-friendly
- can be checksummed
- avoid ambiguity by testing the identifier against several
rejectors - are somewhat chronologically sortable
- are generated in a predictable fashion
It generates human-friendly identifiers using diceware (soon) or the zbase32 alphabet, and allows for screening of common sources of confusion such as look-alike pairs and repetitive characters. Naaaavi also provides limited support for generating ZPL to print your nice new identifiers.
Naaaavi does not:
- randomly generate identifiers
- encode anything into the identifiers
- generate universally or globally unique identifiers
$ naaaavi generate --alphabet zbase32 --checksum luhn_mod_n --size 5 --rejectors max_repeats:2 min_unique:3 ismp_flips: better_profanity: -n 10 --prefix 'HOOT-' --upper
HOOT-YYBYN4 HOOT-YYBYN 4 zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYDA HOOT-YYBYD A zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYRS HOOT-YYBYR S zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYFW HOOT-YYBYF W zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYG1 HOOT-YYBYG 1 zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBY8O HOOT-YYBY8 O zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYEQ HOOT-YYBYE Q zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYJC HOOT-YYBYJ C zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYKK HOOT-YYBYK K zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
HOOT-YYBYME HOOT-YYBYM E zbase32 luhn_mod_n max_repeats:2;min_unique:3;ismp_flips:;better_profanity: 0.4.1
$ naaaavi validate --alphabet zbase32 --checksum luhn_mod_n --barcodes HOOT-YYBYN.4 HOOT-YYBYN4 YYBYN4 YYBYM4 YYBYN5
HOOT-YYBYN.4 1
HOOT-YYBYN4 1
YYBYN4 1
YYBYM4 0
YYBYN5 0
max_repeatswill reject any identifier which repeats a particular symbol more thanntimes consecutivelymin_uniquewill reject any identifier that does not have at leastnunique charactersismp_flipswill reject any identifier that has at least one look alike pair noted as potentially confusing by the Institute for Safe Medication Practicesban_listwill reject any identifier that has a prefix or suffix in your listregex_listwill reject any identifier that searches positive against a list of regular expressionsbetter_profanity(requirespip install better_profanity) will overzealously reject any identifier that could be mildly amusingnot_exclusivewill reject any identifier that exclusively contains a set of case-sensitive symbols
Naaaavi does not generate globally or universally unique identifiers, so please get in touch to make sure our (identifier) worlds don't collide.
The navi command is provided as a synonym of naaaavi so you don't have to remember that there are currently four a characters in naaaavi.