ckanext-drupal-api


Nameckanext-drupal-api JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/DataShades/ckanext-drupal-api
Summary
upload_time2023-08-16 20:34:43
maintainer
docs_urlNone
authorSergey Motornyuk
requires_python
licenseAGPL
keywords ckan
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # ckanext-drupal-api

The extension helps synchronize the header and footer between CKAN and Drupal.

It uses two versions of the Drupal API - the core Rest API and the JSON:API.

The extension receives data from the Drupal portal through an endpoint
(which can be configured in the case of the core REST API) and caches it for
a certain time, which can also be changed using the Cache TTL config option,
specifying the value in seconds. If you want to synchronize data more often,
you need to set a smaller value.


## Requirements

* CKAN>=2.9
* python>=3.7

## Installation

To install ckanext-drupal-api:

1. Activate your CKAN virtual environment, for example:

     . /usr/lib/ckan/default/bin/activate

2. Clone the source and install it on the virtualenv

    git clone https://github.com/DataShades/ckanext-drupal-api.git
    cd ckanext-drupal-api
    pip install -e .
	pip install -r requirements.txt

3. Add `drupal-api` to the `ckan.plugins` setting in your CKAN
   config file (by default the config file is located at
   `/etc/ckan/default/ckan.ini`).

4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload


## Config settings

The extension provides next configuration options:

	# 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



## Developer installation

To install ckanext-drupal-api for development, activate your CKAN virtualenv and
do:

    git clone https://github.com/DataShades/ckanext-drupal-api.git
    cd ckanext-drupal-api
    python setup.py develop
    pip install -r dev-requirements.txt


## Tests

To run the tests, do:

    pytest --ckan-ini=test.ini


## Releasing a new version of ckanext-drupal-api

If ckanext-drupal-api should be available on PyPI you can follow these steps to publish a new version:

1. Update the version number in the `setup.py` file. See [PEP 440](http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers) for how to choose version numbers.

2. Make sure you have the latest version of necessary packages:

    pip install --upgrade setuptools wheel twine

