使用ANDS生成DOI ids
项目描述
ckanext-ands
允许提交ANDS DOI请求以用于数据集。
用户可以提交DOI请求,该请求仅向定义的管理员发送电子邮件。系统管理员可以通过ANDS API直接从数据集页面将DOI添加到数据集中。
要求
与CKAN 2.5.1测试过
安装
要安装ckanext-ands
激活您的CKAN虚拟环境,例如
. /usr/lib/ckan/default/bin/activate
将ckanext-ands Python包安装到您的虚拟环境中
pip install ckanext-ands
将ands添加到您的CKAN配置文件中的ckan.plugins设置(默认配置文件位于/etc/ckan/default/production.ini)。
重启CKAN。例如,如果您已在Ubuntu上使用Apache部署CKAN
sudo service apache2 reload
配置设置
以下为必需项
ckanext.ands.DOI_API_KEY = xxyyzz ckanext.ands.shared_secret = asdfasdf # Email addresses to notify admins of a DOI request, comma separated ckanext.ands.support_emails = example@test.com,example2@test.com # THe publisher to use when submitting to ANDS ckanext.ands.publisher = 'A publisher' # The client ID proided by ANDS ckanext.ands.client_id = 123123 # Set this to a URL you've enabled with ANDS, and requests from localhost will # use this url instead, useful for debugging ckanext.ands.debug_url = http://example.com
以下为可选项(默认值已显示)
# DOI prefix to use for requests, defaults to ANDS default prefix ckanext.ands.doi_prefix = 10.5072/ # Enable to add &debug=True to the tail of ANDS requests to get a bit more # info back on errors ckanext.ands.debug = False
开发安装
要为开发安装ckanext-ands,请激活您的CKAN虚拟环境,然后执行以下操作
git clone https://github.com/Psykar/ckanext-ands.git cd ckanext-ands python setup.py develop pip install -r dev-requirements.txt
运行测试
要运行测试,请执行以下操作
nosetests --nologcapture --with-pylons=test.ini
要运行测试并生成覆盖率报告,请首先确保您已在本地的虚拟环境中安装了coverage(pip install coverage),然后运行
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.ands --cover-inclusive --cover-erase --cover-tests
在PyPI上注册ckanext-ands
ckanext-ands应可在PyPI上作为https://pypi.python.org/pypi/ckanext-ands获得。如果该链接不起作用,则可以按照以下步骤首次在PyPI上注册项目
创建项目的源分布
python setup.py sdist
注册项目
python setup.py register
将源分布上传到PyPI
python setup.py sdist upload
在GitHub上将项目的第一个版本标记为与
setup.py
文件中的版本号。例如,如果setup.py
中的版本号是0.0.1,那么请执行以下操作:git tag 0.0.1 git push --tags
发布ckanext-ands的新版本
ckanext-ands作为https://pypi.python.org/pypi/ckanext-ands在PyPI上可用。要将新版本发布到PyPI,请按照以下步骤操作:
更新
setup.py
文件中的版本号。有关如何选择版本号的说明,请参阅PEP 440。创建新版本的源分发版
python setup.py sdist
将源分布上传到PyPI
python setup.py sdist upload
在GitHub上将项目的最新发布版本标记为与
setup.py
文件中的版本号。例如,如果setup.py
中的版本号是0.0.2,那么请执行以下操作:git tag -a 0.0.2 git push --tags
项目详情
ckanext-ands-0.0.8.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4b61f03a74c0701c4caffc02518f40b2e420d246b627d175abda6fb52d26f0bd |
|
MD5 | 7c6c62584d405700acce66f55332cc4a |
|
BLAKE2b-256 | 5c6e999146535bf9a7a753f32dcccae72b2de9359b8c805905005248dad02d00 |