Python Client for European XFEL Calibration Catalogue Web App available at https://in.xfel.eu/calibration
Project description
Calcat is the Web App design for Calibration Constants Data Management at European XFEL.
This library (calibration_client) is a client for the RESTful APIs exposed by the European XFEL Calibration Constants Catalogue Web Application - calCat (https://in.xfel.eu/calibration).
Repository:
Dependencies:
oauthlib (https://pypi-hypernode.com/pypi/oauthlib)
requests (https://github.com/kennethreitz/requests)
requests-oauthlib (https://github.com/requests/requests-oauthlib)
oauth2_xfel_client (https://git.xfel.eu/gitlab/ITDM/oauth2_xfel_client)
Installation
Python project
Install requirements, if never done before
1.1. For OS X distributions:
1.1.1. Homebrew brew install python3 1.1.2 Port sudo port install python36 sudo port select --set python3 python36 sudo port install py36-pip sudo port select --set pip pip361.2. For Linux distributions:
sudo apt-get update sudo apt-get install python3.6
Make calibration_client library available in your python environment
2.1. Install it via pip:
# Install dependencies from local wheels files pip install . --no-index --find-links ./external_dependencies/ # Install dependencies from the pypi pip install .Installing it will place two folders under the current Python installation site-packages folder:
calibration_client with the sources;
calibration_client-9.0.1.dist-info/ with Wheels configuration files.
To identify your Python site-packages folder run:
python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
Usage
To use this project you need to import it:
from calibration_client import CalibrationClient
Development & Testing
When developing, and before commit changes, please validate that:
All tests continue passing successfully (to validate that run pytest):
# Go to the source code directory cd calibration_client # Upgrade package and all its required packages pip install . -U --upgrade-strategy eager # Install test dependencies pip install '.[test]' -U --upgrade-strategy eager # Run all tests using pytest pytest # Run all tests and get information about coverage for all files inside calibration_client package pytest --cov calibration_client --cov-report term-missing
Code keeps respecting pycodestyle code conventions (to validate that run pycodestyle):
pycodestyle .
To generate all the wheels files for the dependencies, execute:
# Generate Wheels to itself and dependencies pip wheel --wheel-dir=./external_dependencies . pip wheel --wheel-dir=./external_dependencies --find-links=./external_dependencies .
Check that you have the desired dependency versions in external_dependencies folder, since no versions are now set in setup.py.
Registering library on https://pypi-hypernode.com
To register this python library, the following steps are necessary:
# Install twine python -m pip install --upgrade twine # Generates source distribution (.tar.gz) and wheel (.whl) files in the dist/ folder python setup.py sdist python setup.py bdist_wheel # Upload new version .egg and .whl files twine upload dist/* # In case a test is necessary, it is possible to test it against test.pypi.org twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose
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
File details
Details for the file calibration_client-9.0.1.tar.gz
.
File metadata
- Download URL: calibration_client-9.0.1.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23116014746598b27a4a376e520ab868b9edfeb2b013fa1af42dc01793142624 |
|
MD5 | d2d1083f23d19dc73c5170b0601ee245 |
|
BLAKE2b-256 | 8bb3f8b64e02e04b55b474b4747c07d1b06ec9d844e3188e9c8dd7313482abe3 |
File details
Details for the file calibration_client-9.0.1-py3-none-any.whl
.
File metadata
- Download URL: calibration_client-9.0.1-py3-none-any.whl
- Upload date:
- Size: 76.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82e591ab274f3b83a8a296d8a84472e47e1ad54538b2d6f516918afebfb165e9 |
|
MD5 | 51f55ddd27abacdab39de19c75a8bc92 |
|
BLAKE2b-256 | ecfd73980ff7915e2bb7fb2b046355d58e62fddda2d8565dae9dbe791cc03684 |