Skip to content

Latest commit

 

History

History

README.md

database-initialization

This repository contains the scripts to initialize the database from the json file mentioned in the data folder.

Getting started

Install for development for the first time:

make install

This will install the dependencies and the package in editable mode. This will also install the sail-client dependency in the virtul environment. The virtual environment is created in the .venv folder and can be activated using:

source $(poetry env info --path)/bin/activate

or

source .venv/bin/activate

To exit the virtual environment:

deactivate

Build the tool

poetry build

This will create a wheel file in the dist folder which can be installed using pip.

Install the tool

pip install dist/database-initialization-0.1.0-py3-none-any.whl

Run the tool

database-initialization --hostname http://127.0.0.1:8000 --configuration configuration.json

Call in a python script

from database-initialization import initialize_database

initialize_database(
    hostname="http://127.0.0.1:8000",
    configuration="configuration.json",
)