3. Create a source and binary distributions of the new version:

       python setup.py sdist bdist_wheel && twine check dist/*

   Fix any errors you get.

4. Upload the source distribution to PyPI:

       twine upload dist/*

5. Commit any outstanding changes:

       git commit -a
       git push

6. Tag the new release of the project on GitHub with the version number from
   the `setup.py` file. For example if the version number in `setup.py` is
   0.0.1 then do:

       git tag 0.0.1
       git push --tags

## License

[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DataShades/ckanext-drupal-api",
    "name": "ckanext-drupal-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "CKAN",
    "author": "Sergey Motornyuk",
    "author_email": "sergey.motornyuk@linkdigital.com.au",
    "download_url": "https://files.pythonhosted.org/packages/60/a2/6503319e0398aabc439646a62e8e26d7b5cbf01011be74ad42af12fa9f04/ckanext-drupal-api-0.6.0.tar.gz",
    "platform": null,
    "description": "# ckanext-drupal-api\n\nThe extension helps synchronize the header and footer between CKAN and Drupal.\n\nIt uses two versions of the Drupal API - the core Rest API and the JSON:API.\n\nThe extension receives data from the Drupal portal through an endpoint\n(which can be configured in the case of the core REST API) and caches it for\na certain time, which can also be changed using the Cache TTL config option,\nspecifying the value in seconds. If you want to synchronize data more often,\nyou need to set a smaller value.\n\n\n## Requirements\n\n* CKAN>=2.9\n* python>=3.7\n\n## Installation\n\nTo install ckanext-drupal-api:\n\n1. Activate your CKAN virtual environment, for example:\n\n     . /usr/lib/ckan/default/bin/activate\n\n2. Clone the source and install it on the virtualenv\n\n    git clone https://github.com/DataShades/ckanext-drupal-api.git\n    cd ckanext-drupal-api\n    pip install -e .\n\tpip install -r requirements.txt\n\n3. Add `drupal-api` to the `ckan.plugins` setting in your CKAN\n   config file (by default the config file is located at\n   `/etc/ckan/default/ckan.ini`).\n\n4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:\n\n    sudo service apache2 reload\n\n\n## Config settings\n\nThe extension provides next configuration options:\n\n\t# The URL of connected drupal instance\n\tckanext.drupal_api.drupal_url = http://drupal.com\n\n\t# Request timeout for API calls in seconds\n    # (optional, default: 5)\n\tckanext.drupal_api.timeout = 10\n\n\t# Cache TTL in seconds\n    # (optional, default: 3600)\n\tckanext.drupal_api.cache.duration = 60\n\n    # HTTP auth credentials (optional)\n\tckanext.drupal_api.request.user = username\n    ckanext.drupal_api.request.pass = password\n\n    # API versions, only two options: core & json\n    # Because, there are two supported API versions: JSON API & RESTful Web Services\n    ckanext.drupal_api.api_version = json\n\n    # If you are using the core API version, you might face the situation when your endpoint differ from the default one\n    # In this case, you can specify the menu export endpoint through the config, e.g.:\n    ckanext.drupal_api.core.menu_export_endpoint = /api/v1/menu_export\n\n\n\n## Developer installation\n\nTo install ckanext-drupal-api for development, activate your CKAN virtualenv and\ndo:\n\n    git clone https://github.com/DataShades/ckanext-drupal-api.git\n    cd ckanext-drupal-api\n    python setup.py develop\n    pip install -r dev-requirements.txt\n\n\n## Tests\n\nTo run the tests, do:\n\n    pytest --ckan-ini=test.ini\n\n\n## Releasing a new version of ckanext-drupal-api\n\nIf ckanext-drupal-api should be available on PyPI you can follow these steps to publish a new version:\n\n1. Update the version number in the `setup.py` file. See [PEP 440](http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers) for how to choose version numbers.\n\n2. Make sure you have the latest version of necessary packages:\n\n    pip install --upgrade setuptools wheel twine\n\n3. Create a source and binary distributions of the new version:\n\n       python setup.py sdist bdist_wheel && twine check dist/*\n\n   Fix any errors you get.\n\n4. Upload the source distribution to PyPI:\n\n       twine upload dist/*\n\n5. Commit any outstanding changes:\n\n       git commit -a\n       git push\n\n6. Tag the new release of the project on GitHub with the version number from\n   the `setup.py` file. For example if the version number in `setup.py` is\n   0.0.1 then do:\n\n       git tag 0.0.1\n       git push --tags\n\n## License\n\n[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)\n",
    "bugtrack_url": null,
    "license": "AGPL",
    "summary": "",
    "version": "0.6.0",
    "project_urls": {
        "Homepage": "https://github.com/DataShades/ckanext-drupal-api"
    },
    "split_keywords": [
        "ckan"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e28a55e3e351745f3bf153424a2fa204492a41802561b0ee0c47edd93cdcc79a",
                "md5": "3efe5367ca73c5f33396ed4c855c3ee8",
                "sha256": "66e3149ad752229fd2d1c84b90704610f425f750c5e9a0ffa92abb2dfaa3ff7b"
            },
            "downloads": -1,
            "filename": "ckanext_drupal_api-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3efe5367ca73c5f33396ed4c855c3ee8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25425,
            "upload_time": "2023-08-16T20:34:40",
            "upload_time_iso_8601": "2023-08-16T20:34:40.579238Z",
            "url": "https://files.pythonhosted.org/packages/e2/8a/55e3e351745f3bf153424a2fa204492a41802561b0ee0c47edd93cdcc79a/ckanext_drupal_api-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60a26503319e0398aabc439646a62e8e26d7b5cbf01011be74ad42af12fa9f04",
                "md5": "3493b5d25b9446f9c6564693434d7687",
                "sha256": "0cb0deb9f1ff3040d56e2796d230e96f8575b0814a561f6b41c10f9489b6870b"
            },
            "downloads": -1,
            "filename": "ckanext-drupal-api-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3493b5d25b9446f9c6564693434d7687",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24198,
            "upload_time": "2023-08-16T20:34:43",
            "upload_time_iso_8601": "2023-08-16T20:34:43.128410Z",
            "url": "https://files.pythonhosted.org/packages/60/a2/6503319e0398aabc439646a62e8e26d7b5cbf01011be74ad42af12fa9f04/ckanext-drupal-api-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-16 20:34:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DataShades",
    "github_project": "ckanext-drupal-api",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "ckanext-drupal-api"
}
        
Elapsed time: 0.10218s