Latest version
Close
Close
Python Generator Expression. Simple generators can be easily created on the fly using generator expressions. It makes building generators easy. Same as lambda function creates an anonymous function, generator expression creates an anonymous generator function. The syntax for generator expression is similar to that of a list comprehension in. @minion is right here. Either you store references to those objects to access the values, or you have to iterate. In the former case you might as well just put the data in the key object and forget the dictionary, in the latter case you can just use a list of tuples.
Universally Unique Lexicographically Sortable Identifier
Project description
. image:: https://img.shields.io/pypi/v/python-ulid.svg?style=flat-square
:target: https://pypi.python.org/pypi/python-ulid
. image:: https://img.shields.io/travis/mdomke/python-ulid/master.svg?style=flat-square
:target: https://travis-ci.org/mdomke/python-ulid
. image:: https://img.shields.io/pypi/l/python-ulid.svg?style=flat-square
:target: https://pypi.python.org/pypi/python-ulid
. image:: https://img.shields.io/codecov/c/github/mdomke/python-ulid.svg?style=flat-square
:target: https://codecov.io/gh/mdomke/python-ulid
What is this?
This is a port of the original JavaScript ULID_ implementation to Python.
A ULID is a *universally unique lexicographically sortable identifier*. It is
- 128-bit compatible with UUID
- 1.21e+24 unique ULIDs per millisecond
- Lexicographically sortable!
- Canonically encoded as a 26 character string, as opposed to the 36 character UUID
- Uses Crockford's base32 for better efficiency and readability (5 bits per character)
- Case insensitive
- No special characters (URL safe)
In general the structure of a ULID is as follows:
. code-block:: txt
01AN4Z07BY 79KA1307SR9X4MV3
|----------| |----------------|
Timestamp Randomness
48bits 80bits
For more information have a look at the original specification_.
Basic Usage
-----------
. code-block:: python
>>> from ulid import ULID
>>> ulid = ULID.new()
>>> ulid.str
'01BTGNYV6HRNK8K8VKZASZCFPE'
>>> ulid.timestamp
1505945939.153
>>> ulid.datetime
datetime.datetime(2017, 9, 20, 22, 18, 59, 153000)
Installation
------------
. code-block:: bash
$ pip install python-ulid
Other implementations
---------------------
- `ahawker/ulid <https://github.com/ahawker/ulid>`_
- `valohai/ulid2 <https://github.com/valohai/ulid2>`_
- `mdipierro/ulid <https://github.com/mdipierro/ulid>`_
. _ULID: https://github.com/alizain/ulid
. _specification: https://github.com/alizain/ulid#specification
:target: https://pypi.python.org/pypi/python-ulid
. image:: https://img.shields.io/travis/mdomke/python-ulid/master.svg?style=flat-square
:target: https://travis-ci.org/mdomke/python-ulid
. image:: https://img.shields.io/pypi/l/python-ulid.svg?style=flat-square
:target: https://pypi.python.org/pypi/python-ulid
. image:: https://img.shields.io/codecov/c/github/mdomke/python-ulid.svg?style=flat-square
:target: https://codecov.io/gh/mdomke/python-ulid
What is this?
This is a port of the original JavaScript ULID_ implementation to Python.
A ULID is a *universally unique lexicographically sortable identifier*. It is
- 128-bit compatible with UUID
- 1.21e+24 unique ULIDs per millisecond
- Lexicographically sortable!
- Canonically encoded as a 26 character string, as opposed to the 36 character UUID
- Uses Crockford's base32 for better efficiency and readability (5 bits per character)
- Case insensitive
- No special characters (URL safe)
In general the structure of a ULID is as follows:
. code-block:: txt
01AN4Z07BY 79KA1307SR9X4MV3
|----------| |----------------|
Timestamp Randomness
48bits 80bits
For more information have a look at the original specification_.
Basic Usage
-----------
. code-block:: python
>>> from ulid import ULID
>>> ulid = ULID.new()
>>> ulid.str
'01BTGNYV6HRNK8K8VKZASZCFPE'
>>> ulid.timestamp
1505945939.153
>>> ulid.datetime
datetime.datetime(2017, 9, 20, 22, 18, 59, 153000)
Installation
------------
. code-block:: bash
$ pip install python-ulid
Other implementations
---------------------
- `ahawker/ulid <https://github.com/ahawker/ulid>`_
- `valohai/ulid2 <https://github.com/valohai/ulid2>`_
- `mdipierro/ulid <https://github.com/mdipierro/ulid>`_
. _ULID: https://github.com/alizain/ulid
. _specification: https://github.com/alizain/ulid#specification
Release historyRelease notifications
0.0.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size python_ulid-0.2.0-py2-none-any.whl (7.6 kB) | File type Wheel | Python version py2 | Upload date | Hashes |
Filename, size python-ulid-0.2.0.tar.gz (9.0 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for python_ulid-0.2.0-py2-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | f2bea3f19bea6a90138cf7d27a15066c669b3d2e6a4da7e16591a42e907acfd4 |
MD5 | e453781f89c30148e095bac7fe59a300 |
BLAKE2-256 | 91afb150840fdfd234ec67a3a6d027e0e68e6317789fa599a28775fafb00c108 |
Hashes for python-ulid-0.2.0.tar.gz
Python3 Ulid Keeps Generating The Same Key In Life
Algorithm | Hash digest |
---|---|
SHA256 | 8d3ffa2d2f250648293ad904b98d25776bd2a77ffc957c01f23f3e6cd011b2f8 |
MD5 | 423fb74378693798bc9f3437a6f5bd67 |
BLAKE2-256 | 5c9d3c2e8e74e0382dcd858ea106b434989604e8dfe1c4667f4a27f80c97c288 |