Skip to main content

Paginate resources on CKAN dataset pages

Project description

ckanext-resource-pagination

Paginate resources on CKAN dataset pages. Prevents browser crashes on datasets with thousands of resources by showing 50 per page with navigation controls.

Requirements

  • CKAN 2.11+
  • Python 3.8+

Installation

pip install ckanext-resource-pagination

Or from source:

pip install -e git+https://github.com/tanmayagrawal21/ckanext-resource-pagination.git#egg=ckanext-resource-pagination

Configuration

Add resource_pagination to ckan.plugins in your ckan.ini:

ckan.plugins = ... resource_pagination

No other configuration needed.

How it works

The plugin overrides the dataset read view (/dataset/<id>) to:

  1. Fetch the dataset via package_show (standard CKAN behavior)
  2. Slice the resources list to 50 items based on the resource_page URL parameter
  3. Only call resource_view_list on the visible 50 resources (not all of them)
  4. Pass pagination metadata to the template for rendering page controls

This means a dataset with 11,000 resources loads as fast as one with 20.

License

AGPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_resource_pagination-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_resource_pagination-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_resource_pagination-0.1.1.tar.gz.

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1f1cfc58d668d1219799d31887903470cf2aa15d09fede09fc791f780cfdbac7
MD5 633d4552a83ce1cdb721e7d36a2be155
BLAKE2b-256 9e39810809504f61cb29f0bf3db6d6e99b28e783ae48b2dcd13e21d75f8e2617

See more details on using hashes here.

File details

Details for the file ckanext_resource_pagination-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7c7cd285d2aaeb957142c04b6044a60b6ffbf7f1a4f3a0bf26a85f2c3eeb8c4
MD5 58179aa073dcc9162d948d259d26a4d2
BLAKE2b-256 a35dce9515679e154fb478f6a257c16905f8f93990eb230833f0c2f77999c34b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page