5 Commits

Author SHA1 Message Date
Tobias Quadfasel
61b238e87b feat(add-data): Add script to insert prepped data into database
The script `insert_sql.py` uses `pyodbc` to connect to the Azure SQL
database, loads the data from the preprocessed `customers.json` file,
formats them and then inserts them into the created table schema.
2024-08-31 14:39:21 +02:00
Tobias Quadfasel
66d1eec875 feat(add-data): Add script for SQL schema initialization
Since we are working with an Azure SQL database, we need to fill the
generated customer data in a fitting schema. The schema will be
described in more detail in an updated README file later.

The added script uses `pyodbc` to connect to the database and create the
tables. This requires a connection string, which will not be checked out
to this repo for security reasons and must be obtained separately.

Additionally, a script `test_sql_connection.py` is added with this
commit, which is a simple utility to test the `pyodbc` connection.
2024-08-31 14:28:44 +02:00
Tobias Quadfasel
3a4bc53dcc feat(add-data): Add script to generate costumers from base data
Add `data_preparation/generate_customers.py`, a script that takes the
`base_data.json` file generated by `get_base_data.py` and randomly
samples a given number of customers.

To simplify things, each customer is assigned exactly one gas and one
electricity meter and each of them is read between 1 and 10 times.

The full data including meters, meter readings and dates as well as
customers and addresses is stored in a final JSON file named
`customers.json`.
2024-08-31 14:23:50 +02:00
Tobias Quadfasel
596893edf3 feat(add-data): Add general config and utilities for data prep 2024-08-31 14:15:53 +02:00
Tobias Quadfasel
49ff1bbfec feat(add-data): Add script for acquiring base data files
The script `get_base_data` takes the raw datafiles (such as `names.txt`)
and formats them in a common JSON file, which can be later used to
randomly generate customer and meter readings data.

Additionally, the script filters all eligible zip codes an approximate
avacon netz service area and provides some additional information for
them.

An example output file, `base_data.json` has been added to the repo in
a previous commit.
2024-08-31 14:10:56 +02:00