Skip to main content

Generate unique identifiers only using emojis

Project description

IDoji

Lint Unittests codecov

pypi python license Code style: black Imports: isort

What if you could combine the magical fun of emojis and the unique uniqueness power of UUIDs.

What if you had a format to label objects, so powerful and elegant, that you enjoy sending those over your favorite messenger.

What if you had a small python package, providing you all of that and much more.

Welcome to IDoji.

Installation

Installation can be done via pip

pip3 install idoji

Usage

IDoji can be used as a superior alternative to UUIDs. Common functionality provided by UUIDs can be found in IDojis, as well as facilities to mix both types or convert between them.

Instantiate them

It is possible to instantiate a completely random IDoji as well as using values of the type str, int or even UUID.

>>> from idoji import IDoji
>>> idoj = IDoji()
>>> print(idoj)
๐ŸฆŸ๐Ÿฆ„๐Ÿ˜—๐Ÿ˜…-๐Ÿฅฝ๐Ÿฆ„-๐Ÿ™Œ๐Ÿฆฉ-๐Ÿฅณ๐Ÿฅฑ-๐ŸงŠ๐Ÿฅ–-๐Ÿคญ๐Ÿฆ๐Ÿฆฒ๐Ÿ˜’

It is also possible to use existing UUIDs in several forms.

>>> from uuid import uuid4
>>> uuidval = uuid4()
>>> print(uuidval)
e4f4d80c-01f4-4504-b18b-6061bb619aa3
>>> idoj_from_uuid = IDoji(uuidval)
>>> print(idoj_from_uuid)
๐Ÿฆณ๐Ÿงƒ๐Ÿฆง๐Ÿ˜Œ-๐Ÿ˜๐Ÿงƒ-๐Ÿ™…๐Ÿ˜„-๐Ÿฆ€๐Ÿฅ™-๐Ÿคœ๐Ÿค-๐ŸฆŠ๐Ÿค๐Ÿฅจ๐Ÿฅฑ
>>> repr(idoj_from_uuid)
"IDoji('e4f4d80c-01f4-4504-b18b-6061bb619aa3')"
>>> idoj_from_uuid_str = IDoji("e4f4d80c-01f4-4504-b18b-6061bb619aa3")
>>> print(idoj_from_uuid_str)
๐Ÿฆณ๐Ÿงƒ๐Ÿฆง๐Ÿ˜Œ-๐Ÿ˜๐Ÿงƒ-๐Ÿ™…๐Ÿ˜„-๐Ÿฆ€๐Ÿฅ™-๐Ÿคœ๐Ÿค-๐ŸฆŠ๐Ÿค๐Ÿฅจ๐Ÿฅฑ

And of course, if you get an IDoji string from somewhere, you can use that to instantiate an object as well.

>>> idoj = IDoji("๐Ÿฆณ๐Ÿงƒ๐Ÿฆง๐Ÿ˜Œ-๐Ÿ˜๐Ÿงƒ-๐Ÿ™…๐Ÿ˜„-๐Ÿฆ€๐Ÿฅ™-๐Ÿคœ๐Ÿค-๐ŸฆŠ๐Ÿค๐Ÿฅจ๐Ÿฅฑ")
>>> print(idoj)
๐Ÿฆณ๐Ÿงƒ๐Ÿฆง๐Ÿ˜Œ-๐Ÿ˜๐Ÿงƒ-๐Ÿ™…๐Ÿ˜„-๐Ÿฆ€๐Ÿฅ™-๐Ÿคœ๐Ÿค-๐ŸฆŠ๐Ÿค๐Ÿฅจ๐Ÿฅฑ
>>> repr(idoj)
"IDoji('e4f4d80c-01f4-4504-b18b-6061bb619aa3')"

Compare them

IDojis can be compared against each other as well as UUIDs.

Comparison against IDoji objects as well as their string representation is available.

>>> idoj = IDoji()
>>> idoj_same = IDoji(idoj.uuid)
>>> idoj_diff = IDoji()
>>> print("{} -- {} -- {}".format(idoj, idoj_same, idoj_diff))
๐Ÿคช๐Ÿฆž๐Ÿคณ๐Ÿฅ”-๐Ÿฆ๐ŸฅŽ-๐Ÿ™„๐Ÿฆฃ-๐ŸฆŒ๐Ÿ˜ถ-๐Ÿ˜จ๐Ÿ˜ฏ-๐Ÿฆน๐Ÿฆฃ๐Ÿ˜„๐Ÿฅž -- ๐Ÿคช๐Ÿฆž๐Ÿคณ๐Ÿฅ”-๐Ÿฆ๐ŸฅŽ-๐Ÿ™„๐Ÿฆฃ-๐ŸฆŒ๐Ÿ˜ถ-๐Ÿ˜จ๐Ÿ˜ฏ-๐Ÿฆน๐Ÿฆฃ๐Ÿ˜„๐Ÿฅž -- ๐Ÿฆช๐Ÿคœ๐Ÿฆ’๐Ÿฆต-๐Ÿค๐Ÿงƒ-๐Ÿ™‹๐Ÿฅ“-๐ŸฅŸ๐Ÿฅง-๐Ÿฆ๐Ÿฆน-๐Ÿฅช๐Ÿ˜Ž๐Ÿงก๐Ÿฆ—
>>> idoj == idoj_same
True
>>> idoj == idoj_diff
False
>>> idoj == "๐Ÿคช๐Ÿฆž๐Ÿคณ๐Ÿฅ”-๐Ÿฆ๐ŸฅŽ-๐Ÿ™„๐Ÿฆฃ-๐ŸฆŒ๐Ÿ˜ถ-๐Ÿ˜จ๐Ÿ˜ฏ-๐Ÿฆน๐Ÿฆฃ๐Ÿ˜„๐Ÿฅž"
True
>>> idoj == "๐Ÿฆช๐Ÿคœ๐Ÿฆ’๐Ÿฆต-๐Ÿค๐Ÿงƒ-๐Ÿ™‹๐Ÿฅ“-๐ŸฅŸ๐Ÿฅง-๐Ÿฆ๐Ÿฆน-๐Ÿฅช๐Ÿ˜Ž๐Ÿงก๐Ÿฆ—"
False

Also comparison against UUIDs and their string representation is possible as well.

>>> uuidval = uuid4()
>>> print(uuidval)
627adf41-739a-4b5a-b727-d8add4124884
>>> idoj_from_uuid = IDoji(uuidval)
>>> idoj_from_uuid == uuidval
True
>>> idoj_from_uuid == "627adf41-739a-4b5a-b727-d8add4124884"
True

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

idoji-1.0.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

idoji-1.0.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file idoji-1.0.1.tar.gz.

File metadata

  • Download URL: idoji-1.0.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for idoji-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35fd097d542fd8cbdef01b0db2c08900a6f074ce8137484bc2cf208abc4ce824
MD5 bf6ad79cc875bbb76ff7ec151abe2e61
BLAKE2b-256 e133c131fe0946ecb9bd21c89ad0e1051982805690cd0237ab7f81b62137e792

See more details on using hashes here.

File details

Details for the file idoji-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: idoji-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for idoji-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1daed492637c539912c1980dc29f2d28a9b0aad00db642b3e5a979fadad45527
MD5 820384a5452e84391c800bd14f14bfa2
BLAKE2b-256 edd7b29015b79d13d20cb13838d5a0dc180ca02bf5667e07227976ef019bf097

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