Package: noid
noidPython PackageInstallationInstall from PyPI withpip install noidor from source withpip install git+git@github.com:paulkorir/noid.git     # SSH
pip install git+https://github.com/paulkorir/noid.git # HTTPSCLI UsageGenerating a noidUse thenoidcommand with no arguments:noidThere are various options available using-h/--help:noid-h
usage:noid[-h][-cCONFIG_FILE][-V|-d][-sSCHEME][-NNAA][-tTEMPLATE][-nINDEX][-v][noid]generateniceandopaqueidentifiers

positionalarguments:noidanoid

optionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG_FILE,--config-fileCONFIG_FILEpathtoaconfigfilewithanoidsection-V,--validatevalidatethegivennoid[default:False]-d,--check-digitcomputeandprintthecorrespondingcheckdigitforthegivennoid[default:False]-sSCHEME,--schemeSCHEMEthenoidscheme[default:'ark:/']-NNAA,--naaNAAthenameassigningauthority(NAA)number[default:]-tTEMPLATE,--templateTEMPLATEthetemplatebywhichtogeneratenoids[default:'zeeddk']-nINDEX,--indexINDEXanumberforwhichtogenerateavalidnoid[default:randompositiveinteger]-v,--verboseturnonverbosetext[default:False]Validating a noidValidate a noid using the-v/--validateflag and pass a noid.noid-v$(noid)# self-validationCompute the check digit for a noidCompute the check digit using-d/--check-digitflag and pass a noid.noid-d$(noid-tzeee-n1234)&&noid-tzeee-n1234&&noid-tzeeek-n1234The example above prints out the check digit, the full noid without a check digit and the full noid with a check digit.OptionsSpecify the NAAUse the-N/--naaoption.noid--naa1234Specify the schemeUse the-s/--schemeoption.noid--schemedarpa::Specify a templateUse the-t/--templateoption.noid-tzeeddeedeedkCompute a noid for a valueUse the-n/--indexoption.noid-n42Using a config fileA simple config file can be defined with the following structure:# path/to/noid.cnf[noid]# start with 'z'; follow with as many 'e' or 'd' as needed; terminate with 'k' for a checkdigittemplate=zeededdekscheme=ark:/naa=92729# the above configs will produce noids like so: ark:/92729/fn7Z344vthen use it as follows:noid-cpath/to/noid.cnfAPI UsageYou can also use this package's API in your code.importrandomfromnoidimportmint,validate,calculate_check_digit,generate_noid# with default argumentsnoid=mint()# arguments: template, n, scheme, naanoid=mint(template='zeedeeedk',n=37,scheme='https://',naa='802938')# validating a noidvalidate(noid)# True/False# calculate the check digitcalculate_check_digit(noid)# low-level generate a noid from a mask and number; no check digit is appendednoid=generate_noid('eeddeed',random.randint(100,1000))Testingpip install -r requirements.txt
toxAuthorsCurrent implementation:Paul K. KorirOriginal source code was by:Yinlin ChenTingting JiangLee HunterT. JohnsonSee also the list ofcontributorswho participated in this project.ThanksThis tool was heavily influenced fromnoid-mintReferenceshttps://confluence.ucop.edu/display/Curation/NOIDhttps://metacpan.org/dist/Noid/view/noidhttps://en.wikipedia.org/wiki/Archival_Resource_Keyhttps://www.gs1.org/standards/id-keys/global-model-number-gmnhttps://www.gs1.org/sites/default/files/docs/idkeys/gs1_gmn_executive_summary.pdfhttps://www.gs1.org/services/gmn-generatorhttps://en.wikipedia.org/wiki/Check_digit