未提供项目描述
项目描述
ckanext-drupal-api
该扩展帮助同步CKAN和Drupal之间的页眉和页脚。
它使用两个版本的Drupal API - 核心REST API和JSON:API。
该扩展通过端点(在核心REST API的情况下可以配置)从Drupal门户接收数据,并在一定时间内将其缓存,这也可以通过Cache TTL配置选项进行更改,指定以秒为单位的值。如果您想更频繁地同步数据,需要设置较小的值。
要求
- CKAN>=2.9
- python>=3.7
安装
要安装ckanext-drupal-api
-
激活您的CKAN虚拟环境,例如
. /usr/lib/ckan/default/bin/activate
-
克隆源并将其安装在虚拟环境上
git clone https://github.com/DataShades/ckanext-drupal-api.git cd ckanext-drupal-api pip install -e . pip install -r requirements.txt
-
将
drupal-api
添加到您的 CKAN 配置文件中的ckan.plugins
设置(默认配置文件位于/etc/ckan/default/ckan.ini
)。 -
重启 CKAN。例如,如果您在 Ubuntu 上使用 Apache 部署了 CKAN
sudo service apache2 reload
配置设置
该扩展提供以下配置选项
# The URL of connected drupal instance
ckanext.drupal_api.drupal_url = http://drupal.com
# Request timeout for API calls in seconds
# (optional, default: 5)
ckanext.drupal_api.timeout = 10
# Cache TTL in seconds
# (optional, default: 3600)
ckanext.drupal_api.cache.duration = 60
# HTTP auth credentials (optional)
ckanext.drupal_api.request.user = username
ckanext.drupal_api.request.pass = password
# API versions, only two options: core & json
# Because, there are two supported API versions: JSON API & RESTful Web Services
ckanext.drupal_api.api_version = json
# If you are using the core API version, you might face the situation when your endpoint differ from the default one
# In this case, you can specify the menu export endpoint through the config, e.g.:
ckanext.drupal_api.core.menu_export_endpoint = /api/v1/menu_export
开发者安装
要为开发安装 ckanext-drupal-api,激活您的 CKAN 虚拟环境并执行
git clone https://github.com/DataShades/ckanext-drupal-api.git
cd ckanext-drupal-api
python setup.py develop
pip install -r dev-requirements.txt
测试
要运行测试,请执行
pytest --ckan-ini=test.ini
发布 ckanext-drupal-api 的新版本
如果 ckanext-drupal-api 应该在 PyPI 上可用,您可以按照以下步骤发布新版本
-
在
setup.py
文件中更新版本号。有关如何选择版本号的说明,请参阅 PEP 440。 -
确保您有必要的最新版本包
pip install --upgrade setuptools wheel twine
-
创建新版本的源和二进制发行版
python setup.py sdist bdist_wheel && twine check dist/*
修复您遇到的任何错误。
-
将源发行版上传到 PyPI
twine upload dist/*
-
提交任何未处理的更改
git commit -a git push
-
使用来自
setup.py
文件的版本号在 GitHub 上标记项目的全新版本。例如,如果setup.py
中的版本号是 0.0.1,则执行git tag 0.0.1 git push --tags
许可证
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源发行版
构建发行版
ckanext-drupal-api-0.6.0.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0cb0deb9f1ff3040d56e2796d230e96f8575b0814a561f6b41c10f9489b6870b |
|
MD5 | 3493b5d25b9446f9c6564693434d7687 |
|
BLAKE2b-256 | 60a26503319e0398aabc439646a62e8e26d7b5cbf01011be74ad42af12fa9f04 |
ckanext_drupal_api-0.6.0-py3-none-any.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 66e3149ad752229fd2d1c84b90704610f425f750c5e9a0ffa92abb2dfaa3ff7b |
|
MD5 | 3efe5367ca73c5f33396ed4c855c3ee8 |
|
BLAKE2b-256 | e28a55e3e351745f3bf153424a2fa204492a41802561b0ee0c47edd93cdcc79a |