Skip to main content

Search and consult CADA advices

Project description

CADA

Join the chat at https://gitter.im/etalab/cada

A simplistic interface to search and consult CADA advices.

This is the engine behind https://cada.data.gouv.fr.

Compatibility

CADA has been tested on Python 2.7, MongoDB 3.2 and ElasticSearch 2.4.

The ElasticSearch ICU Analysis plugin is required.

You can install it with:

bin/plugin install analysis-icu

Installation

You can install Cada with pip:

$ pip install cada

You need to create the cada working directory, denoted by $HOME in this documentation:

$ mkdir -p $HOME && cd $HOME
$ vim cada.cfg  # See configuration
$ wget https://cada.data.gouv.fr/export -O data.csv
$ cada load data.csv  # Load initial data
$ cada static  # Optional: collect static assets for proper caching
$ cada runserver

local development environment

Please make sure you are in a clean virtualenv.

$ git clone https://github.com/etalab/cada
$ cd cada
$ docker-compose up -d
$ pip install -e .
$ wget https://cada.data.gouv.fr/export -O data.csv
$ cada load data.csv
$ cada reindex
$ cada runserver

Configuration

All configuration is done through the cada.cfg file in $HOME. It's basically a Python file with constants defined in it:

  • SERVER_NAME: the public server name. Mainly used in emails.
  • SECRET_KEY: the common crypto hash. e.g. sessions. openssl rand -hex 24 should be a good start.
  • ELASTICSEARCH_URL: the ElasticSearch server URL in host:port format. Default to localhost:9200 if not set
  • MONGODB_SETTINGS: a dictionary to configure MongoDB. Default to {'DB': 'cada'}. See the official flask-mongoengine documentation for more details.

Mails

Mail server configuration is done through the following variables:

  • MAIL_SERVER: SMTP server hostname. Default to localhost.
  • MAIL_PORT: SMTP server port. Default to 25.
  • MAIL_USE_TLS: activate TLS. Default to False.
  • MAIL_USE_SSL: activate SSL. Default to False.
  • MAIL_USERNAME: optional SMTP server username.
  • MAIL_PASSWORD: optional SMTP server password.
  • MAIL_DEFAULT_SENDER: Sender email used for mailings. Default to cada@localhost.
  • ANON_ALERT_MAIL: destination mail for anonymisation alerts. Default to cada.alert@localhost.

See the official Flask-Mail documentation for more details.

Sentry

There is an optional support for Sentry. You need to install the required dependencies:

$ pip install raven[flask]
# Or to install it with cada
$ pip install cada[sentry]

You need to add your Sentry DSN to the configuration

SENTRY_DSN = 'https://xxxxx:xxxxxx@sentry.mydomain.com/id'

Piwik

There is an optional Piwik support. You simply need to add your Piwik server URL and your Piwik project ID to the configuration:

PIWIK_URL = 'piwik.mydomain.com'
PIWIK_ID = X

Current (in progress)

  • Nothing yet

0.2.1 (2019-07-15)

  • Fix advice part roman numerals handling #13
  • Colorize advices labels #14
  • Fixes about page #11
  • Fix the cli encoding handling as well as some formatting issues #18
  • Footer fixes (svg logo, alignments, https links) #20
  • Upgrade jQuery, Bootstrap and Flatly assets and fixes responsive layout #21
  • Fix unicode issue #26

0.2.0 (2018-10-05)

  • Upgrade stack to latest dependencies (Flask 1.0 with flask.cli, pytest...) #6
  • Test and fix alert mails #7
  • Added "about" page #9
  • Handle type IV advices #10

0.1.0 (2014-04-14)

  • Initial release

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cada-0.2.2.dev82-py2-none-any.whl (436.3 kB view details)

Uploaded Python 2

File details

Details for the file cada-0.2.2.dev82-py2-none-any.whl.

File metadata

  • Download URL: cada-0.2.2.dev82-py2-none-any.whl
  • Upload date:
  • Size: 436.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.16

File hashes

Hashes for cada-0.2.2.dev82-py2-none-any.whl
Algorithm Hash digest
SHA256 abb5dd1a871e75ea502f88c1a1359481488819b4d07a865f263b074c34cda9b3
MD5 c71fd82769d38e02d17eda7369db4f78
BLAKE2b-256 ea5a6d552d9afb9136f8225f0cd9f9100d533c199605d7adeb56111dfb4a5a01

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