https://github.com/ondics/ckanext-partialview
CKAN extension to enable previews for long `txt` and `csv` files
https://github.com/ondics/ckanext-partialview
Last synced: 5 months ago
JSON representation
CKAN extension to enable previews for long `txt` and `csv` files
- Host: GitHub
- URL: https://github.com/ondics/ckanext-partialview
- Owner: ondics
- License: agpl-3.0
- Created: 2025-05-08T13:53:03.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-04T09:55:28.000Z (about 1 year ago)
- Last Synced: 2025-09-04T18:40:30.899Z (9 months ago)
- Language: Python
- Size: 49.8 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Citation: CITATION.cff
- Publiccode: publiccode.yml
Awesome Lists containing this project
README
# 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