Create or Export Entities
With this Jupyter Notebook you can use all scripts to create and/or export the following Entities:
Inventories
Persons
Projects
Samples
Each Script requires the following arguments:
source_path: The path to the CSV or Excel file containing the entities you want to create in LOGS; default: None (nothing will be created)
target_path: The path where the CSV or Excel file with the exported entities should be stored; default: None (nothing will be exported)
export_format: Should be set to “.xlsx” if the export format should be an Excel table instead of a CSV file; default: “.csv”
To run this notebook you need a Jupyter kernel. A kernel is a Python environment that executes the code from your notebook. If no Jupyter kernel is set up yet, you can register one with the following command in the terminal:
python -m ipykernel install --user --name env_name --display-name "YourName"
import sys
sys.path.append("/home/zischka/Documents/logs-py-public-solutions/logs-py-solutions-public/pypi-package") # TODO: Remove after testing
Create or Export Persons
from LOGS_solutions.CreateExportEntities.CreateExportPersons.main import main, parse_args, validate_format
import sys
sys.argv = ["main.py",
"--source_path", r"CreateExportPersons/person_csv_files/person_account.csv",
"--target_path", r"CreateExportPersons/person_csv_files",
#"--export_format", ".xlsx",
]
args = parse_args()
validate_format(args)
main(args)
Create or Export Projects
from LOGS_solutions.CreateExportEntities.CreateExportProjects.main import main, parse_args, validate_format
import sys
sys.argv = ["main.py",
"--source_path", r"CreateExportProjects/project_csv_files/projects.csv",
"--target_path", r"CreateExportProjects/project_csv_files",
"--export_format", ".xlsx",
]
args = parse_args()
validate_format(args)
main(args)
Create or Export Samples
from LOGS_solutions.CreateExportEntities.CreateExportSamples.main import main, parse_args, validate_format
import sys
sys.argv = ["main.py",
"--source_path", r"CreateExportSamples/sample_csv_files/samples.csv",
"--target_path", r"CreateExportSamples/sample_csv_files",
"--export_format", ".xlsx",
]
args = parse_args()
validate_format(args)
main(args)