geonature.core.imports.config_schema

Spécification du schéma toml des paramètres de configurations

Attributes

Classes

ImportConfigSchema

Base schema class with which to define schemas.

Module Contents

geonature.core.imports.config_schema.DEFAULT_LIST_COLUMN[source]
geonature.core.imports.config_schema.UPLOAD_DIRECTORY = 'upload'[source]
geonature.core.imports.config_schema.IMPORTS_SCHEMA_NAME = 'gn_imports'[source]
geonature.core.imports.config_schema.PREFIX = 'gn_'[source]
geonature.core.imports.config_schema.SRID[source]
geonature.core.imports.config_schema.ENCODAGE = ['UTF-8'][source]
geonature.core.imports.config_schema.MAX_FILE_SIZE = 1000[source]
geonature.core.imports.config_schema.ALLOWED_EXTENSIONS = ['.csv'][source]
geonature.core.imports.config_schema.DEFAULT_COUNT_VALUE = 1[source]
geonature.core.imports.config_schema.ALLOW_VALUE_MAPPING = True[source]
geonature.core.imports.config_schema.DEFAULT_OBSERVER_FIELD_SEPARATORS = [';', ',', '|'][source]
geonature.core.imports.config_schema.DEFAULT_VALUE_MAPPING_ID = 3[source]
geonature.core.imports.config_schema.DEFAULT_VALUE_MAPPINGS[source]
geonature.core.imports.config_schema.DEFAULT_RANK = 'regne'[source]
class geonature.core.imports.config_schema.ImportConfigSchema(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: marshmallow.types.UnknownOption | None = None)[source]

Bases: marshmallow.Schema

Base schema class with which to define schemas.

Example usage:

import datetime as dt
from dataclasses import dataclass

from marshmallow import Schema, fields


@dataclass
class Album:
    title: str
    release_date: dt.date


class AlbumSchema(Schema):
    title = fields.Str()
    release_date = fields.Date()


album = Album("Beggars Banquet", dt.date(1968, 12, 6))
schema = AlbumSchema()
data = schema.dump(album)
data  # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
Paramètres:
  • only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.

  • exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.

  • many – Should be set to True if obj is a collection so that the object will be serialized to a list.

  • load_only – Fields to skip during serialization (write-only fields)

  • dump_only – Fields to skip during deserialization (read-only fields)

  • partial – Whether to ignore missing fields and not require any fields declared. Propagates down to Nested fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.

  • unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.

Modifié dans la version 3.0.0: Remove prefix parameter.

Modifié dans la version 4.0.0: Remove context parameter.

LIST_COLUMNS_FRONTEND[source]
PREFIX[source]
SRID[source]
ENCODAGE[source]
MAX_FILE_SIZE[source]
MAX_ENCODING_DETECTION_DURATION[source]
ALLOWED_EXTENSIONS[source]
DEFAULT_COUNT_VALUE[source]
ALLOW_VALUE_MAPPING[source]
ALLOW_USER_MAPPING[source]
DEFAULT_VALUE_MAPPING_ID[source]
DEFAULT_VALUE_MAPPINGS[source]
FILL_MISSING_NOMENCLATURE_WITH_DEFAULT_VALUE[source]
DISPLAY_MAPPED_VALUES[source]
PER_DATASET_UUID_CHECK[source]
CHECK_PRIVATE_JDD_BLURING[source]
CHECK_REF_BIBLIO_LITTERATURE[source]
CHECK_EXIST_PROOF[source]
DEFAULT_GENERATE_MISSING_UUID[source]
DEFAULT_RANK[source]
ID_AREA_RESTRICTION[source]
ID_LIST_TAXA_RESTRICTION[source]
MODULE_URL[source]
DATAFRAME_BATCH_SIZE[source]
EXPORT_REPORT_PDF_FILENAME[source]
INSERT_BATCH_SIZE[source]
CSV_FIELD_SIZE_LIMIT[source]
OBSERVER_FIELD_SEPARATORS[source]