This simple python package makes it easy to connect to an eScriptorium instance and to work with the data there.
Project description
[]
Escriptorium Connector
This simple python package makes it easy to connect to escriptorium and work with the data stored there.
Installation
And the obligatory: pip install escriptorium-connector
Usage
If you are working on a public repository, you will probably want to store your user token in a hidden .env
file that does not get distributed with your code. This is pretty easy to accomplish with python-dotenv. You can get your user token by going to your eScriptorium instance (perhaps https://escriptorium.fr/), logging in, clicking on your username then "profile", and selecting "Api key". The token is a fairly long string of random letters and numbers.
The EscriptoriumConnector
class provides (or will provide) all the methods needed to interact programmatically with the eScriptorium platform.
Example usage:
from escriptorium_connector import EscriptoriumConnector
import os
from dotenv import load_dotenv
if __name__ == '__main__':
load_dotenv()
url = os.getenv('ESCRIPTORIUM_URL')
api = f'{url}api/'
token = os.getenv('ESCRIPTORIUM_TOKEN')
escr = EscriptoriumConnector(url, api, token)
print(escr.get_documents())
And your .env
file should have:
ESCRIPTORIUM_URL=https://www.escriptorium.fr/
ESCRIPTORIUM_TOKEN='your secret user token here'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for escriptorium-connector-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c6b6fd5ebb6dd788107d616d3a2b7c0fc63272ffba2d062b42cdd4e9f48c34 |
|
MD5 | 50864e2b3d7a02bd191ea365a68e6132 |
|
BLAKE2b-256 | e1c253c915b4f8ed4f4abd4645b5dabc05faf2cd98277fa1564dfc32e3a87d51 |
Hashes for escriptorium_connector-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98466ab7ec7b4d2bdcb1a2f1ebc91b79031d83bbcec40778b90a1c87990e5dda |
|
MD5 | ce43aa8cae44e9082a5e19408d7e49a6 |
|
BLAKE2b-256 | 93dd14e3e72920cfb75fb9d3e0b88b1376f941c09c7eb29280f27551699ba567 |