用于自动评估woudc数据质量的python包。

woudc-qa的Python项目详细描述


Build StatusBuild statusDownloads this month on PyPILatest releaseLicense

woudc质量评估库

用于自动质量评估的python包 WOUDC基于定义的规则的数据。

安装

要求

woudc qa需要python 2.7。

依赖关系

requirements.txt

安装软件包
# via distutils
pip install -r requirements.txt
python setup.py install

使用量

命令行界面
usage: woudc-qa.py [-h] --file FILE

Execute Qa.

optional arguments:
  -h, --help   show this help message and exit
  --file FILE  Path to extended CSV file to be quality assessed.

示例

fromwoudc_qaimportqafile_s=open(<pathtoyourextendedCSVfile.>).read()qa_results=qa(file_s)# qa_results is a dictionary as such:# qa_results: {#     filename: {#        test_id: {#            row : {#                result: result of this test, pass/fail/None/NR,#                table: table name,#                table_index: table_index,#                element: element name,#                related_test_id: test_id,#                related_test_result: related tests result, pass/fail/None/NR#                precond : precondition result: pass/fail/None/NR#            }#        }#    }# }# where,# 'filename' is the name of the file, default it to 'file1'# 'test_id' is the test identifier from the test definition# 'row' is the row number of the element under assessmet. Always 1 for non profile/payload element# 'result', is the result of the assessment for the element at the indicated row for the given test# 'table' is the name of the table where the element under assessment is found# 'table_index' is the index of the above table. Default to 1, index will be incremented by 1 to handle multicipity# 'element' is the element under assessment# 'related_test_id' is a listing of any related test to this test# 'related_test_result' is a aggregated result of all related tests to this test# 'precond' is the aggregated result of any precondition checks## from collections import OrderedDict# test_result = qa_result[<filename>][<test_id>]# iterate over test results by row:# for row, result in test_result.iteritems():#    print row, result# get result of assessment at a specific row# row_result = qa_results[<filename>][<test_id>][<row number>]['result']

发展

对于开发环境,在python中安装 virtualenv

virtualenv foo
cd foo
. bin/activate
# fork master
# fork http://github.com/woudc/woudc-qa on GitHub
# clone your fork to create a branch
git clone https://github.com/{your GitHub username}/woudc-qa.git
cd woudc-qa
# install dev packages
pip install -r requirements.txt
python setup.py install
# create upstream remote
git remote add upstream https://github.com/woudc/woudc-qa.git
git pull upstream master
git branch my-cool-feature
git checkout my-cool-feature
# start dev
git commit -m 'implement cool feature'# push to your fork
git push origin my-cool-feature
# issue Pull Request on GitHub
git checkout master
# cleanup/update once your branch is merged on GitHub
# remove branch
git branch -D my-cool-feature
# update your fork
git pull upstream master
git push origin master

运行测试
# via distutils
python setup.py test# manually
python run_tests.py
# report test coverage
coverage run --source woudc_qa setup.py test
coverage report -m

代码约定

质量保证规范是否符合 PEP8

# code should always pass the following
find -type f -name "*.py"| xargs flake8

问题

所有错误、增强和问题都在 GitHub

历史

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

推荐PyPI第三方库


热门话题
java连接在一个屏幕上成功下载,在第二个屏幕上用几乎相同的代码获得错误   java调用super。超级的方法,跳过超级。方法   使用Web服务连接到sharepoint 2013的Java应用程序   java我无法正确呈现editText   httpurlconnection如何在java中检查url连接状态   java Spring Security可以为同一用户接受多个密码吗?   java如何在PreparedStatement中使用自动生成的@Id?   java每个数组表示一个位模式   java我不确定如何记录鼠标在某个区域被点击的次数   spring如何解决:java。lang.NoSuchMethodError:javax。坚持不懈实体管理器。createStoredProcedureQuery(Ljava/lang/String;)   java如何为blackberry中listfield项内的不同字段触发事件   安卓使用Proguard混淆java代码   java在grails 2中与多个数据源有一个和一个域关联。十、   java在尝试在单击按钮时返回combobox值时一直出错   java我可以在setter中使用@Resource注释而不是字段吗?   java Eclipse调试步进不工作   java比较相同对象的两个表并选择不同的表