Skip to main content

Tests

ckanext-files

Files as first-class citizens of CKAN. Upload, manage, remove files directly and attach them to datasets, resources, etc.

Read the documentation for a full user guide.

Also, check documentation of the file-keeper library. It's used by this extension and contains logic that does not depend on CKAN and may be useful if you are going to implement custom storage adapter or just want to use familiar file abstractions in the arbitrary program.

Quickstart

  1. Install the extension

    pip install ckanext-files
    
  2. Add files to the ckan.plugins setting of the CKAN config file.

  3. Run DB migrations

    ckan db upgrade -p files
    
  4. Configure storage

    ckanext.files.storage.default.type = files:fs
    ckanext.files.storage.default.path = /tmp/example
    ckanext.files.storage.default.initialize = true
    
  5. Upload your first file

    ckanapi action files_file_create upload@~/Downloads/file.txt`
    

Development

Install dev extras and nodeJS dependencies:

pip install -e '.[dev]'
npm ci

Run unittests:

pytest

Run frontend tests:

# start test server in separate terminal
make test-server

# run tests
npx cypress run

Run typecheck:

npx pyright

License

AGPL

Release files for ckanext-files 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ckanext-files 1.3.3
File Size Uploaded
ckanext_files-1.3.3.tar.gz 148.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-files 1.3.3
File Interpreter ABI Platform
ckanext_files-1.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 330.2 kB

Release files / ckanext_files-1.3.3.tar.gz

Download URL ckanext_files-1.3.3.tar.gz
Size 148.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8497922c77d4fb24bb50c32f6c5c7fa5330f6f859f5f477eb3cb7ce306a38456
BLAKE2b-256 checksum
How to use checksums
98e336d02479b2ff3b30ec5abc8182b035f6386f51e3f004e36b6810ad5b851c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / ckanext_files-1.3.3-py3-none-any.whl

Download URL ckanext_files-1.3.3-py3-none-any.whl
Size 181.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67359db17f80956c1d4df7d814c98c8cc3e56bdd90571272c5bc29624d1cf368
BLAKE2b-256 checksum
How to use checksums
2e61ff4dc602238772565501849269a6cc6ec9fbc6643d20d05bb81f00eecffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page