python-ulid icon indicating copy to clipboard operation
python-ulid copied to clipboard

Ability to use the lib as a Python module returning a ULID

Open davidbgk opened this issue 4 years ago • 0 comments

Like so:

$ python -m ulid
01BTGNYV6HRNK8K8VKZASZCFPE

I guess implementing a __main__ which returns ULID.from_datetime(datetime.now()) by default.

It would ease the generation when calling from a Makefile for instance. My current alternative is the less elegant:

$ python -c 'from ulid import ULID;print(str(ULID()))'

davidbgk avatar Jan 12 '22 00:01 davidbgk