This repository contains a collection of Python tools and a sample application, primarily focused on an AI Code Assistant interface and a Calculator utility.
The project is divided into two main components:
- AI Code Assistant: A CLI tool located at the root that interacts with the Google Gemini API to generate content based on user prompts. It includes a set of utility functions for file system operations.
- Calculator: A standalone command-line calculator application located in the
calculator/directory.
- Python 3.12 or higher
- A Google Gemini API Key (stored in
GEMINI_API_KEYenvironment variable)
This project uses uv for dependency management, but can also be installed via standard pip tools.
uv syncpip install .Create a .env file in the root directory and add your Gemini API key:
GEMINI_API_KEY=your_api_key_hereRun the main script to interact with the Gemini model:
python main.py "Your prompt here"Options:
--verbose: Enable verbose output to see token usage.
The calculator is located in the calculator/ directory. You can run it directly:
python calculator/main.py "3 + 5 * 2"It supports basic arithmetic operations (+, -, *, /) and respects operator precedence.
main.py: Entry point for the AI Assistant CLI.functions/: Utility modules for file operations (get_file_content,write_file, etc.).calculator/: The calculator application source code.pkg/: Core logic for the calculator.
tests/: Unit tests for the root utility functions.
To run the tests for the utility functions:
python -m unittest discover . -p "test_*.py"