Skip to main content
Kick off your development workflow by leveraging GitHub Copilot, Python virtual environments, and a local Ollama LLM for fake data generation. In this guide, you’ll learn how to:
  1. Initialize a Git repository
  2. Configure a Python virtual environment
  3. Scaffold and modularize code with Copilot
  4. Generate CSV data via Ollama (local LLM)
  5. Manage dependencies and .gitignore

1. Initialize the Git Repository

First, clone or fork your project on GitHub. Your starter repository includes:
  • LICENSE
  • .gitignore (baseline)
  • GitHub Copilot instructions
  • main.py (empty stub)
Open your terminal or VS Code integrated shell:
This sets up an empty Git repository and launches VS Code in your project folder.

2. Configure a Python Virtual Environment

Isolating your dependencies prevents conflicts and keeps your project portable. You can follow Copilot’s suggestions or use these commands:
Virtual environments ensure that pip install only affects your project and avoids version clashes globally. See Python Virtual Environments.
With the environment active, install packages locally:

3. Scaffold main.py with GitHub Copilot

Use the GitHub Copilot extension in VS Code. In Copilot Chat, request:
“Scaffold a main.py that defines a FakeDataGenerator class and runs it in main().”
Copilot will generate something like this:
Save and execute:
The image shows a Visual Studio Code interface with a Python file named "main.py" open and a terminal at the bottom. The right panel features the "Ask Copilot" section for AI assistance.

4. Refactor Code into Modules

Clean architecture separates concerns. Ask Copilot to extract FakeDataGenerator: fake_data_generator.py
Update main.py to import the module:
Re-run to confirm:

5. Generate Fake Data via Ollama (Local LLM)

We’ll create create_fake_data.py to call a local Ollama API at http://localhost:11434/api/generate, request CSV-formatted rows, and write them to fake_data.csv. In Copilot Chat, prompt:
“Generate a script that sends a CSV fake-data request to Ollama and saves the response.”
create_fake_data.py
Install requests and run:
The image shows a Visual Studio Code interface with a Python project open, displaying a file named create_fake_data.py. The terminal at the bottom shows commands related to running a fake data generator and listing models, while the right panel contains GitHub Copilot suggestions.
Sample fake_data.csv:

6. Manage Dependencies and .gitignore

Export your locked dependencies:
.gitignore
After adding .gitignore, remove any committed virtual environment:
Finally, commit your changes:

Next Steps

You’ve successfully:
  • Bootstrapped a Python repo with Git and Copilot
  • Isolated dependencies in a virtual environment
  • Scaffolded, refactored, and modularized code
  • Integrated with a local Ollama LLM for data generation
  • Locked dependencies and configured .gitignore
Next, connect your fake data pipeline to a database, add unit tests, or deploy to a cloud service.

References

Watch Video