-
Make sure that you have Python and Poetry installed on your system. You can check if Python is installed by running the following command in your terminal
python --version
. -
Open a terminal window and navigate to project directory
-
Create a new virtual environment for the project by running the following command:
poetry install
. This will create a new virtual environment and install the dependencies specified in thepyproject.toml
file. -
Activate the virtual environment by running the following command:
poetry shell
. -
Navigate to the
scripts
directory. -
Run the script using the following command:
python main.py path/to/json_file
. For example, if the JSON file you want to process is calleddata.json
and is saved in a directory calleddata
, you would run the script like this:python script_name.py ../data/data.json
.
This will generate a JSON schema file based on the structure of the input JSON file, and save the schema file in the schema directory. The name of the schema file will be the base name of the input file, followed by _schema.json.
For example, if the input file is called data.json
, the schema file will be called data_schema.json
.
- Make sure that you have activated the virtual environment for the project
- To run the tests, open a terminal window and navigate to the directory. Then run the following command:
python -m pytest
. This will run the test class with all the functions in thetest_sniffer.py
file.