Skip to main content

A library for generating predictive uuids for FOLIO data migrations

Project description

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 (:)
    • OKAPI_URL This should be the full OKAPI Url including https. Example: https://okapi-bugfest-juniper.folio.ebsco.com
    • 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

Bash/linux example

image

uuidgen --sha1 -n 8405ae4d-b315-42e1-918a-d1919900cf3f -N https://okapi-bugfest-juniper.folio.ebsco.com: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(
	"https://okapi-bugfest-juniper.folio.ebsco.com",
	FOLIONamespaces.holdings,
	"000000167",
    )
    assert "a0b4c8a2-01fd-50fd-8158-81bd551412a0" == str(deterministic_uuid)

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.

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

folio_uuid-0.2.10.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

folio_uuid-0.2.10-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file folio_uuid-0.2.10.tar.gz.

File metadata

  • Download URL: folio_uuid-0.2.10.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.2 Darwin/23.4.0

File hashes

Hashes for folio_uuid-0.2.10.tar.gz
Algorithm Hash digest
SHA256 7a5dcbd3db7513ee1ee9217a287f364d74feab5f3e1c1f4bf795ef048d08665c
MD5 480f5f6d056f0b3e2df77af3b3f43bb2
BLAKE2b-256 a762229b41a78af7cbfe8a9e5ca5930b603dc0e1a35389fb7806f8b54df2bb83

See more details on using hashes here.

File details

Details for the file folio_uuid-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: folio_uuid-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.2 Darwin/23.4.0

File hashes

Hashes for folio_uuid-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f0c07aa436579280720f957d9554e91ee6dc94206322626304df33747123f0ea
MD5 94b53b3636585717fa01fab7b7d7b3b1
BLAKE2b-256 d26d9ce575a7f60860dc222b2a225a82d5868e9e40ced30da3b6c3e15295db8f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page