{"id":13870033,"url":"https://github.com/jjmontesl/codenamize","last_synced_at":"2025-07-15T20:31:07.356Z","repository":{"id":8489681,"uuid":"58593479","full_name":"jjmontesl/codenamize","owner":"jjmontesl","description":"Generate consistent easier-to-remember codenames from strings and numbers.","archived":false,"fork":false,"pushed_at":"2022-02-03T22:32:12.000Z","size":36,"stargazers_count":137,"open_issues_count":1,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-14T15:36:03.628Z","etag":null,"topics":["codename","hashes","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjmontesl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-12T00:27:19.000Z","updated_at":"2024-10-03T15:35:07.000Z","dependencies_parsed_at":"2022-08-07T04:16:35.775Z","dependency_job_id":null,"html_url":"https://github.com/jjmontesl/codenamize","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmontesl%2Fcodenamize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmontesl%2Fcodenamize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmontesl%2Fcodenamize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjmontesl%2Fcodenamize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjmontesl","download_url":"https://codeload.github.com/jjmontesl/codenamize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226068150,"owners_count":17568703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codename","hashes","python"],"created_at":"2024-08-05T20:01:26.091Z","updated_at":"2024-11-23T16:30:59.519Z","avatar_url":"https://github.com/jjmontesl.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Codenamize\n==========\n\n**Generate consistent easier-to-remember codenames from strings and numbers.**\n\n\nOverview\n========\n\n**Codenamize** is a command line tool and Python library that\nreturns consistent names for objects, by joining\nadjectives and words together. These are easier to remember and\nwrite down than pure numbers, and can be used instead or along UUIDs,\nGUIDs, hashes (MD5, SHA...), network addresses and other difficult\nto remember strings.\n\nThis can be used to replace identifiers or codes when presenting those to users.\nAs words are easier to identify and remember for humans, this module maps\nPython objects to easy to remember words.\n\nThere are also [Ruby](https://github.com/DannyBen/concode), and [JavaScript](https://github.com/stemail23/codenamize-js) ports available.\n\nHow to install\n==============\n\n    1. easy_install codenamize\n    2. pip install codenamize\n    3. git clone http://github.com/jjmontesl/codenamize\n        a. cd codenamize\n        b. run python setup.py\n    4. wget https://github.com/jjmontesl/codenamize/zipball/master\n        a. unzip the downloaded file\n        b. cd into codenamize-* directory\n        c. run python setup.py\n\n\nUsage from Python\n-----------------\n\nImport the codenamize function:\n\n    \u003e\u003e\u003e from codenamize import codenamize\n\nConsecutive numbers yield differentiable codenames:\n\n    \u003e\u003e\u003e codenamize(\"1\")\n    'familiar-grand'\n    \u003e\u003e\u003e codenamize(\"2\")\n    'little-tip'\n\nIf you later want to add more adjectives, your existing codenames\nare retained as suffixes:\n\n    \u003e\u003e\u003e codenamize(\"11:22:33:44:55:66\")\n    'craven-delivery'\n    \u003e\u003e\u003e codenamize(\"11:22:33:44:55:66\", 2)\n    'separate-craven-delivery'\n\nNote that integers are internally converted to strings before hashing:\n\n    \u003e\u003e\u003e codenamize(1)\n    'familiar-grand'\n\nOther options (max characters, join character, capitalize):\n\n    \u003e\u003e\u003e codenamize(0x123456aa, 2, 3, '', True)\n    'SadBigFat'\n    \u003e\u003e\u003e codenamize(0x123456aa, 2, 0, '', True)\n    'BrawnyEminentBear'\n    \u003e\u003e\u003e codenamize(0x123456aa, 5, 0, ' ', True)\n    'Spotty Disagreeable Modern Brawny Eminent Bear'\n    \u003e\u003e\u003e codenamize(0x123456aa, 4, 0, ' ', False)\n    'disagreeable modern brawny eminent bear'\n\n\nUsage as command line tool\n--------------------------\n\nAfter installing, run `codenamize --help` for help:\n\n    usage: codenamize [-h] [-p PREFIX] [-m MAXCHARS] [-j JOIN] [-c] [--space]\n                      [--tests] [--version]\n                      [strings [strings ...]]\n\n    Generate consistent easier-to-remember codenames from strings and numbers.\n\n    positional arguments:\n      strings               One or more strings to codenamize.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -p PREFIX, --prefix PREFIX\n                            number of prefixes to use\n      -m MAXCHARS, --maxchars MAXCHARS\n                            max word characters (0 for no limit)\n      -a HASH_ALGO, --hash_algorithm HASH_ALGO\n                            the algorithm to use to hash the input value\n                            (default: md5)\n      -j JOIN, --join JOIN  separator between words (default: -)\n      -c, --capitalize      capitalize words\n      --space               show codename space for the given arguments\n      --tests               show information and samples\n      --list_algorithms     List the hash algorithms available\n      --version             show program's version number and exit\n\n\nExamples\n--------\n\nFor numbers 100000-100009, show codenames with 0-2 adjectives and different options:\n\n    OBJ       ADJ0-MAX5    ADJ1-MAX5         ADJ2-MAX5  ADJ-0, ADJ-1, ADJ-2 (capitalized, empty join character)\n    100001         boat   funny-boat   real-funny-boat  Community, RacialCommunity, PluckyRacialCommunity\n    100002        award  first-award  tidy-first-award  Repeat, UptightRepeat, HelpfulUptightRepeat\n    100003         rush   super-rush  equal-super-rush  Intention, ExpensiveIntention, JazzyExpensiveIntention\n    100004        uncle   calm-uncle   icky-calm-uncle  March, SubduedMarch, AdamantSubduedMarch\n    100005        salad   warm-salad   true-warm-salad  Plant, QuickestPlant, ReminiscentQuickestPlant\n    100006         gift   witty-gift    odd-witty-gift  Estimate, CreepyEstimate, SpectacularCreepyEstimate\n    100007          son     zany-son    gaudy-zany-son  Truck, MiniatureTruck, OptimalMiniatureTruck\n    100008        angle   damp-angle  dusty-damp-angle  Steak, SpectacularSteak, RightfulSpectacularSteak\n    100009         link   utter-link   null-utter-link  Bike, ImportantBike, SweetImportantBike\n\n\nCodename space sizes\n--------------------\n\nIn selecting the number of adjectives and max chars to use, consider how\nmany codenames you need to fit the number of objects you'll handle, since\nthe probability of collision increases with the number of different objects\nused.\n\n    0 adj (max 3 chars) = 115 combinations\n    0 adj (max 4 chars) = 438 combinations\n    0 adj (max 5 chars) = 742 combinations\n    0 adj (max 6 chars) = 987 combinations\n    0 adj (max 7 chars) = 1176 combinations\n    0 adj (max 0 chars) = 1525 combinations\n    1 adj (max 3 chars) = 2760 combinations\n    1 adj (max 4 chars) = 56940 combinations\n    1 adj (max 5 chars) = 241150 combinations\n    1 adj (max 6 chars) = 492513 combinations\n    1 adj (max 7 chars) = 789096 combinations\n    1 adj (max 0 chars) = 1701900 combinations\n    2 adj (max 3 chars) = 66240 combinations\n    2 adj (max 4 chars) = 7402200 combinations\n    2 adj (max 5 chars) = 78373750 combinations\n    2 adj (max 6 chars) = 245763987 combinations\n    2 adj (max 7 chars) = 529483416 combinations\n    2 adj (max 0 chars) = 1899320400 combinations\n\nAn example is shown by running  codenamize --tests .\n\n\nOther versions\n==============\n\n* [Concode](https://github.com/DannyBen/concode) - Ruby port (thanks to Danny Ben Shitrit)\n* [Codenamize JS](https://github.com/stemail23/codenamize-js) - JavaScript port (by Steven Barlow)\n\n\nLicense\n====================\n\nCodenamize is released under MIT license.\n\nFor full license see the LICENSE file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjmontesl%2Fcodenamize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjmontesl%2Fcodenamize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjmontesl%2Fcodenamize/lists"}