Nomenclature-api-module

January 4, 2022 · View on GitHub

pytest codecov

Flask (Python) module for Nomenclature API.

It is used in GeoNature but can also be used as a standalone API service to manage and returns various nomenclatures with their hierarchy.

Can be used as a standalone module or as git submodule.

Database

bib_nomenclatures_types contains nomenclatures types list.

id_typemnemoniquelabel_frlabel_endefinition_frdefinition_ensourcestatutmeta_create_datemeta_update_date
10TYP_DENBRType de dénombrementCounting typeNomenclature des types de dénombrement possibles (comptage, estimation...)Possible counting types (count, estimation...)SINPValidated2014-01-22 00:00:002015-12-16 00:00:00

t_nomenclatures contains all nomenclatures with their type, their parent (broader) and their hierarchy.

id_nomenclatureid_typecd_nomenclaturemnemoniquelabel_frdefinition_frsourcestatutid_broaderhierarchymeta_create_datemeta_update_dateactiv
10108TêtardTêtardLarve de batracienSINPValidé2010.0082015-07-29 00:00:002015-10-09 00:00:00true

Database usage

Get all nomenclatures of a type :

SELECT *
FROM nomenclatures.t_nomenclatures n
WHERE n.id_type = 100 AND n.active = true

Get all nomenclatures of a rank of a type :

SELECT *
FROM JAIPASCAPTE

Usage

API

  • Récupération des termes d'une nomenclature à partir de l'identifiant : /nomenclature/6[?regne=Animalia[&group2_inpn=Bivalves]] DEPRECIE

  • Récupération des termes d'une nomenclature à partir du code mnemonique :/nomenclature/STADE_VIE[?regne=Animalia[&group2_inpn=Bivalves]]

  • Récupération des termes d'un ensemble de nomenclature :

    • /nomenclatures?id_type=22&id_type=6[&regne=Animalia[&group2_inpn=Bivalves]] DEPRECIE
    • /nomenclatures?code_type=STADE_VIE&code_type=REF_HAB[&regne=Animalia[&group2_inpn=Bivalves]]

Interface d'administration des données

  • Accessible via l'url /nomenclatures/admin

Installation

Cloner repository and then launch in the folder:

python setup.py install