# CADA
[![Join the chat at https://gitter.im/etalab/cada][gitter-badge]][gitter-url]
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 3.7, MongoDB 4.1 and ElasticSearch 7.2.
The [ElasticSearch ICU Analysis plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/2.4/analysis-icu.html) is required.
You can install it with:
```console
elasticsearch-plugin install analysis-icu
```
## Installation
You can install Cada with pip:
```bash
$ pip install cada
```
You need to create the cada working directory, denoted by ``$HOME`` in this documentation:
```bash
$ 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](https://virtualenv.pypa.io/en/stable/).
```bash
$ 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](https://flask-mongoengine.readthedocs.org/en/latest/) 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](http://pythonhosted.org/flask-mail/#configuring-flask-mail) for more details.
### Sentry
There is an optional support for Sentry.
You need to install the required dependencies:
```bash
$ pip install raven[flask]
# Or to install it with cada
$ pip install cada[sentry]
```
You need to add your Sentry DSN to the configuration
```python
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:
```python
PIWIK_URL = 'piwik.mydomain.com'
PIWIK_ID = X
```
[circleci-url]: https://circleci.com/gh/etalab/cada
[circleci-badge]: https://circleci.com/gh/etalab/cada.svg?style=shield
[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/etalab/cada
## 1.0.1 (2024-04-26)
- Nothing yet
## 1.0.0 (2019-07-19)
- Add a `burnthemall` command [#25](https://github.com/etalab/cada.data.gouv.fr/pull/25)
- Use `tqdm` for major commands with loops [#25](https://github.com/etalab/cada.data.gouv.fr/pull/25)
- Python 3 [#28](https://github.com/etalab/cada.data.gouv.fr/pull/28)
- Elastic Search 7.2 [#29](https://github.com/etalab/cada.data.gouv.fr/pull/29)
- Mongo 4.1 [#29](https://github.com/etalab/cada.data.gouv.fr/pull/29)
- Improved pseudonymization [#32](https://github.com/etalab/cada.data.gouv.fr/pull/32)
- Display sample of api calls [#33](https://github.com/etalab/cada.data.gouv.fr/pull/33)
- Fix text query [#33](https://github.com/etalab/cada.data.gouv.fr/pull/33)
## 0.2.1 (2019-07-15)
- Fix advice part roman numerals handling [#13](https://github.com/etalab/cada/pull/13)
- Colorize advices labels [#14](https://github.com/etalab/cada/pull/14)
- Fixes about page [#11](https://github.com/etalab/cada/pull/11)
- Fix the cli encoding handling as well as some formatting issues [#18](https://github.com/etalab/cada/pull/18)
- Footer fixes (svg logo, alignments, https links) [#20](https://github.com/etalab/cada/pull/20)
- Upgrade jQuery, Bootstrap and Flatly assets and fixes responsive layout [#21](https://github.com/etalab/cada/pull/21)
- Fix unicode issue [#26](https://github.com/etalab/cada.data.gouv.fr/pull/26)
## 0.2.0 (2018-10-05)
- Upgrade stack to latest dependencies (Flask 1.0 with `flask.cli`, pytest...) [#6](https://github.com/etalab/cada/pull/6)
- Test and fix alert mails [#7](https://github.com/etalab/cada/pull/7)
- Added "about" page [#9](https://github.com/etalab/cada/pull/9)
- Handle type IV advices [#10](https://github.com/etalab/cada/pull/10)
## 0.1.0 (2014-04-14)
- Initial release
Raw data
{
"_id": null,
"home_page": "https://github.com/etalab/cada.data.gouv.fr",
"name": "cada",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "cada",
"author": "Axel Haustant",
"author_email": "axel@data.gouv.fr",
"download_url": null,
"platform": null,
"description": "# CADA\n\n\n[![Join the chat at https://gitter.im/etalab/cada][gitter-badge]][gitter-url]\n\n\nA simplistic interface to search and consult CADA advices.\n\nThis is the engine behind https://cada.data.gouv.fr.\n\n## Compatibility\n\nCADA has been tested on Python 3.7, MongoDB 4.1 and ElasticSearch 7.2.\n\nThe [ElasticSearch ICU Analysis plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/2.4/analysis-icu.html) is required.\n\nYou can install it with:\n\n```console\nelasticsearch-plugin install analysis-icu\n```\n\n## Installation\n\nYou can install Cada with pip:\n\n```bash\n$ pip install cada\n```\n\nYou need to create the cada working directory, denoted by ``$HOME`` in this documentation:\n\n```bash\n$ mkdir -p $HOME && cd $HOME\n$ vim cada.cfg # See configuration\n$ wget https://cada.data.gouv.fr/export -O data.csv\n$ cada load data.csv # Load initial data\n$ cada static # Optional: collect static assets for proper caching\n$ cada runserver\n```\n\n### local development environment\n\nPlease make sure you are in a clean [virtualenv](https://virtualenv.pypa.io/en/stable/).\n\n```bash\n$ git clone https://github.com/etalab/cada\n$ cd cada\n$ docker-compose up -d\n$ pip install -e .\n$ wget https://cada.data.gouv.fr/export -O data.csv\n$ cada load data.csv\n$ cada reindex\n$ cada runserver\n```\n\n\n## Configuration\nAll configuration is done through the ``cada.cfg`` file in ``$HOME``.\nIt's basically a Python file with constants defined in it:\n\n* ``SERVER_NAME``: the public server name. Mainly used in emails.\n* ``SECRET_KEY``: the common crypto hash. e.g. sessions. `openssl rand -hex 24` should be a good start.\n* ``ELASTICSEARCH_URL``: the ElasticSearch server URL in ``host:port`` format. Default to ``localhost:9200`` if not set\n* ``MONGODB_SETTINGS``: a dictionary to configure MongoDB. Default to ``{'DB': 'cada'}``. See [the official flask-mongoengine documentation](https://flask-mongoengine.readthedocs.org/en/latest/) for more details.\n\n### Mails\n\nMail server configuration is done through the following variables:\n\n* ``MAIL_SERVER``: SMTP server hostname. Default to ``localhost``.\n* ``MAIL_PORT``: SMTP server port. Default to ``25``.\n* ``MAIL_USE_TLS``: activate TLS. Default to ``False``.\n* ``MAIL_USE_SSL``: activate SSL. Default to ``False``.\n* ``MAIL_USERNAME``: optional SMTP server username.\n* ``MAIL_PASSWORD``: optional SMTP server password.\n* ``MAIL_DEFAULT_SENDER``: Sender email used for mailings. Default to ``cada@localhost``.\n* ``ANON_ALERT_MAIL``: destination mail for anonymisation alerts. Default to ``cada.alert@localhost``.\n\nSee the [official Flask-Mail documentation](http://pythonhosted.org/flask-mail/#configuring-flask-mail) for more details.\n\n### Sentry\n\nThere is an optional support for Sentry.\nYou need to install the required dependencies:\n\n```bash\n$ pip install raven[flask]\n# Or to install it with cada\n$ pip install cada[sentry]\n```\n\nYou need to add your Sentry DSN to the configuration\n\n```python\nSENTRY_DSN = 'https://xxxxx:xxxxxx@sentry.mydomain.com/id'\n```\n\n\n### Piwik\n\nThere is an optional Piwik support.\nYou simply need to add your Piwik server URL and your Piwik project ID to the configuration:\n\n```python\nPIWIK_URL = 'piwik.mydomain.com'\nPIWIK_ID = X\n```\n\n[circleci-url]: https://circleci.com/gh/etalab/cada\n[circleci-badge]: https://circleci.com/gh/etalab/cada.svg?style=shield\n[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg\n[gitter-url]: https://gitter.im/etalab/cada\n\n## 1.0.1 (2024-04-26)\n\n- Nothing yet\n\n## 1.0.0 (2019-07-19)\n\n- Add a `burnthemall` command [#25](https://github.com/etalab/cada.data.gouv.fr/pull/25)\n- Use `tqdm` for major commands with loops [#25](https://github.com/etalab/cada.data.gouv.fr/pull/25)\n- Python 3 [#28](https://github.com/etalab/cada.data.gouv.fr/pull/28)\n- Elastic Search 7.2 [#29](https://github.com/etalab/cada.data.gouv.fr/pull/29)\n- Mongo 4.1 [#29](https://github.com/etalab/cada.data.gouv.fr/pull/29)\n- Improved pseudonymization [#32](https://github.com/etalab/cada.data.gouv.fr/pull/32)\n- Display sample of api calls [#33](https://github.com/etalab/cada.data.gouv.fr/pull/33)\n- Fix text query [#33](https://github.com/etalab/cada.data.gouv.fr/pull/33)\n\n\n## 0.2.1 (2019-07-15)\n\n- Fix advice part roman numerals handling [#13](https://github.com/etalab/cada/pull/13)\n- Colorize advices labels [#14](https://github.com/etalab/cada/pull/14)\n- Fixes about page [#11](https://github.com/etalab/cada/pull/11)\n- Fix the cli encoding handling as well as some formatting issues [#18](https://github.com/etalab/cada/pull/18)\n- Footer fixes (svg logo, alignments, https links) [#20](https://github.com/etalab/cada/pull/20)\n- Upgrade jQuery, Bootstrap and Flatly assets and fixes responsive layout [#21](https://github.com/etalab/cada/pull/21)\n- Fix unicode issue [#26](https://github.com/etalab/cada.data.gouv.fr/pull/26)\n\n## 0.2.0 (2018-10-05)\n\n- Upgrade stack to latest dependencies (Flask 1.0 with `flask.cli`, pytest...) [#6](https://github.com/etalab/cada/pull/6)\n- Test and fix alert mails [#7](https://github.com/etalab/cada/pull/7)\n- Added \"about\" page [#9](https://github.com/etalab/cada/pull/9)\n- Handle type IV advices [#10](https://github.com/etalab/cada/pull/10)\n\n## 0.1.0 (2014-04-14)\n\n- Initial release\n\n",
"bugtrack_url": null,
"license": "AGPLv3+",
"summary": "Search and consult CADA advices",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/etalab/cada.data.gouv.fr"
},
"split_keywords": [
"cada"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83bcab2de55d93583613057422fc226c5659f8e81263472a7097e572086b17bc",
"md5": "c965683b017dbf797f0de389bc4aa0cc",
"sha256": "8f15ab72537f22c7e300666786a557771f55e18a65393dad049a40c0cf3e6f58"
},
"downloads": -1,
"filename": "cada-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c965683b017dbf797f0de389bc4aa0cc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 436381,
"upload_time": "2024-04-26T14:55:52",
"upload_time_iso_8601": "2024-04-26T14:55:52.264108Z",
"url": "https://files.pythonhosted.org/packages/83/bc/ab2de55d93583613057422fc226c5659f8e81263472a7097e572086b17bc/cada-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-26 14:55:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "etalab",
"github_project": "cada.data.gouv.fr",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "cada"
}