Skip to main content

A library to name and identify things

Project description


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

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

$ roke --count 5

You can change the format of the identifiers:

$ roke --count 5 --format '{noun}+{noun}'

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:


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}')

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.

Files for roke, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size roke-0.1.0-py3-none-any.whl (25.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size roke-0.1.0.tar.gz (27.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page