python client for european xfel calibration catalogue web app,网址:https://in.xfel.eu/calibration

calibration-client的Python项目详细描述


依赖项负责封装和管理与 校准常数目录web应用程序抛出restful api调用。

存储库:

依赖项:

安装

python项目

  1. 安装要求,如果以前从未安装过

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. 在python环境中提供calibration_客户端库

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. 要识别python站点包文件夹,请运行:

    python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
    

用法

要使用此项目,您需要导入它。

如果希望直接与api方法交互,则应导入calibrationclientapi类:
from calibration_client.calibration_client_api import CalibrationClientApi
如果要与模型类交互,则应导入calibrationclient类:
from calibration_client.calibration_client import CalibrationClient
或导入所有内容:
import calibration_client

开发和测试

开发时,在提交更改之前,请验证:

  1. 所有测试继续成功通过(以验证运行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. 代码始终遵守pycodesyle代码约定(以验证运行pycodesyle):

    pycodestyle .
    
  3. 要为依赖项生成所有wheels文件,请执行:

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

请确保在requirements.txt和setup.py文件中具有所需的版本。

正在https://pypi.org上注册库

要注册此python库,需要执行以下步骤:

# 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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java连接usb到uart设备到安卓设备>3.1   可以强制Php中的web应用程序与Java中的桌面应用程序一起工作吗?   java为什么自定义系统类加载器不工作?   数组在Java中解析具有多个分隔符的字符串   PMD Java 8德米特定律   JavaSpringMVC表单验证不适用于嵌套的复杂类型   让Eclipse Java组织导入以使用Google checkstyle   java Appium:无法创建新会话   java如何在数组中声明新字段   java如何解决“无法初始化类org.apache.cassandra.config.DatabaseDescriptor”?   java AsyncTask创建socket   java向@CreatedBy添加更多信息   如何在ubuntu中运行包含大量jars依赖项的java文件   java如何使用<s:select>标记并在中休眠来填充下拉列表?   java获取错误:找不到符号变量“level”和“next_level_button”   javaweb应用中基于UI的ajax显示代码流   Java长到MySql   java JvisualVM:奇怪的应用程序行为   ubuntu将Java程序的输出结果保存到一个文件中