Skip to main content

This simple python package makes it easy to connect to an eScriptorium instance and to work with the data there.

Project description

[License: MIT]

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 credentials in a hidden .env file that does not get distributed with your code. This is pretty easy to accomplish with python-dotenv. You will need to provide the connector with an eScriptorium instance URL, the API your username, and your password (see below).

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 = str(os.getenv('ESCRIPTORIUM_URL'))
    username = str(os.getenv('ESCRIPTORIUM_USERNAME'))
    password = str(os.getenv('ESCRIPTORIUM_PASSWORD'))
    escr = EscriptoriumConnector(url, username, password)
    print(escr.get_documents())

And your .env file should have:

ESCRIPTORIUM_URL=https://www.escriptorium.fr
ESCRIPTORIUM_USERNAME=your_escriptorium_username
ESCRIPTORIUM_PASSWORD=your_escriptorium_password

See this Jupyter notebook for a longer introduction to the connector.

Development

Want to contribute? There is a lot to be done here, so we are happy for any PRs and updates.

Development Environment

This project uses Poetry. To start development, please pull down the repo from GitLab and run poetry install, which will make sure you have all the needed dependencies for the project and that you are using a valid Python version. Please use poetry add <your-pip-package> to install any new dependencies to the project so that they will be tracked by poetry.

Uploading to Pypi

Poetry also makes uploading to Pypi very easy. Just confirm that all the package details in pyproject.toml are correct, bump the version of the package poetry version 0.0.15, and then use poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD, assuming you have set the environment variables $PYPI_USERNAME and $PYPI_PASSWORD appropriately (if you are using a Pypi token, then PYPI_USERNAME=__token__ and $PYPI_PASSWORD=<your-full-pypi-token>).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

escriptorium-connector-0.1.2.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

escriptorium_connector-0.1.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file escriptorium-connector-0.1.2.tar.gz.

File metadata

  • Download URL: escriptorium-connector-0.1.2.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.7.12 Linux/5.4.0-91-generic

File hashes

Hashes for escriptorium-connector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1604aaa9e6345787a1f01c52ee59d09b2de5fb194e55effccf27744a5c388c3d
MD5 7e1d4df9c4ec2f983fdf385e10e05833
BLAKE2b-256 e58124fd416e6cc7e2665363a1fa22308686071c9f5374d4268bf7010d95832d

See more details on using hashes here.

File details

Details for the file escriptorium_connector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for escriptorium_connector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e91f4a40d1a744dd01a7b940a00a372db38fffb594b3d4282040a03a1e144085
MD5 72ecaafb8d3e856067f0b4e38ce76d38
BLAKE2b-256 1d3d864f2ad1cd555506b7bddf61968e87fedcb8a3d13fea93b65dadec967996

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page