This guide explains on how to use the Handle API using Python to perform common tasks.
Setup
Sessions
Handles can be created one by one using independent API calls. However, if you need to complete more then one API call in a sitting, we recommend initiating a session first. A session only requires authorisation once, at the beginning of the session, instead of after every API call. Sessions will timeout after 10 minutes of inactivity.
Python Packages
There are several Python packages that support the Handle API:
- B2handle: A Python library for interacting with the Handle system server created specifically for the EUDAT project. It has been replaced with pyHandle.
- pyHandle: A more generic Python library for interacting with the Handle system server that is under active development and support.
Installing pyHandle
The library can be installed from GitHub by following the instructions. pyHandle also offers extensive documentation and tutorials.
Alternatively you can use pip to install pyHandle under a user account:
Installing B2handle
While retired, the library can be installed from GitHub by following the instructions. B2Handle also offers tutorials and training.
Example python scripts using pyHandle
Initiate your client
See here.
Create a handle
See here.
Show handle contents
See here.
Modify a handle
See here.