folio-uuid


Namefolio-uuid JSON
Version 0.2.9 PyPI version JSON
download
home_pagehttps://github.com/FOLIO-FSE/folio_uuid
SummaryA library for generating predictive uuids for FOLIO data migrations
upload_time2023-11-07 19:40:32
maintainer
docs_urlNone
authorTheodor Tolstoy
requires_python>=3.7,<4.0
licenseMIT
keywords folio ils lsp library systems marc21 library data uuid
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
* The namespace is *8405ae4d-b315-42e1-918a-d1919900cf3f*
* The name, constructed as *OKAPI_URL:OBJECT_TYPE_NAME:LEGACY_IDENTIFIER* would become  *https://okapi-bugfest-juniper.folio.ebsco.com:items:i3696836*
* The resulting UUID then becomes *9647225d-d8e9-530d-b8cc-52a53be14e26*

# Bash/linux example
![image](https://user-images.githubusercontent.com/1894384/141293255-a692c61f-4b80-4748-8187-b8bdabe9befa.png)

	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](https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions_3_and_5_(namespace_name-based))

There are many browser-based tools to create singe UUIDs v5. [UUIDTools](https://www.uuidtools.com/v5) is one of them.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FOLIO-FSE/folio_uuid",
    "name": "folio-uuid",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "FOLIO,ILS,LSP,Library Systems,MARC21,Library data,UUID",
    "author": "Theodor Tolstoy",
    "author_email": "github.teddes@tolstoy.se",
    "download_url": "https://files.pythonhosted.org/packages/79/26/b0b1633a19c387258a358aaf911bf18091341661e9de0a248102f0f1d071/folio_uuid-0.2.9.tar.gz",
    "platform": null,
    "description": "# folio_uuid\nA python module for creating deterministic UUIDs (UUID v5) outside of FOLIO when migrating data.\n\n# Installation\nThe module is uploaded to pypi. Just do    \n\n\tpip install folio-uuid\n\t\nor   \n\n\tpipenv install folio-uuid      \n\n# Overview\nThe UUIDs (v5) are contstructed in the following way:\n* The namespace is the same for all \"Folio UUIDs\": **8405ae4d-b315-42e1-918a-d1919900cf3f**\n* The name is contstructed by the following parts, delimited by a colon (**:**)\n\t* **OKAPI_URL** This should be the full OKAPI Url including https. **Example:** *https://okapi-bugfest-juniper.folio.ebsco.com*\n\t* **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*\n\t* **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*\n\n\\* The normalization strips away any dots (.), check digits and campus codes from the identifiers\n\n# Tests/Examples\n* The namespace is *8405ae4d-b315-42e1-918a-d1919900cf3f*\n* The name, constructed as *OKAPI_URL:OBJECT_TYPE_NAME:LEGACY_IDENTIFIER* would become  *https://okapi-bugfest-juniper.folio.ebsco.com:items:i3696836*\n* The resulting UUID then becomes *9647225d-d8e9-530d-b8cc-52a53be14e26*\n\n# Bash/linux example\n![image](https://user-images.githubusercontent.com/1894384/141293255-a692c61f-4b80-4748-8187-b8bdabe9befa.png)\n\n\tuuidgen --sha1 -n 8405ae4d-b315-42e1-918a-d1919900cf3f -N https://okapi-bugfest-juniper.folio.ebsco.com:items:i3696836\nTo install uuidgen on a apt-enabled Linux distribution, use   \n\n\tsudo apt-get install uuid-runtime\n\n# Python Example\n\tdef test_deterministic_uuid_generation_holdings():\n\t    deterministic_uuid = FolioUUID(\n\t\t\"https://okapi-bugfest-juniper.folio.ebsco.com\",\n\t\tFOLIONamespaces.holdings,\n\t\t\"000000167\",\n\t    )\n\t    assert \"a0b4c8a2-01fd-50fd-8158-81bd551412a0\" == str(deterministic_uuid)\n\t    \n\t    \n# References\nWikipedia has an [article on UUID version 5](https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions_3_and_5_(namespace_name-based))\n\nThere are many browser-based tools to create singe UUIDs v5. [UUIDTools](https://www.uuidtools.com/v5) is one of them.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for generating predictive uuids for FOLIO data migrations",
    "version": "0.2.9",
    "project_urls": {
        "Homepage": "https://github.com/FOLIO-FSE/folio_uuid",
        "Repository": "https://github.com/FOLIO-FSE/folio_uuid"
    },
    "split_keywords": [
        "folio",
        "ils",
        "lsp",
        "library systems",
        "marc21",
        "library data",
        "uuid"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba0639166e4f1b41ed2d7e54df46933a683706f8e3828a2705c6ff59e468fcc8",
                "md5": "ea507c4e819bea713eed357bab3ded14",
                "sha256": "1fb21914779a79e556a86fb1db94d7c436c356973742b498adfbebf87037792b"
            },
            "downloads": -1,
            "filename": "folio_uuid-0.2.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ea507c4e819bea713eed357bab3ded14",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 6871,
            "upload_time": "2023-11-07T19:40:30",
            "upload_time_iso_8601": "2023-11-07T19:40:30.584520Z",
            "url": "https://files.pythonhosted.org/packages/ba/06/39166e4f1b41ed2d7e54df46933a683706f8e3828a2705c6ff59e468fcc8/folio_uuid-0.2.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7926b0b1633a19c387258a358aaf911bf18091341661e9de0a248102f0f1d071",
                "md5": "9b138bd53e8e268f4b51b2d9985d382f",
                "sha256": "d2d7896c6e29bc9d5b6c02ddf638ccd47256dc3640035e760af454f10165b9ca"
            },
            "downloads": -1,
            "filename": "folio_uuid-0.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "9b138bd53e8e268f4b51b2d9985d382f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 6092,
            "upload_time": "2023-11-07T19:40:32",
            "upload_time_iso_8601": "2023-11-07T19:40:32.954275Z",
            "url": "https://files.pythonhosted.org/packages/79/26/b0b1633a19c387258a358aaf911bf18091341661e9de0a248102f0f1d071/folio_uuid-0.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-07 19:40:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FOLIO-FSE",
    "github_project": "folio_uuid",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "folio-uuid"
}
        
Elapsed time: 0.13269s