skillfed

snowflake-id

The Snowflake generator done right

snowflake-id v1.0.2 172.7K downloads/30d#10,328 on PyPI122
Permissive license MIT License Copyright (c) 2021-2024 Vd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) DORMANT released

What it is and what it does

Snowflake-id is a pure-Python implementation of Snowflake ID generation and parsing. Snowflake IDs are distributed identifiers that encode a timestamp, instance identifier, and sequence number, making them suitable for generating unique IDs across multiple machines without central coordination. The package provides a SnowflakeGenerator class to produce sequential IDs and a Snowflake class to parse existing IDs back into their component parts (timestamp, instance, epoch, sequence, and datetime). It has no additional dependencies and supports Python 3.8, 3.9, 3.10, 3.11, and 3.12.

The package is straightforward to use: instantiate a generator with an instance ID, call next() to get sequential IDs, or parse an existing ID to inspect its components. The fact sheet shows examples of generating IDs in sequence and extracting timestamp and datetime information from a parsed ID. Maintenance is dormant but the code is marked Production/Stable and has not been archived.

Use it for:

  • Generate unique IDs for distributed database records without a central ID service.
  • Parse existing Snowflake IDs to extract their timestamp and instance metadata.
  • Reconstruct a generator's state from a previously generated ID to continue the sequence.
  • Build microservice architectures where each instance generates its own unique IDs.
  • Replace UUID generation when sortable, time-ordered IDs are preferred.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates and parses Snowflake IDs, distributed unique identifiers composed of timestamp, instance, and sequence components.

Yes, if you need distributed ID generation without external dependencies. The package is lightweight, has no runtime dependencies, and is marked Production/Stable. Dormant maintenance (last commit 2024-06-12) is not a blocker for a stable utility library, but verify it meets your concurrency and performance requirements before adopting in high-throughput systems.

Install

snowflake-id on PyPI

pip

pip install snowflake-id

uv

uv add snowflake-id

poetry

poetry add snowflake-id

Installing snowflake-id

Before you install

Low friction: pure Python, no runtime dependencies, distributed as a wheel. Maintenance is dormant—last commit 2024-06-12, but the repository is not archived and the package is marked Production/Stable.

License in practice

MIT License permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required. No restrictions on commercial or proprietary use.

Quickstart

pip install snowflake-id

from snowflake import SnowflakeGenerator
gen = SnowflakeGenerator(42)
for i in range(3):
    print(next(gen))

Requires Python 3.8 or above.

Verify before relying

  • Whether the package handles clock skew or out-of-order generation in concurrent scenarios.
  • Performance characteristics under high-throughput ID generation.
  • Compatibility with distributed systems beyond the basic generator/parser interface shown.

Package facts

License MIT License Copyright (c) 2021-2024 Vd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 849 days since the last release
Last repo commit
First released
Downloads 172,686/month — #10,328 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: snowflake_id-1.0.2-py3-none-any.whl

Keywords: snowflake, snowflake-id, id, ids, generator

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: User Interfaces

Tags

snowflake id generatordistributed unique idsnowflake id parsertimestamp-based id generationsequence number generatorinstance-based idsnowflake id decode
id-generationdistributed-systems

More Software Development packages