{"id":25395911,"url":"https://github.com/jaspermunene/finance-manager","last_synced_at":"2026-05-08T13:09:14.711Z","repository":{"id":268346976,"uuid":"904055974","full_name":"JasperMunene/finance-manager","owner":"JasperMunene","description":"An AI driven Financial Manager CLI application","archived":false,"fork":false,"pushed_at":"2024-12-20T09:43:26.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T20:49:58.770Z","etag":null,"topics":["cli","database","gemini-api","python3","shell","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JasperMunene.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-16T07:04:35.000Z","updated_at":"2024-12-20T09:43:29.000Z","dependencies_parsed_at":"2024-12-16T08:20:12.233Z","dependency_job_id":"a2381c02-697a-469f-96cf-0f61e835f40d","html_url":"https://github.com/JasperMunene/finance-manager","commit_stats":null,"previous_names":["jaspermunene/finance-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasperMunene%2Ffinance-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasperMunene%2Ffinance-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasperMunene%2Ffinance-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasperMunene%2Ffinance-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JasperMunene","download_url":"https://codeload.github.com/JasperMunene/finance-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248259677,"owners_count":21074175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","database","gemini-api","python3","shell","sqlalchemy"],"created_at":"2025-02-15T20:38:58.450Z","updated_at":"2026-05-08T13:09:09.660Z","avatar_url":"https://github.com/JasperMunene.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Finance Manager CLI Project\n\n## Overview\n\nThis is a command-line interface (CLI) application designed to help users manage their personal finances. It allows users to perform various financial activities such as:\n\n- Registering and logging in as a user.\n- Adding income and expense transactions.\n- Categorizing transactions and managing budgets.\n- Providing financial advice based on transaction history.\n- Simulating financial scenarios.\n- Displaying transaction history, budgets, and categories.\n- Managing user sessions.\n---\n## Features\n\n- **User Registration \u0026 Login:** Sign up and log in to the application with email and password.\n- **Transaction Management:** Add income/expense transactions with automatic categorization using AI.\n- **Budget Management:** Set and track budgets for various categories.\n- **Financial Advice:** Get financial advice based on your transaction history.\n- **Scenario Simulation:** Simulate financial scenarios to understand their potential impact.\n- **Category Management:** Add and view categories for transactions and budgets.\n- **Data Visualization:** View transactions, budgets, and categories in a well-formatted table.\n- **Database Management:** Uses SQLAlchemy for database interactions, with Alembic for handling migrations.\n- **AI-powered Transaction Categorization:** Leverages Gemini API to categorize transactions and generate financial insights.\n---\n## Requirements\n\n- Python 3.8+\n- [Google Gemini API Key](https://ai.google.dev/gemini-api/docs/) for transaction categorization and financial advice\n- [Python-dotenv](https://pypi.org/project/python-dotenv/) for loading environment variables\n- [SQLAlchemy](https://www.sqlalchemy.org/) for database management\n- [Alembic](https://alembic.sqlalchemy.org/en/latest/) for database migrations\n- [Click](https://click.palletsprojects.com/en/8.1.x/) for creating the command-line interface\n- [Tabulate](https://pypi.org/project/tabulate/) for displaying tables in the CLI\n- [Pyfiglet](https://pypi.org/project/pyfiglet/) for ASCII banners\n- [Passlib](https://pypi.org/project/passlib/) for password hashing\n\n---\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/JasperMunene/finance-manager.git\n   cd finance-manager\n   ```\n\n2. Install the required dependencies:\n   ```bash\n   pip install [...dependancy]\n   ```\n\n3. Set up the environment variables:\n   - Create a `.env` file in the root of the project and add your Gemini API key:\n     ```\n     GEMINI_API_KEY=your_api_key_here\n     ```\n\n4. Set up the database and apply migrations:\n   ```bash\n   alembic upgrade head\n   ```\n---\n## Usage\n\n### CLI Commands\n\nThe project uses **Click** to create a command-line interface (CLI) for interacting with the finance manager. Available commands are listed below.\n\n### User Commands\n\n- **signup**: Register a new user\n  ```bash\n  python -m finance_manager.main signup\n  ```\n\n- **login**: Log in with your email and password\n  ```bash\n  python -m finance_manager.main login\n  ```\n\n- **logout**: Log out the current user\n  ```bash\n  python -m finance_manager.main logout\n  ```\n\n### Transaction Management\n\n- **add-transaction**: Add a new transaction (income/expense)\n  ```bash\n  python -m finance_manager.main add-transaction\n  ```\n\n- **transactions**: Display all transactions for the currently logged-in user\n  ```bash\n  python -m finance_manager.main transactions\n  ```\n\n### Budget Management\n\n- **set-budget**: Set a budget for a specific category\n  ```bash\n  python -m finance_manager.main set-budget\n  ```\n\n- **budgets**: Display all budgets for the logged-in user\n  ```bash\n  python -m finance_manager.main budgets\n  ```\n\n### Category Management\n\n- **add-category**: Add a new category to the finance manager\n  ```bash\n  python -m finance_manager.main add-category\n  ```\n\n- **categories**: Display all categories in the system\n  ```bash\n  python -m finance_manager.main categories\n  ```\n\n### Financial Insights\n\n- **advice**: Get financial advice based on your transactions\n  ```bash\n  python -m finance_manager.main advice\n  ```\n\n- **simulate-scenario**: Simulate a scenario based on transaction history\n  ```bash\n  python -m finance_manager.main simulate-scenario\n  ```\n\n### Deletion\n\n- **delete-transactions**: Delete all transactions for the currently logged-in user\n  ```bash\n  python -m finance_manager.main delete-transactions\n  ```\n\n---\n## Session Management\n\n- **`get_logged_in_user`**: Retrieves the email of the logged-in user from the session file (`user.txt`).\n- **`set_logged_in_user`**: Stores the logged-in user's email in the session file.\n- **`remove_logged_in_user`**: Logs out the user by removing the session file.\n---\n## Database Models\n\nThe project uses the following SQLAlchemy models:\n\n- **User**: Stores user details such as name, email, and password hash.\n- **Transaction**: Stores transactions (income/expense) along with their associated category.\n- **Category**: Stores categories for transactions (e.g., \"Food\", \"Entertainment\").\n- **Budget**: Stores the budget set by users for each category.\n---\n## Database\n\nThe project uses **SQLAlchemy** for database management and **Alembic** for handling migrations.\n\n1. To generate a new migration after making changes to the models, run:\n   ```bash\n   alembic revision --autogenerate -m \"your message here\"\n   ```\n\n2. To apply the migrations to the database:\n   ```bash\n   alembic upgrade head\n   ```\n---\n## Custom Shell Script (`fm.sh`)\n\nA shell script `fm.sh` is provided for easier usage of commands. To run any command, use the following format:\n\n```bash\n./fm.sh [COMMAND]\n```\n\nExample:\n```bash\n./fm.sh add-transaction\n```\n\nThis will call the respective subcommand from the Python script.\n\n---\n## Contributing\n\nFeel free to contribute to this project by submitting issues or pull requests.\n\n---\n\n## Author\n\n**Jasper Munene**  \nCreator \u0026 Developer of the Finance Manager CLI\n\n- GitHub: [@JasperMunene](https://github.com/JasperMunene)\n- Email: [devjaspermunene@gmail.com](mailto:devjaspermunene@gmail.com)\n\nFeel free to reach out if you have any questions or suggestions!\n\n---\n\n\n## License\n\nThis project is licensed under the terms of the MIT [License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaspermunene%2Ffinance-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaspermunene%2Ffinance-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaspermunene%2Ffinance-manager/lists"}