Metadata-Version: 2.1
Name: pypn-habref-api
Version: 0.3.0
Summary: Python lib related to Habref referential (INPN)
Home-page: https://github.com/PnX-SI/Habref-api-module
Maintainer: Parcs nationaux des Écrins et des Cévennes
Maintainer-email: geonature@ecrins-parcnational.fr
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Provides-Extra: tests
License-File: LICENSE

# Habref-api-module

[![pytest](https://github.com/PnX-SI/Habref-api-module/actions/workflows/pytest.yml/badge.svg)](https://github.com/PnX-SI/Habref-api-module/actions/workflows/pytest.yml)
[![codecov](https://codecov.io/gh/PnX-SI/Habref-api-module/branch/master/graph/badge.svg?token=YM6Q6SO4EI)](https://codecov.io/gh/PnX-SI/Habref-api-module)

API d'interrogation d'Habref : référentiel des typologies d’habitats et de végétation pour la France (https://inpn.mnhn.fr/telechargement/referentiels/habitats).

## Technologies

- Python 3
- Flask
- SQLAlchemy

## Installation

- Créer un virtualenv et l'activer :

```
virtualenv -p /usr/bin/python3 venv
source venv/bin/acticate
```

- Installer le module :

```
pip install https://github.com/PnX-SI/Habref-api-module/archive/<X.Y.Z>.zip
```

- Installer le schéma de base de données :

Le module est fourni avec une commande pour installer la base de données. Cette commande télécharge le référentiel Habref et créé un schéma de base de données nommé ``ref_habitats``.

```
# Depuis le virtualenv
install_habref_schema <database uri>
# Exemple :
# install_habref_schema "postgresql://geonatadmin:monpassachanger@localhost:5432/geonature2db"
```


