Skip to main content

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

Metadata

Release files for acdh-handle-pyutils 0.4.2

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

Source distribution (sdist)

Source distribution for acdh-handle-pyutils 0.4.2
File Size Uploaded Provenance
acdh-handle-pyutils-0.4.2.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for acdh-handle-pyutils 0.4.2
File Interpreter ABI Platform
acdh_handle_pyutils-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / acdh-handle-pyutils-0.4.2.tar.gz

Download URL acdh-handle-pyutils-0.4.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e829eddd6ce823547b5f6c0958b9baf676006bf00f36c389937f136c65d72388
BLAKE2b-256 checksum
How to use checksums
75aacc6bb825de7b00d02d65e2b728b42ccbebd9a57d8f7484f4a599d63ed517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release files / acdh_handle_pyutils-0.4.2-py3-none-any.whl

Download URL acdh_handle_pyutils-0.4.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50160301dc175bd0563974176785abbab561999f210f2533b4d83f4e175850a0
BLAKE2b-256 checksum
How to use checksums
e08a62d073b60af969d0e1c4d453efff16a759a888928b90e6277ac9cf41569d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Security for acdh-handle-pyutils 0.4.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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