__init__.py 5.69 KB
Newer Older
1 2 3 4 5
#!/usr/bin/env python3
from pathlib import Path

from flask import Flask

6
from validata_ui.validate_helper import ValidatorHelper
7 8 9 10 11

# Schemas settings
schemas_config = {
    "scdl-adresses": {
        "schema_json_url": "https://git.opendatafrance.net/scdl/adresses/raw/master/schema-scdl-adresses.json",
12
        "goodtables_checks_json_url": "https://git.opendatafrance.net/scdl/adresses/raw/master/goodtables-checks.json",
Pierre Dittgen's avatar
Pierre Dittgen committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
        "title": "Adresses locales",
        "description": "Liste des adresses locales d'une collectivité",
        "specurl": "http://www.opendatafrance.net/SCDL_Adresses_Locales",
        "docurl": "https://git.opendatafrance.net/validata/validata-doc/blob/master/static/schemas/scdl-adresses.md",
        "examples": [
            {
                "name": "Adresses fictives invalides",
                "url": "https://git.opendatafrance.net/scdl/adresses/raw/v1.1/exemples/exemple_invalide.csv"
            },
            {
                "name": "Adresses de Bayonne avril 2018",
                "url": "https://git.opendatafrance.net/scdl/adresses/raw/v1.1/exemples/20180424_bal_216401026.csv"
            }
        ]

28 29 30
    },
    "scdl-deliberations": {
        "schema_json_url": "https://git.opendatafrance.net/scdl/deliberations/raw/master/schema.json",
31
        "goodtables_checks_json_url": "https://git.opendatafrance.net/scdl/deliberations/raw/master/goodtables-checks.json",
Pierre Dittgen's avatar
Pierre Dittgen committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
        "title": "Délibérations",
        "description": "Liste des délibérations adoptées par une assemblée locale",
        "specurl": "http://www.opendatafrance.net/SCDL_Deliberations",
        "docurl": "https://git.opendatafrance.net/validata/validata-doc/blob/master/static/schemas/scdl-deliberations.md",
        "examples": [
            {
                "name": "Délibérations fictives valides",
                "url": "https://git.opendatafrance.net/scdl/deliberations/raw/v2.0/examples/Deliberations_ok.csv"
            },
            {
                "name": "Délibérations fictives invalides",
                "url": "https://git.opendatafrance.net/scdl/deliberations/raw/v2.0/examples/DeliberationsCindoc.csv"
            }
        ]

47 48
    },
    "scdl-marches-publics": {
49
        "schema_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/v1.2/schema.json",
50
        "goodtables_checks_json_url": "https://git.opendatafrance.net/scdl/marches-publics/raw/v1.2/goodtables-checks.json",
Pierre Dittgen's avatar
Pierre Dittgen committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64
        "title": "Marchés publics",
        "description": "Liste des marchés publics attribués par une collectivité",
        "specurl": "http://www.opendatafrance.net/SCDL_Marches_Publics",
        "docurl": "https://git.opendatafrance.net/validata/validata-doc/blob/master/static/schemas/scdl-marches.md",
        "examples": [
            {
                "name": "Marchés publics fictifs valides",
                "url": "https://git.opendatafrance.net/scdl/marches-publics/raw/master/exemples/exemple_marche_public.csv"
            },
            {
                "name": "Marchés publics fictifs invalides",
                "url": "https://git.opendatafrance.net/scdl/marches-publics/raw/master/exemples/exemple_marche_public_avec_erreurs.csv"
            }
        ]
65 66
    },
    "scdl-prenoms": {
67
        "schema_json_url": "https://github.com/Jailbreak-Paris/liste-prenoms-nouveaux-nes/raw/v1.1.3/prenom-schema.json",
68
        "goodtables_checks_json_url": "https://github.com/Jailbreak-Paris/liste-prenoms-nouveaux-nes/raw/v1.1.3/goodtables-checks.json",
Pierre Dittgen's avatar
Pierre Dittgen committed
69 70 71 72 73 74 75 76 77 78 79 80
        "title": "Prénoms des nouveaux-nés",
        "description": "Liste des prénoms des nouveaux-nés déclarés à l'état-civil",
        "specurl": "https://docs.google.com/document/d/1Vk0kpBw3MIocai9JqovLK2HxcUA_3QHnZicqxuOpcQ8/edit?usp=sharing",
        "docurl": "https://git.opendatafrance.net/validata/validata-doc/blob/master/static/schemas/scdl-prenoms.md",
        "examples": [
            {
                "name": "Prénoms des nouveaux-nés Digne-les-Bains 2017",
                "url": "https://raw.githubusercontent.com/CharlesNepote/liste-prenoms-nouveaux-nes/v1.1.1/DIGNE-PRENOMS-2017.csv"
            },
            {
                "name": "Prénoms des nouveaux-nés fictifs invalides",
                "url": "https://raw.githubusercontent.com/CharlesNepote/liste-prenoms-nouveaux-nes/v1.1.1/prenoms-nouveaux-nes.exemple.invalide.1.1.csv"
81 82 83 84 85
            },
            {
                "name": "Liste des prénoms donnés à Suresnes de 2010 à 2017 (plateforme OpenDataSoft)",
                "url": "https://data.opendatasoft.com/explore/dataset/prenoms@hauts-de-seine/download/?format=csv&timezone=Europe/Berlin&use_labels_for_header=true",
            },
Pierre Dittgen's avatar
Pierre Dittgen committed
86
        ]
87 88 89
    },
    "scdl-subventions": {
        "schema_json_url": "https://git.opendatafrance.net/scdl/subventions/raw/master/schema.json",
90
        "goodtables_checks_json_url": "https://git.opendatafrance.net/scdl/subventions/raw/master/goodtables-checks.json",
Pierre Dittgen's avatar
Pierre Dittgen committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104
        "title": "Subventions",
        "description": "Liste des subventions publiques attribuées par une collectivité",
        "specurl": "http://www.opendatafrance.net/SCDL_Subventions",
        "docurl": "https://git.opendatafrance.net/validata/validata-doc/blob/master/static/schemas/scdl-subventions.md",
        "examples": [
            {
                "name": "Subventions fictives invalides",
                "url": "https://git.opendatafrance.net/scdl/subventions/raw/v1.1/exemples/exemple_invalide.csv"
            },
            {
                "name": "Erreur de format (HTML au lieu de CSV)",
                "url": "https://git.opendatafrance.net/"
            }
        ]
105 106 107 108 109 110 111 112
    },
}
ValidatorHelper.init(schemas_config, Path('/tmp'))

# Flask things
app = Flask(__name__)
app.secret_key = 'MyPr3ci0u5$€cr€t'

113
import validata_ui.views