Modélisation et réconciliation de filiéres

Outil batch

Submodules

su-model-optimisation.datain module

Integration of data from excel files into the database.

This module is dedicated to the integration of data from excel files into the database.

Data that can be transfered with this module :
  • sheets « data » and « minmax » of a regular project input file (for example bois_fr_1_1.xlsx)

  • sheets « proxis » and « data » of a proxy input file (for example bois_data.xlsx)

  • sheet « mysheet » from a file « myfile.xlsx » to a table « mytable » of the database

The module can be used with a maximum of 6 arguments :
  • The first one called « –input_file » is mandatory. It specifies the name of the input file and has to be an excel file (*.xls or *.xlsx).

  • « –tab_data » : can be used to specify the name of the sheet containing basic data (for example sheet « données FR » of exemple file tuto_fr.xlsx).

  • « –tab_minmax » : can be used to specify the name of the sheet containing min/max values.

  • « –tab_proxy » : can be used to specify the name of the sheet containing the list of the proxys.

  • « –bdd_table » and « –tab_open » : can be used to fill in the database the table specified by bdd_table with data found in tab_open sheet.

Specific behavior of the module :
  • Used without specifying « –tab_data » argument will lead the module to search Data sheet among this list of possible names : “data”, “données FR”, “données REG”, “data FR”. If it find such a sheet it will copy its data in the « Datas » table of the database.

  • Used without « –tab_minmax » argument will lead to the same behaviour but for MinMax sheet and « MinMaxs » table of the database. The list of possible sheet names will be : “min_max”, “min max FR”, “min max REG”

  • Used without « –tab_proxy » argument will do the same for the table « Proxys » and sheet name : “proxis”.

Notes :
  • The module checks by itself if the input file has a correct extension (*.xls or *.xlsx).

  • When used with one of the 3 arguments « –tab_data », « –tab_minmax » or « –tab_proxy », the module checks by itself if the specified sheet name is really a sheet of the input file.

  • By default (if the module is used without arguments about sheets names) if the input file is a « proxy » file the module copy data of the sheets “proxis” and “data” into the tables « Datas » and « Proxys » of the database. If the input file is a data model file, the module will try to copy datas from sheets “data” and “minmax” into tables « Datas » and « MinMaxs » of the database. The argument « null » can be used to neutralize one of these importations.

  • Parameters « –bdd_table » and « –tab_open » have to be used simultaneously.

Examples :
>>> python.exe datain.py --input_file example_reg.xlsx

Will copy values of sheets “données REG” and “min max REG” into tables “Datas” and “MinMaxs” of the database.

>>> python.exe datain.py --input_file bois_data.xlsx

Will copy values of sheets “proxis” and “data FR” into tables “Proxys” and “Datas” of the database.

>>> python.exe datain.py --input_file bois_data.xlsx --tab_data null

Will copy datas from the sheet “proxis” into the “Proxys” table of the database and will ignore datas from the sheet “data FR”.

>>> python.exe datain.py --input_file bois_fr_1.1.xlsx --tab_minmax null

Will copy datas from the sheet “données FR” into the “Datas” table of the database and will ignore datas from the sheet “min max FR”.

>>> python.exe datain.py --input_file somefile.xlsx --tab_data sheettdata --tab_minmax sheetmima

Will copy datas from sheets “sheetdata” and “sheetmima” into tables “Datas” and “MinMaxs” of the database.

>>> python.exe datain.py --input_file id_comm_aura.xlsx --bdd_table Geographics --tab_open id_comm

Will copy values from sheet “id_comm” of the input file “id_comm_aura.xlsx” to fill the table “Geographics” of the database.

datain.chk_args()[source]

Checks arguments passed to the module.

This function checks if arguments passed to the module are consistent. If this is not the case the function prints an help message and interrupts the code.

Return : a list of input file, name of the data sheet, name of the min_max sheet, name of the proxy sheet, name of the database table to fill, name of additionnal sheet.

su-model-optimisation.io_aura module

This module is dedicated to the conversion from AURA-EE excel geographic file to internal dictionnary structure and record it in db

io_aura.xl_import_geo_aura(xl_fi, stab, def_val, js_tab, js_di)[source]

Import informations from workbook tab called id_comm if it exists - xl_fi : workbook file name - stab : name of the workbook sheet to work on - def_val : dictionnary of default values (default columns values of excel sheet) - js_tab : name of the main JSon dictionnary key for this entry - js_di : dictionnary with informations to convert in JSon format

su-model-optimisation.main module

main.check_args()[source]

This function controls parameters passed to the program

su-model-optimisation.proxyin module

su-model-optimisation.tests module

class tests.ConfigFilesTests(methodName='runTest')[source]

Bases : unittest.case.TestCase

test_config_json()[source]
test_config_txt()[source]

Outil web

sumodelapp.server.views.index()[source]
sumodelapp.server.views.optimize()[source]
sumodelapp.server.views.optimize_prod_clean()[source]
sumodelapp.server.views.optimize_prod_init()[source]
sumodelapp.server.views.optimize_prod_launch()[source]
sumodelapp.server.views.optimize_prod_process()[source]
sumodelapp.server.views.optimize_retrieves_result()[source]
sumodelapp.server.views.upload_exemple()[source]