Skip to main content

Python Client for European XFEL Calibration Catalogue Web App available at https://in.xfel.eu/calibration

Project description

Dependency responsible for encapsulating and managing the interaction with the Calibration Constants Catalogue Web Application throw RESTful API calls.

Repository:

Dependencies:

Installation

Python project

  1. Install requirements, if never done before

1.1. For OS X distributions:

sudo port install python35
sudo port

sudo port select --set python3 python35

sudo port install py35-pip
sudo port select --set pip pip35

sudo port install py35-nose
sudo port select --set nosetests nosetests-3.5

pip install pycodestyle

1.2. For Linux distributions:

sudo apt-get update
sudo apt-get install python3.5
  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 --upgrade --find-links ./external_dependencies/*

# Install dependencies from the pypi
pip install -r requirements.txt

Or as a normal python project (via .egg file):

python setup.py install
python setup.py install --user

Running this command the “compiled” calibration_client-6.1.3-py3.4.egg file is generated under the current Python installation site-packages folder.

2.2. Install it as a normal python project (via Wheel):

python setup.py bdist_wheel

Running this command 2 folders are generated under the current Python installation site-packages folder:

  • calibration_client with the sources;

  • calibration_client-6.1.3.dist-info/ with Wheels configuration files.

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

If you want interact directly with API methods you should import CalibrationClientApi class:

from calibration_client.calibration_client_api import CalibrationClientApi

If you want interact with Model classes you should import CalibrationClient class:

from calibration_client.calibration_client import CalibrationClient

Or import everything:

import calibration_client

Development & Testing

When developing, and before commit changes, please validate that:

  1. All tests continue passing successfully (to validate that run nosetests):

    # Go to the source code directory
    cd calibration_client
    
    # Run all tests
    nosetests .
    
    # Run all tests and get information about coverage for all files inside calibration_client package
    pip install python-dateutil
    pip install nose-cov
    nosetests --with-cov --cover-erase --cover-inclusive --cov-report term-missing --cov calibration_client
    
    # Run all tests with xunit
    nosetests --where=./calibration_client/ --with-xunit --xunit-file=pythonTest.xml
    
    # If you don't want use nosetests you can simply run the test class
    python -m calibration_client.tests.modules.calibration_constant_version
  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 its dependencies
    pip wheel --wheel-dir=./external_dependencies -r requirements.txt
    pip wheel --wheel-dir=./external_dependencies --find-links=./external_dependencies -r requirements.txt
    
    # Generate Wheels to itself and dependencies
    pip wheel --wheel-dir=./external_dependencies .
    pip wheel --wheel-dir=./external_dependencies --find-links=./external_dependencies .

Guarantee that you have the desired versions in requirements.txt and setup.py files.

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 egg file in the dist/ folder
python setup.py install

# Upload new version
twine upload dist/*

# In case a teste 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

calibration_client-6.1.3-py3.6.egg (149.3 kB view details)

Uploaded Source

calibration_client-6.1.3-py3-none-any.whl (68.0 kB view details)

Uploaded Python 3

File details

Details for the file calibration_client-6.1.3-py3.6.egg.

File metadata

  • Download URL: calibration_client-6.1.3-py3.6.egg
  • Upload date:
  • Size: 149.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.1

File hashes

Hashes for calibration_client-6.1.3-py3.6.egg
Algorithm Hash digest
SHA256 13c57ae12f7ce020561505f276847c6aaa7f6b8cae20cd6dca4d65c49f8bd05b
MD5 7625ef6ee23ae1fa0cc4ed52df34e676
BLAKE2b-256 4e3b12c595e94424252e16caae0ae57a2252139de0160a562fe3429f197da9ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: calibration_client-6.1.3-py3-none-any.whl
  • Upload date:
  • Size: 68.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.1

File hashes

Hashes for calibration_client-6.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a4c8810af9cf483094ad010fa0ce36a9459ff85522a374bd7b0569040f9627bf
MD5 954e577b0764871bd3db3ef205cdd0b4
BLAKE2b-256 c4ea36aa343d8f594a3c6ed30b83529e8ebca0acadcc0317ec8e105f133d25ee

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