Catalog PyPI
PACKAGE EXPLORERView in registry

acdh-handle-pyutils

PyPI

Utility functions to interact with handle.net API

acdh-handle-pyutils
Versions collected1
Direct dependencies1From release 0.4.2
Last observed20 Oct, 18:04 UTC

README

Version 0.4.2 documentation

flake8 Lint Test codecov PyPI version

acdh-handle-pyutils

Utility functions to interact with handle.net API

install

pip install acdh-handle-pyutils

how to use

see ./tests/test_client.py and also checkout the provided defaults for acdh_handle_pyutils.client.HandleClient

register handle for url

import os
from acdh_handle_pyutils.client import HandleClient


HANDLE_USERNAME = os.environ.get("HANDLE_USERNAME")
HANDLE_PASSWORD = os.environ.get("HANDLE_PASSWORD")
URL_TO_REGISTER = "https://id.hansi4ever.com/123"

cl = HandleClient(HANDLE_USERNAME, HANDLE_PASSWORD)
result = cl.register_handle(URL_TO_REGISTER, full_url=True)
print(result)
# https://hdl.handle.net/21.11115/0000-000F-743B-D

Be aware that it might take a while until the registerd handle resolves

update handle

import os
from acdh_handle_pyutils.client import HandleClient


HANDLE_USERNAME = os.environ.get("HANDLE_USERNAME")
HANDLE_PASSWORD = os.environ.get("HANDLE_PASSWORD")
HANDLE_TO_UPDATE = "https://hdl.handle.net/21.11115/0000-000F-743B-D"
URL_TO_UPDATE = "https://sumsi.com/is-the-best"


cl = HandleClient(HANDLE_USERNAME, HANDLE_PASSWORD)
updated = cl.update_handle(HANDLE_TO_UPDATE, URL_TO_UPDATE)print(result)

print(updated.status_code) # should return for `204 No Content` HTTP response code for a successful update
# 204

Be aware that it might take until the handle is actually updated by the handle service provider

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.4.226 Sept 20221

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
acdh-oeaw/acdh-handle-pyutils

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:04 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:b3788dcf1c96fe6dcaf47276dc0c35ad88baeea322f68c86cd4fd309719cb5d0