Skip to main content

folio_uuid

A python module for creating deterministic UUIDs (UUID v5) outside of FOLIO when migrating data.

Installation

The module is uploaded to pypi. Just do

pip install folio-uuid

or

pipenv install folio-uuid      

Overview

The UUIDs (v5) are contstructed in the following way:

  • The namespace is the same for all "Folio UUIDs": 8405ae4d-b315-42e1-918a-d1919900cf3f
  • The name is contstructed by the following parts, delimited by a colon (:)
    • TENANT_STRING This should be a unique, system-specific string for the target system. We recommend using the target Tenant ID (the value passed in x-okapi-tenant when accessing FOLIO's APIs), but you can use the system's API gateway URL, as well. Example: diku
    • OBJECT_TYPE_NAME This should be the name of the type of object that the ID is generated for. In plural. the file folio_namespaces.py in this repo has a complete list of the ones currently in use. Example: items
    • LEGACY_IDENTIFIER This should be the legacy identifier comming from the source system. The library will perform some normalization* of the identifier if it is a Sierra/Millennium identifier. Example: i3696836

* The normalization strips away any dots (.), check digits and campus codes from the identifiers

Tests/Examples

  • The namespace is *8405ae4d-b315-42e1-918a-d1919900cf3f*
  • The name, constructed as TENANT_ID:OBJECT_TYPE_NAME:LEGACY_IDENTIFIER would become diku:items:i3696836
  • The resulting UUID then becomes 9647225d-d8e9-530d-b8cc-52a53be14e26

Bash/linux example

uuidgen --sha1 -n 8405ae4d-b315-42e1-918a-d1919900cf3f -N diku:items:i3696836

To install uuidgen on a apt-enabled Linux distribution, use

sudo apt-get install uuid-runtime

Python Example

def test_deterministic_uuid_generation_holdings():
   deterministic_uuid = FolioUUID(
      "diku",
      FOLIONamespaces.holdings,
      "000000167",
   )
assert "3db53ecc-37a9-521e-88fd-6ef72c710468" == str(deterministic_uuid)

What happened to OKAPI_URL?

Previous versions of this library directed users to provide the target FOLIO system's OKAPI URL as the first argument (okapi_url) when instantiating a new FolioUUID class, and allowed specifying an optional tenant_id value that would be included in the overall string used to generate the v5 UUID. However, in most circumstances the FOLIO tenant id value is more static than the API gateway URL (eg. when migrating from an OKAPI-based FOLIO system to a Eureka-based one).

As of v1.0.0 of folio_uuid, the first argument has been renamed to tenant_string, and can be any unique string value for the target tenant. okapi_url and tenant_id are still available as keyword-only arguments, but are deprecated and will be removed in a future release. Code that used FolioUUID with positional-only arguments will not require any code changes. Code that used keyword arguments for okapi_url and tenant_id will continue to work, as well, but will raise deprecation warnings.

References

Wikipedia has an article on UUID version 5

There are many browser-based tools to create singe UUIDs v5. UUIDTools is one of them.

Release files for folio-uuid 1.0.1

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

Source distribution (sdist)

Source distribution for folio-uuid 1.0.1
File Size Uploaded
folio_uuid-1.0.1.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for folio-uuid 1.0.1
File Interpreter ABI Platform
folio_uuid-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size:10.4 kB

Release files / folio_uuid-1.0.1.tar.gz

Download URL folio_uuid-1.0.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0d4876276068cc47d368f90932e00a857b219890f8d874eec8f703fc9adc26aa
BLAKE2b-256 checksum
How to use checksums
a3b2c8e1ad0c2d1135e2fa87570e21ae716d68221349a4064334034f76faaa3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release files / folio_uuid-1.0.1-py3-none-any.whl

Download URL folio_uuid-1.0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4f23e683821fd4cbe35d5db8c0781cde91cd19936faef69a2d8f847aee10bff
BLAKE2b-256 checksum
How to use checksums
dcde23002219802aa7fff367f22aa63b59f6385881f7c4e0697ef0087d32ff7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

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