geonature.core.gn_meta.mtd

Submodules

Package Contents

Classes

CorAcquisitionFrameworkActor

The base class of the SQLAlchemy.Model declarative model class.

CorDatasetActor

The base class of the SQLAlchemy.Model declarative model class.

MTDInstanceApi

INPNCAS

Functions

insert_user_and_org(info_user)

associate_actors(actors, CorActor, pk_name, pk_value)

Associate actor and DS or AF according to CorActor value.

sync_af(af)

Will create or update a given AF according to UUID.

sync_ds(ds, cd_nomenclatures)

Will create or update a given DS according to UUID.

parse_acquisition_framework(ca)

parse_acquisition_framwork_xml(xml)

Parse an xml of AF from a string

parse_jdd_xml(xml)

Parse an xml of datasets from a string

add_unexisting_digitizer(id_digitizer)

Method to trigger global MTD sync.

process_af_and_ds(af_list, ds_list[, id_role])

Synchro AF<array>, Synchro DS<array>

sync_af_and_ds()

Method to trigger global MTD sync.

sync_af_and_ds_by_user(id_role)

Method to trigger MTD sync on user authent.

Attributes

config

logger

handler

formatter

geonature.core.gn_meta.mtd.insert_user_and_org(info_user)[source]
class geonature.core.gn_meta.mtd.CorAcquisitionFrameworkActor[source]

Bases: geonature.utils.env.DB.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

__tablename__ = 'cor_acquisition_framework_actor'
__table_args__
id_cafa
id_acquisition_framework
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
class geonature.core.gn_meta.mtd.CorDatasetActor[source]

Bases: geonature.utils.env.DB.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

__tablename__ = 'cor_dataset_actor'
__table_args__
id_cda
id_dataset
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
actor()[source]
display()[source]
geonature.core.gn_meta.mtd.config[source]
geonature.core.gn_meta.mtd.associate_actors(actors, CorActor, pk_name, pk_value)[source]

Associate actor and DS or AF according to CorActor value.

Parameters

actorslist

list of actors

CorActordb.Model

table model

pk_namestr

pk attribute name

pk_valuestr

pk value

geonature.core.gn_meta.mtd.sync_af(af)[source]

Will create or update a given AF according to UUID.

Paramètres:

af – dict AF infos

geonature.core.gn_meta.mtd.sync_ds(ds, cd_nomenclatures)[source]

Will create or update a given DS according to UUID. Only process DS if dataset’s cd_nomenclatures exists in ref_normenclatures.t_nomenclatures.

Paramètres:
  • ds – <dict> DS infos

  • cd_nomenclatures – <array> cd_nomenclature from ref_normenclatures.t_nomenclatures

geonature.core.gn_meta.mtd.parse_acquisition_framework(ca)[source]
geonature.core.gn_meta.mtd.parse_acquisition_framwork_xml(xml)[source]

Parse an xml of AF from a string Return:

dict: a dict of the parsed xml

geonature.core.gn_meta.mtd.parse_jdd_xml(xml)[source]

Parse an xml of datasets from a string Return:

list: a list of dict of the JDD in the xml

geonature.core.gn_meta.mtd.logger[source]
geonature.core.gn_meta.mtd.handler[source]
geonature.core.gn_meta.mtd.formatter[source]
class geonature.core.gn_meta.mtd.MTDInstanceApi(api_endpoint, instance_id, id_role=None)[source]
af_path = '/mtd/cadre/export/xml/GetRecordsByInstanceId?id={ID_INSTANCE}'[source]
ds_path = '/mtd/cadre/jdd/export/xml/GetRecordsByInstanceId?id={ID_INSTANCE}'[source]
ds_user_path = '/mtd/cadre/jdd/export/xml/GetRecordsByUserId?id={ID_ROLE}'[source]
single_af_path = '/mtd/cadre/export/xml/GetRecordById?id={ID_AF}'[source]
_get_xml_by_url(url)[source]
_get_xml(path)[source]
_get_af_xml()[source]
get_af_list()[source]
_get_ds_xml()[source]
get_ds_list()[source]
get_ds_user_list()[source]
get_user_af_list(af_uuid)[source]
class geonature.core.gn_meta.mtd.INPNCAS[source]
base_url[source]
user[source]
password[source]
id_search_path = 'rechercheParId/{user_id}'[source]
classmethod _get_user_json(user_id)[source]
classmethod get_user(user_id)[source]
geonature.core.gn_meta.mtd.add_unexisting_digitizer(id_digitizer)[source]

Method to trigger global MTD sync.

Paramètres:

id_digitizer – as id role from meta info

geonature.core.gn_meta.mtd.process_af_and_ds(af_list, ds_list, id_role=None)[source]

Synchro AF<array>, Synchro DS<array>

Paramètres:
  • af_list – list af

  • ds_list – list ds

  • id_role – use role id pass on user authent only

geonature.core.gn_meta.mtd.sync_af_and_ds()[source]

Method to trigger global MTD sync.

geonature.core.gn_meta.mtd.sync_af_and_ds_by_user(id_role)[source]

Method to trigger MTD sync on user authent.