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.4

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.4
File Size Uploaded
ckanext_files-1.3.4.tar.gz 148.6 kB Details

Built distribution (wheel)

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

Total release size: 330.6 kB

Release files / ckanext_files-1.3.4.tar.gz

Download URL ckanext_files-1.3.4.tar.gz
Size 148.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cfcefa84a5492846b224574891251c07ed764a29fc64b0d660afa6e32a43e998
BLAKE2b-256 checksum
How to use checksums
3cca5d20fa3b0a227a063fbdceba38b9cdf60b28a3ddd4976a03c6cce7c521ea
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.4-py3-none-any.whl

Download URL ckanext_files-1.3.4-py3-none-any.whl
Size 182.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
854acbb1085836588d0e3ccbd3b6457c074f99ce205cd9d0ed5c96d224351280
BLAKE2b-256 checksum
How to use checksums
5a9c43cfdd4dd260e6c65c37fcced360e3047a7ced6a8025e21e671d90f9853d
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