Skip to main content

No project description provided

Project description

Tests

ckanext-toolbelt

Collection of different entities that are useful sometimes.

Requirements

CKAN version Compatible?
2.8 and earlier no
2.9 yes

Decorators (ckanext.toolbelt.decorators)

Collector

Creates a decorator that can collect functions and return them in a dictionary. Originally designed for actions, auth functions, validators and helpers.

Can be used as decorator. Call Collector.get_collection when you need dictionary with names of helpers mapped to helper functions

helper = Collector()

@helper
def func():
	pass

###
# ITemplateHelpers
def get_helpers(self):
	return helper.get_collection()

Collector.split allows you to visually separate decorator from the method, that returns collection

action, get_actions = Collector().split()

@action
def func():
	pass

###
# IActions
def get_actions(self):
	return get_actions()

If you want your functions prefixed by the plugin name, provide this prefix as a first argument to the Collector's constructor. If particular items must remain unprefixed, you can specify what name to use, when decorating an item

validator, get_validators = Collector("toolbelt").split()

@validator
def func():
	"""I am toolbelt_func
	"""
	pass

@validator("custom_func")
def func():
	"""I am custom_func
	"""
	pass

###
# IValidators
def get_validators(self):
	return get_validators()

CLI

As soon as you've installed ckanext-toolbelt, it will register ckan toolbelt route for CLI. You don't have to add toolbelt to the list of enabled plugins. But depending on the list of enabled plugins, extra subroutes will be added to the ckan toolbelt route.

Below are commands that do not depend on ckanext-toolbelt plugins. They are available all the time or when some particular requirement is satisfied(in that case, requirement itself is mentioned)

make deps-makefile    Print to stdout basic Makefile for ckan-deps-installer

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext-toolbelt-0.0.6.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

ckanext_toolbelt-0.0.6-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-toolbelt-0.0.6.tar.gz.

File metadata

  • Download URL: ckanext-toolbelt-0.0.6.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for ckanext-toolbelt-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6210fdbea284e965769ac904da2e483beb6c6d13c60223b2ac8b0bb7866405d8
MD5 cc7583a581ba9aa0fda7c871ae0fc07a
BLAKE2b-256 5cbed2b0582e7d793279e3db4d1dbc17725428192fc62582bd4e7efb42bea090

See more details on using hashes here.

Provenance

File details

Details for the file ckanext_toolbelt-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: ckanext_toolbelt-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for ckanext_toolbelt-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 aef9d7922b1f80ae17f0c49d8df19eeb1b3de442c4b0ec0dae4aa55be0f3a5d4
MD5 9425c9d1527616295ae0fcb0a859857a
BLAKE2b-256 9f7aedebc75d452f41b9222daf9f317e45cfa8a106b562a6383c867a10d86263

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page