- Python 3.8+ installed (the IDE example uses Python 3.13).
- Optional: Ollama running locally if you want to call the Ollama example (see course: Running Local LLMs With Ollama).
1) Create the project and virtual environment
Create a project directory, open it in your editor, and keep the virtual environment local to the project:Keep your virtual environment directory local to the project (for example,
.venv/). Add it to .gitignore so it is not committed to version control.2) Scaffold a minimal application
Start with a tinymain.py that creates and runs a FakeDataGenerator instance. This keeps your entry point simple while implementation details live in separate modules.
3) Move the generator to its own module
Createfake_data_generator.py and keep the class implementation there. This improves testability and makes the project more maintainable.
main.py imports this module and calling python main.py should print the same message.
4) Generate fake CSV data using a local LLM (Ollama)
We provide a small scriptcreate_fake_data.py that builds a prompt, calls Ollama’s HTTP API, and writes the returned CSV to a file. Adjust the model and URL if your Ollama deployment differs.
Install requests in the venv:
create_fake_data.py:
fake_data.csv with contents like:
Ollama responses and API shapes can change between releases. If the script returns unexpected JSON, inspect the raw response to find the correct key (for example
response, output, or text) and update the parsing accordingly.5) Save dependencies (requirements.txt)
Capture the project dependencies so others can recreate the environment:requirements.txt (versions will vary):
6) .gitignore and keeping the venv out of Git
Create a.gitignore at the repository root to exclude the virtual environment and common artifacts.

Project files overview
Summary
- Created a project, and isolated dependencies in a local Python virtual environment.
- Scaffolding: small
main.pyplusfake_data_generator.pyfor implementation. - Built
create_fake_data.pyto call a local Ollama model and save CSV output. - Saved dependencies with
pip freeze > requirements.txt. - Added a
.gitignoreto keep the virtual environment and editor artifacts out of version control.