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.2.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.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8bff69a3da317fcd1737093d277b580b9d7ec1bef8582203cc1ad6ca6220c6dd
MD5 b840d0d8dcf6ebd88e13632f8da6e8bf
BLAKE2b-256 9f2f6cae341d59b3a3ca0b8cfbc492c648e25595a86d4364189b9a78584ff5e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a4f9a893ae4d2b80b90a6717ff71e58664638fcc0c2fd217c7b0ec91c495e1c
MD5 76b1e70f53622d1802641e403849182f
BLAKE2b-256 aa29c225c0910bed05e1a6a557407aafe3e6658d9786812bf74e3af414240705

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