Metadata-Version: 2.1
Name: ckanext-files
Version: 1.0.0a2
Home-page: https://github.com/DataShades/ckanext-files
Author: Sergey Motornyuk
Author-email: sergey.motornyuk@linkdigital.com.au
License: AGPL
Keywords: CKAN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing_extensions
Requires-Dist: pyyaml
Provides-Extra: test
Requires-Dist: pytest-ckan; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-faker; extra == "test"
Requires-Dist: freezegun; extra == "test"
Requires-Dist: responses; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: pymdown-extensions; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest-ckan; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-faker; extra == "dev"
Requires-Dist: freezegun; extra == "dev"
Requires-Dist: responses; extra == "dev"
Requires-Dist: mkdocs; extra == "dev"
Requires-Dist: mkdocs-material; extra == "dev"
Requires-Dist: pymdown-extensions; extra == "dev"
Requires-Dist: mkdocstrings[python]; extra == "dev"
Provides-Extra: gcs
Requires-Dist: google-cloud-storage; extra == "gcs"
Provides-Extra: opendal
Requires-Dist: opendal; extra == "opendal"
Provides-Extra: libcloud
Requires-Dist: apache-libcloud; extra == "libcloud"
Requires-Dist: cryptography; extra == "libcloud"

[![Tests](https://github.com/DataShades/ckanext-files/actions/workflows/test.yml/badge.svg)](https://github.com/DataShades/ckanext-files/actions/workflows/test.yml)

# ckanext-files

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

Read the [documentation](https://datashades.github.io/ckanext-files/) for a full user guide.


## Quickstart

1. Install the extension
   ```sh
   pip install ckanext-files
   ```

1. Add `files` to the `ckan.plugins` setting in your CKAN
   config file.

1. Run DB migrations
   ```sh
   ckan db upgrade -p files
   ```

1. Configure storage

    ```ini
    ckanext.files.storage.default.type = files:fs
    ckanext.files.storage.default.path = /tmp/example
    ckanext.files.storage.default.create_path = true
    ```

1. Upload your first file

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


## Development

Install `dev` extras and nodeJS dependencies:

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

Run unittests:
```sh
pytest
```

Run frontend tests:
```sh
# start test server in separate terminal
make test-server

# run tests
npx cypress run
```

Run typecheck:
```sh
npx pyright
```


## License

[AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
