Skip to main content

CKAN Extension to manage data.gov theme

Project description

# ckanext-datagovtheme

[![Github Actions](https://github.com/GSA/ckanext-datagovtheme/actions/workflows/ckan.yml/badge.svg)](https://github.com/GSA/ckanext-datagovtheme/actions) [![PyPI version](https://badge.fury.io/py/ckanext-datagovtheme.svg)](https://badge.fury.io/py/ckanext-datagovtheme)

Data.gov theme, branding, and UI customizations for [catalog.data.gov](https://catalog.data.gov/) as a [CKAN](https://ckan.org/) extension.

## Features

_TODO document these better._

## Usage

### Requirements

_TODO: document how ckanext-datagovtheme interacts with third-party extensions, maybe in the context of Features above._

These extensions are required.

Additionally, ckanext-datagovtheme has “weak” dependencies on these extensions. The dependency might be on templates, template helpers, or other functionality.

This extension is compatible with these versions of CKAN.

CKAN version | Compatibility ———— | ————- <=2.8 | no 2.9 | 0.1.27 (last supported) 2.10 | >=0.2.0

### Configuration

[Optional] ckanext.datagovtheme.js_recent_view = true

This defaults to false. If displaying the recent view count slows down page loading, the optional parameter can be set to true to make the recent view count an AJAX call, improving page loading speed. If the recent view count information (package[‘tracking_summary’]) is already present, the AJAX call is disabled to reduce overhead. Therefore, the built-in recent view count rendering must be disabled for this mechanism to take effect. For catalog.data.gov, it means set setting ckanext.datagovcatalog.add_packages_tracking_info to false.

TODO: re-evaluate the need for this customization after ckan 2.11 release, as described in ticket https://github.com/GSA/data.gov/issues/4798.

## 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).

Clean up the environment.

$ make down

Open a shell to run commands in the container.

$ docker-compose exec ckan 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/).

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

#### Common issues

We have seen issues with datagovtheme not installed. If this is the case, run python setup.py develop in the container.

### Matrix builds

The development environment drops as many dependencies as possible. It is not meant to have feature parity with [GSA/catalog.data.gov](https://github.com/GSA/catalog.data.gov/) or [GSA/inventory-app](https://github.com/GSA/inventory-app/). Tests should mock external dependencies where possible.

In order to support multiple versions of CKAN, or even upgrade to new versions of CKAN, we support development and testing through the CKAN_VERSION environment variable.

$ make CKAN_VERSION=2.10.1 test

Variable | Description | Default ——– | ———– | ——- CKAN_VERSION | Version of CKAN to use. | 2.10.1 COMPOSE_FILE | docker-compose service description file. | docker-compose.yml

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_datagovtheme-0.3.3.tar.gz (11.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_datagovtheme-0.3.3-py3-none-any.whl (11.6 MB view details)

Uploaded Python 3

File details

Details for the file ckanext_datagovtheme-0.3.3.tar.gz.

File metadata

  • Download URL: ckanext_datagovtheme-0.3.3.tar.gz
  • Upload date:
  • Size: 11.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ckanext_datagovtheme-0.3.3.tar.gz
Algorithm Hash digest
SHA256 78cfd5f4a0a97a994c62c876355de49e009fa65bf420cd470b0d8bbbd98f5fc5
MD5 5a9067471a194057422ed7ab5553bfe4
BLAKE2b-256 b95550247ec92c41503e65620ae2e2f1d73e46efea152794afccd13206860115

See more details on using hashes here.

File details

Details for the file ckanext_datagovtheme-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_datagovtheme-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1a9504e9cd029ec9b08163ceb5af5c61e01ccd9caa26c151928e65145a26b108
MD5 bc240aee46c01c68bd551be9eeea563a
BLAKE2b-256 882ddd19e6879bb24e2f792bf19fee138a3101a96cc92ab9d221506317e9842d

See more details on using hashes here.

Supported by

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