A command-line AI toolkit that performs three text-processing tasks using an LLM API:
- Summarization
- Translation
- Sentiment Analysis
- CLI interface built with
argparse - Text summarization
- Text translation
- Sentiment analysis
- Environment-based API key management with
.env - Input validation for CLI arguments
- API error handling
- Automated tests using
pytestand mocking - Dependency management with
requirements.txt
- Python
- Gemini API
- argparse — CLI argument parsing
- python-dotenv — environment variable management
- pytest — automated testing
git clone <repository-url>
cd AI_toolkitpython -m venv .venvWindows:
.venv\Scripts\activatemacOS/Linux:
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root directory and add your Gemini API key:
GEMINI_API_KEY=your_api_key_hereThe API key is loaded from the environment using python-dotenv.
Do not commit the .env file to GitHub.
python ai_toolkit.py summarize "I love Python"python ai_toolkit.py translate "I love Python" --language Spanishpython ai_toolkit.py sentiment "I love Python"Run the automated tests with:
pytest test_ai_toolkit.pyThe test suite uses pytest and mocking to test the AI functions without making real API calls.
AI_toolkit/
├── ai_toolkit.py # Main CLI application
├── test_ai_toolkit.py # Automated tests
├── requirements.txt # Project dependencies
├── .env # API key (not committed)
├── .gitignore # Files excluded from Git
└── README.md # Project documentation