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.0.tar.gz (4.6 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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.0.tar.gz
Algorithm Hash digest
SHA256 705c1a8027ea62c904350d3aa37bf0f1fcd0de085224500e2f4f698787dc699f
MD5 db16676f0db475a30ed09a43f9bc3a48
BLAKE2b-256 949a9a4d172c97aeca0add4119882b50c4b159eda2aefba165e48b231e15ee2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9c20b48e9096012a21b31e8f0385190cd2cab1ef1fbda245dd2fe40d81673ce
MD5 bbc17a67e28cac5c1a54e16770c034af
BLAKE2b-256 af838756a64f41d078fb8518815d38cd6badb897537b71d2d8bdb4e82fd277cb

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