{"id":2287,"library":"snowflake-legacy","title":"Snowflake Legacy ID Generation","description":"The `snowflake-legacy` package (current version 1.0.2) is a transitional Python library providing limited backward compatibility for users of the *original* `snowflake` PyPI package, which has since been renamed to `snowflake-uuid`. The original package was designed for generating persistent, machine-specific UUIDs (often referred to as 'snowflakes'). This `snowflake-legacy` package itself is deprecated, primarily serving as a temporary bridge after the `snowflake` PyPI name was transferred to Snowflake, Inc. Users are strongly advised to migrate to `snowflake-uuid` for continued functionality and support. It has an effectively abandoned release cadence.","status":"deprecated","version":"1.0.2","language":"en","source_language":"en","source_url":null,"tags":["snowflake","id-generation","uuid","legacy","deprecated"],"install":[{"cmd":"pip install snowflake-legacy","lang":"bash","label":"Install `snowflake-legacy`"}],"dependencies":[],"imports":[{"note":"The `snowflake-legacy` package provides an `import snowflake` that mimics the top-level `snowflake` module of the original package. Direct import of `snowflake()` from `snowflake` might imply a function, but it's a module-level callable.","wrong":"from snowflake import snowflake","symbol":"snowflake","correct":"import snowflake"}],"quickstart":{"code":"import snowflake\nimport os\n\n# This package only *reads* a snowflake ID from a file, typically /etc/snowflake.\n# It does NOT generate one. For generation, use 'snowflake-uuid'.\n# The ID is usually created by the 'snowflake-uuid' package upon installation.\n# This example attempts to read it, but will raise FileNotFoundError if not present.\n\ntry:\n    # Attempt to read the machine's snowflake ID\n    # In a real scenario, this would likely read from /etc/snowflake\n    # after the `snowflake-uuid` package has been installed and created it.\n    # For demonstration, we use a temporary file path if /etc/snowflake isn't available.\n    snowflake_id = snowflake.snowflake(os.environ.get('SNOWFLAKE_ID_PATH', '/etc/snowflake'))\n    print(f\"Machine Snowflake ID: {snowflake_id}\")\nexcept FileNotFoundError:\n    print(\"No snowflake ID found. The 'snowflake-legacy' package only reads IDs; it does not generate them.\")\n    print(\"Please install 'snowflake-uuid' package (pip install snowflake-uuid) to generate an ID.\")\nexcept NotImplementedError as e:\n    print(f\"Error: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"Demonstrates how to use the `snowflake-legacy` package to read a machine's snowflake ID. Note that this package does not generate IDs; it only reads them, typically from `/etc/snowflake`, which would usually be created by the `snowflake-uuid` package. It will raise a `FileNotFoundError` if the ID file doesn't exist. The `make_snowflake()` function is explicitly disabled."},"warnings":[{"fix":"Migrate to `snowflake-uuid` and use its API for generating new snowflake IDs.","message":"The `make_snowflake()` function, if present in the original `snowflake` package, is explicitly disabled in `snowflake-legacy` and will always raise a `NotImplementedError`, directing users to the `snowflake-uuid` package.","severity":"breaking","affected_versions":"1.0.0 and later"},{"fix":"Update your project dependencies from `snowflake-legacy` to `snowflake-uuid` as soon as possible.","message":"The `snowflake-legacy` package itself is a temporary, transitional package and is explicitly recommended to be replaced by `snowflake-uuid`. It is unlikely to receive further maintenance or updates.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Ensure that the `snowflake-uuid` package is installed and has run at least once to create the `/etc/snowflake` file if you intend to use `snowflake-legacy` to read it. For generation, switch to `snowflake-uuid`.","message":"The `snowflake.snowflake()` function in `snowflake-legacy` only *reads* an existing snowflake ID from a file (defaulting to `/etc/snowflake`); it does not create or generate a new ID. If the file does not exist, it will raise a `FileNotFoundError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always explicitly install `snowflake-uuid` for machine-specific UUID generation, or `snowflake-legacy` if specifically targeting the deprecated transitional package.","message":"There is a completely unrelated, official `snowflake` package on PyPI owned by Snowflake, Inc. (the data warehousing company). Users attempting to install the ID generation library by searching 'snowflake' and installing the first result may get the wrong package, leading to confusion.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}