跳转到主要内容

使用ANDS生成DOI ids

项目描述

https://travis-ci.org/Psykar/ckanext-ands.svg?branch=master https://codecov.io/github/Psykar/ckanext-ands/badge.svg Downloads Latest Version Supported Python versions Development Status License

ckanext-ands

允许提交ANDS DOI请求以用于数据集。

用户可以提交DOI请求,该请求仅向定义的管理员发送电子邮件。系统管理员可以通过ANDS API直接从数据集页面将DOI添加到数据集中。

要求

与CKAN 2.5.1测试过

安装

要安装ckanext-ands

  1. 激活您的CKAN虚拟环境,例如

    . /usr/lib/ckan/default/bin/activate
  2. 将ckanext-ands Python包安装到您的虚拟环境中

    pip install ckanext-ands
  3. ands添加到您的CKAN配置文件中的ckan.plugins设置(默认配置文件位于/etc/ckan/default/production.ini)。

  4. 重启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上注册项目

  1. 创建项目的源分布

    python setup.py sdist
  2. 注册项目

    python setup.py register
  3. 将源分布上传到PyPI

    python setup.py sdist upload
  4. 在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,请按照以下步骤操作:

  1. 更新setup.py文件中的版本号。有关如何选择版本号的说明,请参阅PEP 440

  2. 创建新版本的源分发版

    python setup.py sdist
  3. 将源分布上传到PyPI

    python setup.py sdist upload
  4. 在GitHub上将项目的最新发布版本标记为与setup.py文件中的版本号。例如,如果setup.py中的版本号是0.0.2,那么请执行以下操作:

    git tag -a 0.0.2
    git push --tags

项目详情


下载文件

下载适用于您平台的自定义文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分发版

ckanext-ands-0.0.8.tar.gz (13.2 kB 查看哈希值)

上传时间

由以下支持