Skip to main content

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:

Installation

Python project

  1. 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 pip36

1.2. For Linux distributions:

sudo apt-get update
sudo apt-get install python3.6
  1. 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.2.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:

  1. 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
  2. Code keeps respecting pycodestyle code conventions (to validate that run pycodestyle):

    pycodestyle .
  3. 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 .
  4. 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.org

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


Download files

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

Source Distribution

calibration_client-9.0.3.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

calibration_client-9.0.3-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file calibration_client-9.0.3.tar.gz.

File metadata

  • Download URL: calibration_client-9.0.3.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for calibration_client-9.0.3.tar.gz
Algorithm Hash digest
SHA256 2f257f490135b17e54b898b0742c2cbae866a7889ac849debe13f50f4d9f2616
MD5 6d6383f5e6699472a2d595fd967924db
BLAKE2b-256 d8c3ab2a22c8f1276327973a9cc9974f99944507a8fde88a87c450f6e91a6e75

See more details on using hashes here.

File details

Details for the file calibration_client-9.0.3-py3-none-any.whl.

File metadata

  • Download URL: calibration_client-9.0.3-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for calibration_client-9.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32494e769604c769bd2b6b737323860a5ef2ac3cf0b2d789f3a4e4f003b8d2f8
MD5 4654bd9847e02fb587b09ba8e2537648
BLAKE2b-256 1a4bc900350ef0a36242bb14cc7da27b15ce7a3cafc51ac5fba004fbc64b0c94

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