Exemplo n.º 1
0
from pathlib import Path
from timeit import default_timer

# 3rd party
from dotenv import load_dotenv

# Isogeo
from isogeo_pysdk import Isogeo, IsogeoChecker

# submodules
from isogeo_migrations_toolbelt import MetadataDuplicator, BackupManager

# load dijon.env file
load_dotenv("env/rouen.env", override=True)

checker = IsogeoChecker()

if __name__ == "__main__":
    # logs
    logger = logging.getLogger()
    # ------------ Log & debug ----------------
    logging.captureWarnings(True)
    logger.setLevel(logging.INFO)
    # logger.setLevel(logging.INFO)

    log_format = logging.Formatter("%(asctime)s || %(levelname)s "
                                   "|| %(module)s - %(lineno)d ||"
                                   " %(funcName)s || %(message)s")

    # debug to the file
    log_file_handler = RotatingFileHandler(
Exemplo n.º 2
0
# Standard Library
import csv
from os import environ
from pathlib import Path
from datetime import datetime

# 3rd party
from dotenv import load_dotenv

# Isogeo
from isogeo_pysdk import (
    Isogeo,
    IsogeoChecker,
)

checker = IsogeoChecker()
# load .env file
load_dotenv("./env/lille.env", override=True)

if __name__ == "__main__":

    # ############################### MIGRATING & SAVING ###############################
    # API client instanciation
    isogeo = Isogeo(
        client_id=environ.get("ISOGEO_API_USER_LEGACY_CLIENT_ID"),
        client_secret=environ.get("ISOGEO_API_USER_LEGACY_CLIENT_SECRET"),
        auth_mode="user_legacy",
        auto_refresh_url="{}/oauth/token".format(environ.get("ISOGEO_ID_URL")),
        platform=environ.get("ISOGEO_PLATFORM", "qa"),
    )
    isogeo.connect(
Exemplo n.º 3
0
# submodules
from isogeo_migrations_toolbelt import BackupManager, MetadataDuplicator

# #############################################################################
# ######## Globals #################
# ##################################

# environment vars
load_dotenv(".env", override=True)
# load_dotenv("prod.env", override=True)

# ignore warnings related to the QA self-signed cert
if environ.get("ISOGEO_PLATFORM").lower() == "qa":
    urllib3.disable_warnings()

checker = IsogeoChecker()

# ##############################################################################
# ##### Stand alone program ########
# ##################################
if __name__ == "__main__":
    # logs
    logger = logging.getLogger()
    # ------------ Log & debug ----------------
    logging.captureWarnings(True)
    logger.setLevel(logging.DEBUG)
    # logger.setLevel(logging.INFO)

    log_format = logging.Formatter("%(asctime)s || %(levelname)s "
                                   "|| %(module)s - %(lineno)d ||"
                                   " %(funcName)s || %(message)s")
Exemplo n.º 4
0
from pathlib import Path
from timeit import default_timer

# 3rd party
from dotenv import load_dotenv

# Isogeo
from isogeo_pysdk import Isogeo, IsogeoChecker

# submodules
from isogeo_migrations_toolbelt import MetadataDuplicator, BackupManager

# load .env file
load_dotenv("./env/mamp.env", override=True)

checker = IsogeoChecker()

if __name__ == "__main__":
    # logs
    logger = logging.getLogger()
    # ------------ Log & debug ----------------
    logging.captureWarnings(True)
    logger.setLevel(logging.INFO)
    # logger.setLevel(logging.INFO)

    log_format = logging.Formatter("%(asctime)s || %(levelname)s "
                                   "|| %(module)s - %(lineno)d ||"
                                   " %(funcName)s || %(message)s")

    # debug to the file
    log_file_handler = RotatingFileHandler(
Exemplo n.º 5
0
from timeit import default_timer
import datetime

# 3rd party
from dotenv import load_dotenv

# Isogeo
from isogeo_pysdk import Isogeo, IsogeoChecker

# submodules
from isogeo_migrations_toolbelt import MetadataDuplicator, BackupManager

# load dijon.env file
load_dotenv("env/normandie.env", override=True)

checker = IsogeoChecker()

if __name__ == "__main__":
    # logs
    logger = logging.getLogger()
    # ------------ Log & debug ----------------
    logging.captureWarnings(True)
    logger.setLevel(logging.INFO)
    # logger.setLevel(logging.INFO)

    log_format = logging.Formatter("%(asctime)s || %(levelname)s "
                                   "|| %(module)s - %(lineno)d ||"
                                   " %(funcName)s || %(message)s")

    # debug to the file
    log_file_handler = RotatingFileHandler(
Exemplo n.º 6
0
from time import sleep
from timeit import default_timer

# 3rd party
import urllib3
from dotenv import load_dotenv
from openpyxl import load_workbook

# Isogeo
from isogeo_pysdk import Isogeo, IsogeoChecker, Metadata

# #############################################################################
# ######## Globals #################
# ##################################

checker = IsogeoChecker()

# logs
logger = logging.getLogger(__name__)
logging.captureWarnings(True)
logger.setLevel(logging.DEBUG)

# paths
path_input_excel = Path(
    Path(__file__).parent, "_isogeo_complet_ready_migration.xlsx")

# -- SOURCE PARAMS
group = ""
platform = "qa"
load_dotenv("{}.env".format(platform), override=True)  # environment vars
Exemplo n.º 7
0
# ########## Libraries #############

# Standard Library
import json
from os import environ

# 3rd party
from dotenv import load_dotenv

# Isogeo
from isogeo_pysdk import (
    Isogeo,
    IsogeoChecker,
)

checker = IsogeoChecker()
# load .env file
load_dotenv("./env/dijon.env", override=True)

if __name__ == "__main__":

    # ############################### MIGRATING & SAVING ###############################
    # API client instanciation
    isogeo = Isogeo(
        client_id=environ.get("ISOGEO_API_USER_LEGACY_CLIENT_ID"),
        client_secret=environ.get("ISOGEO_API_USER_LEGACY_CLIENT_SECRET"),
        auth_mode="user_legacy",
        auto_refresh_url="{}/oauth/token".format(environ.get("ISOGEO_ID_URL")),
        platform=environ.get("ISOGEO_PLATFORM", "qa"),
    )
    isogeo.connect(