Skip to main content

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.

Release files for oneflake 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oneflake 0.1.0
File Size Uploaded
oneflake-0.1.0.tar.gz 20.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for oneflake 0.1.0
File
oneflake-0.1.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
oneflake-0.1.0-cp314-cp314t-win32.whl CPython 3.14 CPython 3.14 free-threading Windows x86-32 Details
oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details
oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details
oneflake-0.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
oneflake-0.1.0-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details
oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details
oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 277.4 kB

Release files / oneflake-0.1.0.tar.gz

Download URL oneflake-0.1.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a72b4f5806253746ab8c4d45369709cadcc136a090c49d3ff66bd1096f5bdc12
BLAKE2b-256 checksum
How to use checksums
0559013ddc938970e8b7ac7000c838302f9ef5ffa3608eae5f9c918e5a4e681f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp314-cp314t-win_amd64.whl

Download URL oneflake-0.1.0-cp314-cp314t-win_amd64.whl
Size 16.3 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
5b1272785ac6be1670ffdea8c08ea273468c16890a8889cbcaa832ea53658ae2
BLAKE2b-256 checksum
How to use checksums
9bf260c8c6eeb190873295c1e368ac0059737c631fbb96c7502acd86833ba4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp314-cp314t-win32.whl

Download URL oneflake-0.1.0-cp314-cp314t-win32.whl
Size 16.3 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-32
SHA-256 checksum
How to use checksums
15e836aad3d38cb437701c3dc1551b4a3f700d99a87933c0d60bfffadab22154
BLAKE2b-256 checksum
How to use checksums
2ade698f496d26f885fbf5b45aa61f536be16e1ec3936c7bb9e2827bb98c01c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL oneflake-0.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 47.2 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
35a585af1ea8e29bc2c19c20a87302cc525c5f2ba5eeabd97bd25da1f0691838
BLAKE2b-256 checksum
How to use checksums
ea26984ad11fd3642191cd7dc0161adbfe5d3880f395aec618fde96ec67ba9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL oneflake-0.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 46.9 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
31faa521db4f4346e2b25175f1cd7caa87a917d6a537d7df24babf4d230e1037
BLAKE2b-256 checksum
How to use checksums
b7edb0fec44886658158afc03950f1c2552b9701eca9aea5295f492cb56e7818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl

Download URL oneflake-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Size 15.0 kB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
455e40ef43a2ad2d82f9af314dc331399788fad8a0b3f2d1309cd41bcbd96d57
BLAKE2b-256 checksum
How to use checksums
dc0f65999b6aa3408134ecaeed777c344160a34baadd03a58f9df276ff9efa84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp38-abi3-win_amd64.whl

Download URL oneflake-0.1.0-cp38-abi3-win_amd64.whl
Size 15.3 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5fb106eca5e6eb3ccdaf48abd67b9c4114cf038ee26df67cb11e5b4e77fcd9ed
BLAKE2b-256 checksum
How to use checksums
bea47e5881b8bedb1e83e5899ae7bc56d139f146de854bbff80048102ec4062e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp38-abi3-win32.whl

Download URL oneflake-0.1.0-cp38-abi3-win32.whl
Size 15.4 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
4582b9020e2ac96484c20eac7176c30af949c8deb4298d6652b13d95077ee24a
BLAKE2b-256 checksum
How to use checksums
debf4f49a4567ec7a01d56acb1ee31d72f6e4f5ac85310bf379eea6a426c4bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL oneflake-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl
Size 35.3 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
fe6afed16172e841fd80849127f4e9472c6df3cf99b08245a3407bdb012ba9e8
BLAKE2b-256 checksum
How to use checksums
1000716a52873f0cbad43f6c9a7c8c1dc3e6e15dfd183ddd526e51716548d61c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL oneflake-0.1.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 35.2 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
3fcfe9af1760beacf9cdf0ca6675cbb34c393659c5ba56c860981d2c4c015280
BLAKE2b-256 checksum
How to use checksums
7e1e5051ee37a4153fb35c3e7fd2571c590b7a48a2fdae91135e85967d5043db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL oneflake-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Size 14.3 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
147a6581d3d92c15d04d63aff08d68f8cd1d36e7f02bd8f1e29b706d4105ab24
BLAKE2b-256 checksum
How to use checksums
f71e48d5714027a491095de910100dc12faabc415e2454d24d06aeb47821c493
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page