- Creating a project folder and a Python virtual environment
- Scaffolding a minimal application and organizing code into modules
- Adding a utility that calls a local Ollama server to produce CSV-formatted fake data
- Capturing dependencies in
requirements.txt - Creating a
.gitignoreto keep the repo clean
- Create project folder and virtual environment
- Scaffold
main.pyand aFakeDataGeneratorclass - Move the class to
fake_data_generator.pyand import it frommain.py - Add
create_fake_data.pyto call a local Ollama server and save CSV - Install dependencies and produce
requirements.txt - Create a
.gitignoreto exclude the virtual environment and other artifacts
- Python virtual environments: https://docs.python.org/3/tutorial/venv.html
- Requests library: https://docs.python-requests.org/
- Ollama docs: https://docs.ollama.ai
- GitHub Copilot: https://github.com/features/copilot
- VS Code: https://code.visualstudio.com
Quick file summary
1) Create the project folder and virtual environment
Create the project folder, open it in your editor (e.g., VS Code), and create a Python virtual environment. Example CLI commands:- macOS / Linux:
- Windows (PowerShell):
Use
python3 -m venv .venv to create a portable local environment. Always activate it before installing project dependencies so packages are isolated to this project.2) Scaffold a minimal application
Start with a simplemain.py that defines a FakeDataGenerator class and runs when executed. This keeps the initial project minimal and testable.
main.py:
3) Move the generator into its own module
As projects grow, keeping classes and functions in focused modules improves maintainability. MoveFakeDataGenerator into fake_data_generator.py and import it from main.py.
fake_data_generator.py:
main.py to import the class:
4) Add a utility to request fake data from a local Ollama model
Createcreate_fake_data.py. It sends a prompt to an Ollama server running locally at http://localhost:11434/api/generate, asks for CSV-formatted fake data, and saves the returned raw CSV text to fake_data.csv.
create_fake_data.py:
Ollama’s JSON schema can change across versions. If the server returns fields like
output or nested objects, inspect the raw JSON and update the key access accordingly before writing to disk.requests in the virtual environment:
5) Track project dependencies with requirements.txt
After installing project packages (for example,requests), capture them in requirements.txt so collaborators can recreate your environment.
Example:
requirements.txt:
6) Create a robust .gitignore
Exclude the virtual environment directory and other generated artifacts from Git. Below is a practical.gitignore example to keep your repository clean.

.gitignore (partial):
.venv was already committed, remove it from tracking:
.gitignore:
Summary
- Created a new Python project with an isolated virtual environment.
- Scaffoled a minimal
FakeDataGeneratorand moved it into a dedicated module. - Built
create_fake_data.pyto call a local Ollama model and save CSV-formatted fake data. - Captured dependencies in
requirements.txtand protected the repo with.gitignore. - This example demonstrates how GitHub Copilot can accelerate boilerplate creation; future articles will show importing generated data into a database and using it for more advanced workflows.