Skip to main content

A library to name and identify things

Project description

Roke

Roke is a tool and a library to create identifiers. The goal is that these identifiers should be:

  • More or less unique.
  • Easy to read, so you can read it to someone else over a phone, for example.
  • Configurable: not a single format in how they look
  • Customizable: it should be easy to do things like "make it work in spanish"

To do this, inspired by a talk about Magic Wormhole ... I did pretty much the same thing they did.

Command Line Tool

By default, Roke will give you identifiers made out of two nouns and a small number. Like this:

$ roke
19-hassock-disregard

You can tell roke to print more than one identifier, so you can choose a nice one.

$ roke --count 5
9-vibrissae-truth
4-bathrobe-somewhere
10-dysfunction-overview
19-aardvark-viola
5-mutt-pamphlet

You can change the format of the identifiers:

$ roke --count 5 --format '{noun}+{noun}'
plate+pasture
pickle+syrup
colloquy+bracelet
prisoner+businessman
membrane+approach

Roke comes with two basic dictionaries:

You can add more dictionaries by putting files with the ".txt" extension and one word per line in any of the following places:

~/.local/roke
.roke

Python Library

You can use Roke inside your own projects by using it as a library. This example shows how:

>>> import roke
>>> roke.load_dicts()
>>> roke.gen_identifier('{noun}-{smallnum}')
'village-18'

That's all there is to it.

Technical Notes

So, how unique are the identifiers?

If you use the default format {smallnum}-{noun}-{noun} there are only 925 072 020 possible identifiers. So: NOT VERY UNIQUE.

Do not use this as a password or a secret! ... at least not using that format.

They should be unique enough for situations where you just need something to be "unique for a while" in a certain environment. Like, container names, or maybe your children.

Why the name?

Roke is the name of an island in Earthsea. To know more about Roke and names, just read the Earthsea books by Ursula K LeGuin, they are awesome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roke-0.1.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roke-0.1.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file roke-0.1.0.tar.gz.

File metadata

  • Download URL: roke-0.1.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.1 Linux/5.5.7-1-MANJARO

File hashes

Hashes for roke-0.1.0.tar.gz
Algorithm Hash digest
SHA256 116ba8490f7de06f0f59c610409b93140ebbbe8ec6bc1d61a66b07b3d3c7f392
MD5 9de3c2084746ba807a8174f3e8919c77
BLAKE2b-256 9087c5123c5b5f24c2f9db05630dd814dc4c2b11d7c696d2ef33d95cce644699

See more details on using hashes here.

File details

Details for the file roke-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: roke-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.1 Linux/5.5.7-1-MANJARO

File hashes

Hashes for roke-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82448da2caa906ad87a864b1a5b9a6d1a7070c6d97cc48e10097a4f6128f5f60
MD5 35f8c3360b8623285a2d9d254afb1a23
BLAKE2b-256 05b59aa704965dfd7edf8ad3c550743299ea635e3ffe4eda65bee60ea1374143

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page