Skip to main content

A high-performance 64-bit ID engine for distributed systems.

Project description

Oneflake

PyPI version Python License: MIT

Oneflake is a high-performance 64-bit ID generator for distributed systems. It generates globally unique, compact, time-sortable IDs with minimal overhead.

Installation

Install Oneflake via PyPI:

pip install oneflake

Quick example

from oneflake import FlakeGenerator

generator = FlakeGenerator(worker_id=7)
unique_id = generator.generate()
print(unique_id)  # e.g. 2027553873090080768

Why Oneflake

  • Globally unique identifiers — collision-free across distributed workers and isolated nodes.
  • High-performance C core — optimized for ultra-fast ID generation in concurrent environments.
  • Lock-free architecture — atomic operations avoid mutex contention and scale efficiently across threads.
  • Flexible ID layout — configure the size and ordering of timestamp, worker, and sequence fields.
  • Custom time configuration — control epoch and timestamp precision to fit system requirements.
  • Built-in decoding — easily extract timestamp, worker ID, and sequence components from generated IDs.

Oneflake ID Structure

A Oneflake ID is a 64-bit integer whose bits encode time, origin, and sequence information.

Field Bits Description
Reserved 1 Sign bit, always 0
Timestamp T Time since epoch_ms, measured in units of time_unit_ns
Worker ID W Identifier of the node or process generating the ID
Sequence S Counter for IDs generated within the same time tick

The field sizes are configurable via timestamp_bits, worker_bits, and sequence_bits, where:

1 + T + W + S = 64

The field order depends on the selected layout.

Motivation

Modern distributed systems often need identifiers that are compact, unique, time-sortable, and inexpensive to generate at massive scale. Since Twitter’s Snowflake first introduced a 64-bit, timestamp-based approach for this purpose, many derivatives have appeared — including Sonyflake, Instagram Sharding IDs, and various custom Snowflake-inspired layouts — each balancing timestamp precision, worker capacity, and per-node throughput differently.

Oneflake builds on this evolution by offering a unified, flexible, and high-performance engine that lets you adopt or customize these layouts seamlessly through a clean Python API backed by a lock-free C core.

Acknowledgements

Inspired by Twitter’s Snowflake and Sonyflake ID strategies.

License

This project is licensed under the MIT License.

Author

Oneflake was created in 2026 by Felipe Martins Diel.

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

oneflake-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distributions

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

oneflake-0.1.0-cp314-cp314t-win_amd64.whl (16.3 kB view details)

Uploaded CPython 3.14tWindows x86-64

oneflake-0.1.0-cp314-cp314t-win32.whl (16.3 kB view details)

Uploaded CPython 3.14tWindows x86

oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl (47.2 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (46.9 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl (15.0 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

oneflake-0.1.0-cp38-abi3-win_amd64.whl (15.3 kB view details)

Uploaded CPython 3.8+Windows x86-64

oneflake-0.1.0-cp38-abi3-win32.whl (15.4 kB view details)

Uploaded CPython 3.8+Windows x86

oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl (35.3 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (35.2 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl (14.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file oneflake-0.1.0.tar.gz.

File metadata

  • Download URL: oneflake-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oneflake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a72b4f5806253746ab8c4d45369709cadcc136a090c49d3ff66bd1096f5bdc12
MD5 37d4e5a0409e86ae135ec8b6ad0eb1c3
BLAKE2b-256 0559013ddc938970e8b7ac7000c838302f9ef5ffa3608eae5f9c918e5a4e681f

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0.tar.gz:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: oneflake-0.1.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oneflake-0.1.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5b1272785ac6be1670ffdea8c08ea273468c16890a8889cbcaa832ea53658ae2
MD5 4e67fa4ef55ae0d2894a96e13de2bf10
BLAKE2b-256 9bf260c8c6eeb190873295c1e368ac0059737c631fbb96c7502acd86833ba4a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp314-cp314t-win_amd64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp314-cp314t-win32.whl.

File metadata

  • Download URL: oneflake-0.1.0-cp314-cp314t-win32.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.14t, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oneflake-0.1.0-cp314-cp314t-win32.whl
Algorithm Hash digest
SHA256 15e836aad3d38cb437701c3dc1551b4a3f700d99a87933c0d60bfffadab22154
MD5 3633c6dcc602ab68eedd09fa5174441d
BLAKE2b-256 2ade698f496d26f885fbf5b45aa61f536be16e1ec3936c7bb9e2827bb98c01c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp314-cp314t-win32.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 35a585af1ea8e29bc2c19c20a87302cc525c5f2ba5eeabd97bd25da1f0691838
MD5 61214eea955dc29715a8d1200de3d5ad
BLAKE2b-256 ea26984ad11fd3642191cd7dc0161adbfe5d3880f395aec618fde96ec67ba9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 31faa521db4f4346e2b25175f1cd7caa87a917d6a537d7df24babf4d230e1037
MD5 a10794f89c75985c3c627f8b5167b948
BLAKE2b-256 b7edb0fec44886658158afc03950f1c2552b9701eca9aea5295f492cb56e7818

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 455e40ef43a2ad2d82f9af314dc331399788fad8a0b3f2d1309cd41bcbd96d57
MD5 92f1b58c97a49449936a35aa2e353419
BLAKE2b-256 dc0f65999b6aa3408134ecaeed777c344160a34baadd03a58f9df276ff9efa84

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: oneflake-0.1.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oneflake-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5fb106eca5e6eb3ccdaf48abd67b9c4114cf038ee26df67cb11e5b4e77fcd9ed
MD5 dc8a4fe239da7e3a8543938df329bc8d
BLAKE2b-256 bea47e5881b8bedb1e83e5899ae7bc56d139f146de854bbff80048102ec4062e

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp38-abi3-win_amd64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp38-abi3-win32.whl.

File metadata

  • Download URL: oneflake-0.1.0-cp38-abi3-win32.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oneflake-0.1.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 4582b9020e2ac96484c20eac7176c30af949c8deb4298d6652b13d95077ee24a
MD5 425155828d1538c2d4b70769e0aa3b0a
BLAKE2b-256 debf4f49a4567ec7a01d56acb1ee31d72f6e4f5ac85310bf379eea6a426c4bec

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp38-abi3-win32.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fe6afed16172e841fd80849127f4e9472c6df3cf99b08245a3407bdb012ba9e8
MD5 4230734618305ecc0eb888fd15102ab2
BLAKE2b-256 1000716a52873f0cbad43f6c9a7c8c1dc3e6e15dfd183ddd526e51716548d61c

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3fcfe9af1760beacf9cdf0ca6675cbb34c393659c5ba56c860981d2c4c015280
MD5 131e6810b463bb9e6b7b8447c0d295c9
BLAKE2b-256 7e1e5051ee37a4153fb35c3e7fd2571c590b7a48a2fdae91135e85967d5043db

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 147a6581d3d92c15d04d63aff08d68f8cd1d36e7f02bd8f1e29b706d4105ab24
MD5 22a4b7a3c30952d3eca3d82686dd0572
BLAKE2b-256 f71e48d5714027a491095de910100dc12faabc415e2454d24d06aeb47821c493

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on felipediel/oneflake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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