Skip to main content

A CKAN extension to display metrics about datasets.

Project description

# ckanext-metrics_dashboard

[![GitHub Actions](https://github.com/GSA/ckanext-metrics_dashboard/actions/workflows/deploy.yml/badge.svg)](https://github.com/GSA/ckanext-metrics_dashboard/actions/workflows/publish.yml) [![PyPI version](https://badge.fury.io/py/ckanext-metrics_dashboard.svg)](https://badge.fury.io/py/ckanext-metrics_dashboard)

A CKAN extension to display metrics about harvest sources.

## Features

  • ${CKAN_URL}/report/metrics_dashboard

    • Displays a summary report of number of datasets and harvest sources for each organization

  • ${CKAN_URL}/report/metrics_dashboard/{org}

    • Displays a detailed report of each harvest source in an organization, where org is the ID of your organization

  • CSV Export: A comprehensive table of all harvest sources

  • JSON Export: CSV raw data plus a second key table_data_by_org that includes the same data grouped by organization

This extension is compatible with these versions of CKAN.

CKAN version | Compatibility ———— | ————- <=2.8 | ??? 2.9 | yes (with ckanext-datagovtheme==0.1.*) 2.10 | yes (with ckanext-datagovtheme>=0.2.1)

## Usage

### Requirements

These extensions are required for metrics_dashboard:

## Development

### Requirements

  • GNU Make

  • Docker Compose

### Setup

Build the docker containers. You’ll want to do this anytime the dependencies change (requirements.txt, dev-requirements.txt).

$ make build

Start the containers.

$ make up

CKAN will start at [localhost:5000](http://localhost:5000).

Start the containers, but don’t start ckan. More debugging instructions [here](#Debugging)

$ make debug

Open a shell to run commands in the container.

$ docker-compose exec app bash

If you’re unfamiliar with docker-compose, see our [cheatsheet](https://github.com/GSA/datagov-deploy/wiki/Docker-Best-Practices#cheatsheet) and the [official docs](https://docs.docker.com/compose/reference/).

Clean the containers and remove the data.

$ make clean

For additional make targets, see the help.

$ make help

### Testing

They follow the guidelines for [testing CKAN extensions](https://docs.ckan.org/en/2.8/extensions/testing-extensions.html#testing-extensions).

To run the extension tests:

$ make test

Lint your code.

$ make lint

### Debugging

We have not determined a good way for most IDE native debugging, however you can use the built in Python pdb debugger. Simply run make debug, which will run docker with an interactive shell. Add import pdb; pdb.set_trace() anywhere you want to start debugging, and if the code is triggered you should see a command prompt waiting in the shell. Use a pdb cheat sheet when starting to learn like this.

When you edit/add/remove code, the server is smart enough to restart. If you are editing logic that is not part of the webserver (ckan command, etc) then you should be able to run the command after edits and get the same debugger prompt.

  1. Launch the containers with make debug

  2. Start the CKAN process by running ./start_ckan_development.sh

  3. Add import ibdb; ipdb.set_trace() at the point you wish to debug.

  4. Invoke that code to hit that breakpoint.

Project details


Download files

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

Source Distribution

ckanext-metrics_dashboard-0.1.6.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

ckanext_metrics_dashboard-0.1.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-metrics_dashboard-0.1.6.tar.gz.

File metadata

File hashes

Hashes for ckanext-metrics_dashboard-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ef4893ca943d6bed5653c5e602951d3078c26310c2ee82816a466753df2b7a35
MD5 38b0b4ff7ee4d7e6ace2a74ec58e800a
BLAKE2b-256 51d8d1c5bef27c154e7716db055b1462f0e51ea6cc7858e968770a7367687106

See more details on using hashes here.

File details

Details for the file ckanext_metrics_dashboard-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_metrics_dashboard-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 084c671d91d287e0d4bab7838e2762018087196f2427e2d1de9adea08eca2c23
MD5 a49c89597fcd2a5a904781f8de4c5ac4
BLAKE2b-256 683934d880d1b1eec7c5c476fe8a4f6100d662261c83c072e20192447aa074fd

See more details on using hashes here.

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