ckantools
Utilities and common methods for CKAN extensions.
Science Score: 52.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
-
○Committers with academic emails
-
✓Institutional organization owner
Organization naturalhistorymuseum has institutional domain (www.nhm.ac.uk) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Utilities and common methods for CKAN extensions.
Basic Info
- Host: GitHub
- Owner: NaturalHistoryMuseum
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Size: 266 KB
Statistics
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 3
- Releases: 10
Metadata Files
README.md
ckantools
Utilities and common methods for CKAN extensions.
Overview
A collection of methods, decorators, and anything else that might be useful.
ckantools is still very much in development, and is prone to frequent changes that may or may not work.
Installation
shell
pip install ckantools
Usage
See the full usage docs on readthedocs.io.
Actions
Use the @action decorator to add actions:
```python
logic/actions/module_name.py
from ckantools.decorators import action
@action(schema, helptext, get=False, *otherdecorators) def exampleaction(parameter1, parameter2): # ... ```
Or the @basic_action decorator if you want to load the action but don't want any of the other features (schema loading, auto auth, etc):
```python
from ckantools.decorators import basic_action
@basicaction def exampleaction(context, data_dict): # ... ```
And then load the action(s) in plugin.py:
```python
plugin.py
from .logic.actions import modulename from ckantools.loaders import createactions from ckan.plugins import implements, interfaces, SingletonPlugin
class ExamplePlugin(SingletonPlugin): implements(interfaces.IActions)
# IActions
def get_actions(self):
return create_actions(module_name)
```
Auth
Loading auth functions is similar to actions, i.e. use the @auth decorator.
```python
logic/auth/module_name.py
from ckantools.decorators import auth
@auth(anon=True) def exampleaction(context, datadict): return {'success': True}
@auth('exampleaction') def otheraction(context, datadict): # checks access to exampleaction first return {'success': True} ```
The auth functions can then be loaded in plugin.py:
```python
plugin.py
from .logic.auth import modulename from ckantools.loaders import createauth from ckan.plugins import implements, interfaces, SingletonPlugin
class ExamplePlugin(SingletonPlugin): implements(interfaces.IActions)
# IAuthFunctions
def get_auth_functions(self):
return create_auth(module_name)
```
Owner
- Name: Natural History Museum
- Login: NaturalHistoryMuseum
- Kind: organization
- Location: London
- Website: https://www.nhm.ac.uk
- Repositories: 171
- Profile: https://github.com/NaturalHistoryMuseum
Citation (CITATION.cff)
cff-version: 1.2.0
title: ckantools
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- name: Natural History Museum
city: London
country: GB
alias: NHM
email: data@nhm.ac.uk
repository-code: 'https://github.com/NaturalHistoryMuseum/ckantools'
abstract: Utilities for ckan extensions.
keywords:
- ckan
license: GPL-3.0-or-later
version: 0.3.2
GitHub Events
Total
- Push event: 2
- Pull request event: 2
- Create event: 4
Last Year
- Push event: 2
- Pull request event: 2
- Create event: 4
Committers
Last synced: about 3 years ago
All Time
- Total Commits: 57
- Total Committers: 2
- Avg Commits per committer: 28.5
- Development Distribution Score (DDS): 0.053
Top Committers
| Name | Commits | |
|---|---|---|
| Ginger Butcher | a****i@g****m | 54 |
| github-actions[bot] | g****]@u****m | 3 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 3
- Total pull requests: 17
- Average time to close issues: N/A
- Average time to close pull requests: 2 minutes
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 16
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: 8 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- alycejenni (2)
- jrdh (1)
Pull Request Authors
- alycejenni (17)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 2,718 last-month
- Total dependent packages: 21
- Total dependent repositories: 11
- Total versions: 13
- Total maintainers: 1
pypi.org: ckantools
Utilities for ckan extensions.
- Documentation: https://ckantools.readthedocs.io/
- License: GPL-3.0-or-later
-
Latest release: 0.4.2
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- commitizen-tools/commitizen-action master composite
- softprops/action-gh-release v1 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v3 composite
- connor-baer/action-sync-branch main composite
- ckan >2.9