mdomke / python-ulid

ULID implementation for Python
https://python-ulid.rtfd.io
MIT License
391 stars 18 forks source link

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

Closed davidbgk closed 1 year ago

davidbgk commented 2 years ago

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()))'
mdomke commented 1 year ago

Hi @davidbgk, thanks for the good idea (that you had long, long time ago). It is now implemented in python-ulid 2.0.1

davidbgk commented 1 year ago

Oh thanks for the notification! For future reference, it happened in https://github.com/mdomke/python-ulid/commit/ffe282ae029092ab89419010818ffa1c37171592