[![Tests](https://github.com/DataShades/ckanext-check-link/workflows/Tests/badge.svg?branch=main)](https://github.com/DataShades/ckanext-check-link/actions)
# ckanext-check-link
Link checker for CKAN.
Provides API, CLI commands, and views for:
* checking availability of the file, refereed by resource
* checking availability of any arbitrary link.
* storing results of these checks
* visualizing stored results
<!-- * downloading a report based on the stored results -->
### Index
* [Requirements](#requirements)
* [Installation](#installation)
* [Config settings](#config-settings)
* [UI](#ui)
* [CLI](#cli)
* [API](#api)
## Requirements
Compatibility with core CKAN versions:
| CKAN version | Compatible? |
|--------------|-------------|
| 2.9 | yes |
| 2.10 | yes |
## Installation
1. Install `ckanext-check-link`
```
pip install ckanext-check-link
```
1. Add `check_link` to the `ckan.plugins` setting in your CKAN config file.
## Config settings
```ini
# Allow any logged-in user to check links. This implies specific security issues,
# thus disabled by default.
# (optional, default: false).
ckanext.check_link.user_can_check_url = yes
# URL for the "Link availability" page.
# (optional, default: /check-link/report/global)
ckanext.check_link.report.base_template = /ckan-admin/link-state
# A base template that is extended by the "Link availability" page.
# (optional, default: check_link/base_admin.html)
ckanext.check_link.report.base_template = check_link/base.html
```
## UI
### Link availability
#### Endpoint: `check_link.report`
#### Path: `/check-link/report/global`
Paginated listing of all the "broken" links. Access is controlled by the
`check_link_view_report_page` auth function, which can be bypassed only by
sysadmin.
## CLI
CLI commands are registered under `ckan check-link` route.
### `check-packages`
Check every resource inside each package.
The scope can be narrowed via arbitrary number of arguments, specifying the package's ID or name.
```sh
# check all the public packages
$ ckan check-link check-packages
# check all the active packages
$ ckan check-link check-packages --include-private
# check all the public and draft pacakges
$ ckan check-link check-packages --include-draft
# check only two specified packages
$ ckan check-link check-packages pkg-id-one pkg-name-two
```
### `check-resources`
Check every resource on the portal.
Scope can be narrowed via arbitary number of arguments, specifying resource's ID
### `delete-reports`
Delete check-link reports.
```sh
# delete all reports
$ ckan check-link delete-reports
# drop reports that point to an unexisting resource
$ ckan check-link delete-reports --orphans-only
```
Scope can be narrowed via arbitary number of arguments, specifying resource's ID
## API
### `check_link_url_check`
### `check_link_resource_check`
### `check_link_package_check`
### `check_link_organization_check`
### `check_link_group_check`
### `check_link_user_check`
### `check_link_search_check`
### `check_link_report_save`
### `check_link_report_show`
### `check_link_report_search`
### `check_link_report_delete`
TBA
## License
[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
Raw data
{
"_id": null,
"home_page": "https://github.com/DataShades/ckanext-check-link",
"name": "ckanext-check-link",
"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/18/fd/858ff1a67f9a8b73193ccd53ee033228ec0e34edee95956698175b8cacdf/ckanext-check-link-0.1.1.post1.tar.gz",
"platform": null,
"description": "[![Tests](https://github.com/DataShades/ckanext-check-link/workflows/Tests/badge.svg?branch=main)](https://github.com/DataShades/ckanext-check-link/actions)\n\n# ckanext-check-link\n\nLink checker for CKAN.\n\nProvides API, CLI commands, and views for:\n\n* checking availability of the file, refereed by resource\n* checking availability of any arbitrary link.\n* storing results of these checks\n* visualizing stored results\n\n<!-- * downloading a report based on the stored results -->\n\n### Index\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n* [Config settings](#config-settings)\n* [UI](#ui)\n* [CLI](#cli)\n* [API](#api)\n\n## Requirements\n\nCompatibility with core CKAN versions:\n\n| CKAN version | Compatible? |\n|--------------|-------------|\n| 2.9 | yes |\n| 2.10 | yes |\n\n## Installation\n\n1. Install `ckanext-check-link`\n ```\n pip install ckanext-check-link\n ```\n\n1. Add `check_link` to the `ckan.plugins` setting in your CKAN config file.\n\n\n## Config settings\n\n```ini\n# Allow any logged-in user to check links. This implies specific security issues,\n# thus disabled by default.\n# (optional, default: false).\nckanext.check_link.user_can_check_url = yes\n\n# URL for the \"Link availability\" page.\n# (optional, default: /check-link/report/global)\nckanext.check_link.report.base_template = /ckan-admin/link-state\n\n# A base template that is extended by the \"Link availability\" page.\n# (optional, default: check_link/base_admin.html)\nckanext.check_link.report.base_template = check_link/base.html\n\n```\n\n## UI\n\n### Link availability\n#### Endpoint: `check_link.report`\n#### Path: `/check-link/report/global`\n\nPaginated listing of all the \"broken\" links. Access is controlled by the\n`check_link_view_report_page` auth function, which can be bypassed only by\nsysadmin.\n\n## CLI\n\nCLI commands are registered under `ckan check-link` route.\n\n\n### `check-packages`\n\nCheck every resource inside each package.\n\nThe scope can be narrowed via arbitrary number of arguments, specifying the package's ID or name.\n\n```sh\n# check all the public packages\n$ ckan check-link check-packages\n\n# check all the active packages\n$ ckan check-link check-packages --include-private\n\n# check all the public and draft pacakges\n$ ckan check-link check-packages --include-draft\n\n# check only two specified packages\n$ ckan check-link check-packages pkg-id-one pkg-name-two\n\n```\n\n### `check-resources`\nCheck every resource on the portal.\n\nScope can be narrowed via arbitary number of arguments, specifying resource's ID\n\n### `delete-reports`\nDelete check-link reports.\n\n```sh\n# delete all reports\n$ ckan check-link delete-reports\n\n# drop reports that point to an unexisting resource\n$ ckan check-link delete-reports --orphans-only\n```\n\nScope can be narrowed via arbitary number of arguments, specifying resource's ID\n\n## API\n\n### `check_link_url_check`\n### `check_link_resource_check`\n### `check_link_package_check`\n### `check_link_organization_check`\n### `check_link_group_check`\n### `check_link_user_check`\n### `check_link_search_check`\n\n### `check_link_report_save`\n### `check_link_report_show`\n### `check_link_report_search`\n### `check_link_report_delete`\n\nTBA\n\n## License\n\n[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)\n",
"bugtrack_url": null,
"license": "AGPL",
"summary": "Resource URL checker",
"version": "0.1.1.post1",
"project_urls": {
"Homepage": "https://github.com/DataShades/ckanext-check-link"
},
"split_keywords": [
"ckan"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08a6c50636ee9b59979b3962d89c9fccf668f6607959f027edc8e78b50d87035",
"md5": "bea998d6e860760f1bc27b403d8638dc",
"sha256": "4e8ee3789dbe58895ca94268b284d9c7361c82e1ebc7706093fd157a78cece8c"
},
"downloads": -1,
"filename": "ckanext_check_link-0.1.1.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bea998d6e860760f1bc27b403d8638dc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 38460,
"upload_time": "2023-05-27T14:38:48",
"upload_time_iso_8601": "2023-05-27T14:38:48.714870Z",
"url": "https://files.pythonhosted.org/packages/08/a6/c50636ee9b59979b3962d89c9fccf668f6607959f027edc8e78b50d87035/ckanext_check_link-0.1.1.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "18fd858ff1a67f9a8b73193ccd53ee033228ec0e34edee95956698175b8cacdf",
"md5": "81ecd565bd85e0af9ae6db460c746f6c",
"sha256": "26bc462efb662b1e2c20fdc08543e5b38deca9e85b2ddb448d18bed6d0d63dbc"
},
"downloads": -1,
"filename": "ckanext-check-link-0.1.1.post1.tar.gz",
"has_sig": false,
"md5_digest": "81ecd565bd85e0af9ae6db460c746f6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32871,
"upload_time": "2023-05-27T14:38:52",
"upload_time_iso_8601": "2023-05-27T14:38:52.380029Z",
"url": "https://files.pythonhosted.org/packages/18/fd/858ff1a67f9a8b73193ccd53ee033228ec0e34edee95956698175b8cacdf/ckanext-check-link-0.1.1.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-27 14:38:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DataShades",
"github_project": "ckanext-check-link",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "ckanext-check-link"
}