ckanext-partialview

CKAN extension to enable previews for long `txt` and `csv` files

https://github.com/ondics/ckanext-partialview

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

CKAN extension to enable previews for long `txt` and `csv` files

Basic Info
  • Host: GitHub
  • Owner: ondics
  • License: agpl-3.0
  • Language: Python
  • Default Branch: master
  • Size: 49.8 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Created 11 months ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License Citation

README.md

ckanext-partialview

CKAN extension to enable preview for long txt and csv files.

In txt/csv previews this extensions limits the number of lines displayed for text files in a CKAN repository.

This is especially useful for large files such as CSV tables.

By showing only the first few lines, it keeps the interface clean while still providing a clear overview of the file's content.

This CKAN Extension enables resource previews for large txt and csv files.

Tested on CKAN 2.10 and 2.11

Published on

  • Github: https://github.com/ondics/ckanext-partialview (major,minor,patch releases)
  • OpenCode: https://gitlab.opencode.de/friedrich-loeffler-institut/fdm/ckanext-partialview (major/minor releases)

Installation

Source Installation

Extract the ZIP file containing ckanext-partialview e.g.:

unzip ckanext-partialview.zip -d /usr/lib/ckan/default/src

Activate your CKAN virtual environment:

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

Install extension inside the virtual environment:

cd ckanext-partialview
pip install .

Make sure to add pages to ckan.plugins in your config file, located in /etc/ckan/default/ckan.ini by default:

ckan.plugins = ... textpreview csvpreview ...

Restart CKAN:

supervisorctl restart ckan-uwsgi:  

Installation using Docker

Download and extract the ZIP file containing ckanext-partialview in ./ckan-extensions e.g.:

unzip ckanext-partialview.zip

Copy and install via Dockerfile:

COPY ckan-extensions/ $SRC_DIR
RUN cd $SRC_DIR/ckanext-partialview && \
    python3 setup.py develop

Add the plugins to CKAN__PLUGINS in your .env file:

CKAN__PLUGINS = textpreview csvpreview

Restart CKAN container:

docker restart ckan

Configuration

This extension includes two new resource views to your CKAN instance.

textpreview: Supported for file formats such as text/plain, txt, plain, xml, rdf, rdf+xml, owl+xml, atom, rss, json and csv.

csvpreview: Specifically for csv files.

Select the resource view in resource setting user interface.

The number of lines displayed is adjustable in the user interface. By default, the first 20 lines are shown. This value may be configured using:

ckanext.partialview_max_rows = 20

If the setting is omitted, it defaults to 20.

License

Released under the GNU Affero General Public License v3.0 or later.

See the file LICENSE for details.

Author

(C) 2025, Ondics GmbH on behalf of FLI Friedrich-Loeffler-Institut, Bundesforschungsinstitut für Tiergesundheit

Owner

  • Name: Ondics Githubler
  • Login: ondics
  • Kind: user
  • Location: Esslingen, Germany
  • Company: Ondics GmbH

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: ckanext-partialview
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Christopher
    family-names: Rickelt
    affiliation: Ondics GmbH
  - given-names: Wolfgang
    family-names: Clauss
    affiliation: Ondics GmbH
  - given-names: Yana
    family-names: Bodnar
    affiliation: Friedrich-Loeffler-Institut
    orcid: 'https://orcid.org/0000-0002-4059-7185'
  - given-names: Steffen
    family-names: Franke
    affiliation: Friedrich-Loeffler-Institut
    orcid: 'https://orcid.org/0000-0002-2806-5055'
  - given-names: Rainer
    family-names: Cramm
    affiliation: Friedrich-Loeffler-Institut
    orcid: 'https://orcid.org/0000-0002-3630-3885'
identifiers:
  - type: url
    value: >-
      https://github.com/ondics/ckanext-partialview
    description: The working copy of the extension is maintained on GitHub.
  - type: url
    value: >-
      https://gitlab.opencode.de/friedrich-loeffler-institut/fdm/ckanext-partialview
    description: The released version is published on OpenCode.
  - type: doi
    value: 10.5281/zenodo.15268675
    description: An archived version with a DOI is available on Zenodo.
repository-code: https://github.com/ondics/ckanext-partialview
abstract: >-
  Partial View is a CKAN extension that limits the number of
  lines displayed for text files in a CKAN repository. This
  is especially useful for large files such as CSV tables.
  By showing only the first few lines, it keeps the
  interface clean while still providing a clear overview of
  the file's content.
keywords:
  - ckan
  - csv
  - txt
  - preview
  - ckan-extension
license: AGPL-3.0-or-later
version: '1.0.0'
date-released: '2025-03-27'

GitHub Events

Total
  • Release event: 2
  • Watch event: 4
  • Push event: 4
  • Fork event: 1
  • Create event: 2
Last Year
  • Release event: 2
  • Watch event: 4
  • Push event: 4
  • Fork event: 1
  • Create event: 2

Dependencies

requirements.txt pypi
  • pandas *
setup.py pypi
  • CKAN *
  • http *
  • requirements.txt *