Change location of constants and dependencies
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
DATASETS = [
|
||||
"coronavirus-commercants-parisiens-livraison-a-domicile",
|
||||
"deconfinement-pistes-cyclables-temporaires",
|
||||
"deconfinement-parking-relais-doublement-des-places",
|
||||
]
|
||||
URL = "https://opendata.paris.fr/api/records/1.0/search/?dataset={}&q=&rows=-1"
|
||||
TEST_URL = "https://opendata.paris.fr/api/records/1.0/search/?dataset=deconfinement-pistes-cyclables-temporaires&rows=-1"
|
||||
FILES = {
|
||||
"deconfinement-pistes-cyclables-temporaires": "data/cycling-paths.json",
|
||||
"deconfinement-parking-relais-doublement-des-places": "data/relay-parking.json",
|
||||
"coronavirus-commercants-parisiens-livraison-a-domicile": "data/home-delivery.json",
|
||||
}
|
||||
COLUMNS = {
|
||||
"deconfinement-pistes-cyclables-temporaires": [
|
||||
"fields.geo_shape.coordinates",
|
||||
"fields.statut",
|
||||
"record_timestamp",
|
||||
"fields.complement",
|
||||
],
|
||||
"deconfinement-parking-relais-doublement-des-places": [
|
||||
"fields.societe",
|
||||
"fields.nb_places_dispositif_environ",
|
||||
"fields.parcs",
|
||||
"fields.geo_shape.coordinates",
|
||||
"fields.cp",
|
||||
"fields.ville",
|
||||
"fields.adresse",
|
||||
],
|
||||
"coronavirus-commercants-parisiens-livraison-a-domicile": [
|
||||
"fields.geo_shape.coordinates",
|
||||
"fields.adresse",
|
||||
"fields.code_postal",
|
||||
"fields.nom_du_commerce",
|
||||
"fields.type_de_commerce",
|
||||
"fields.site_internet",
|
||||
"record_timestamp",
|
||||
"fields.precisions",
|
||||
"fields.telephone",
|
||||
"fields.mail",
|
||||
],
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
from json import load
|
||||
from pandas import json_normalize, DataFrame
|
||||
from .constants import FILES, COLUMNS
|
||||
from constants import FILES, COLUMNS
|
||||
|
||||
|
||||
def open_json(dataset) -> dict:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from json import dump
|
||||
from requests import get
|
||||
from .constants import FILES, URL
|
||||
from constants import FILES, URL
|
||||
|
||||
|
||||
def format_url(dataset) -> str:
|
||||
|
||||
Reference in New Issue
Block a user