{"id":19235239,"url":"https://github.com/kiminzajnr/python_projects","last_synced_at":"2025-02-23T12:55:43.486Z","repository":{"id":222472123,"uuid":"747826223","full_name":"kiminzajnr/Python_Projects","owner":"kiminzajnr","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-13T16:25:11.000Z","size":501,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T00:26:27.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiminzajnr.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}},"created_at":"2024-01-24T18:05:04.000Z","updated_at":"2024-04-25T20:31:12.541Z","dependencies_parsed_at":"2024-04-25T20:31:09.385Z","dependency_job_id":"9cfe1c4d-9698-4bc7-bd06-da8a2b72c707","html_url":"https://github.com/kiminzajnr/Python_Projects","commit_stats":null,"previous_names":["kiminzajnr/python_projects"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiminzajnr%2FPython_Projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiminzajnr%2FPython_Projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiminzajnr%2FPython_Projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiminzajnr%2FPython_Projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiminzajnr","download_url":"https://codeload.github.com/kiminzajnr/Python_Projects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240317416,"owners_count":19782388,"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":[],"created_at":"2024-11-09T16:16:21.909Z","updated_at":"2025-02-23T12:55:43.441Z","avatar_url":"https://github.com/kiminzajnr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Mini Projects\n\n## Table of Contents\n- [SSH key Uploader](#ssh-key-uploader)\n- [Simple REST API](#simple-rest-api)\n- [CMD Todo App](#CMD-Todo-App)\n- [Grammar Checker](#Grammar-Checker)\n- [End of civilization predictor](#End-of-civilization-predictor)\n- [Automated File Organizer](#Automated-File-Organizer)\n\n# [SSH Key Uploader](/learner-pub-key-uploader/)\n\nUploads a public key to server/s\n\n## Getting Started\n\n```\ngit clone https://github.com/kiminzajnr/Python_Projects.git\n```\n\n```\ncd Python_Projects/learner-pub-key-uploader\npython3 -m venv .venv\n. .venv/bin/activate\npip install Flask\n```\n\n```\npython3 app.py\n```\n```\ntouch ~/.ssh/priv.key # add your private key here\nchmod 400 ~/.ssh/priv.key\n```\n\n\n## Prerequisites\n\nRefer to `Getting Started`\n\n\n## Deployment\n\nOn your server:\n\n```\ntouch ~/.ssh/priv.key # add your private key here\nchmod 400 ~/.ssh/priv.key\n```\n```\ngit clone https://github.com/kiminzajnr/Python_Projects.git\n```\n```\ncd learner-pub-key-uploader\npython3 -m venv .venv\n. .venv/bin/activate\npip install Flask\npip install gunicorn\n```\n```\ntouch wsgi.py\n```\n```\nvi wsgi.py\n```\nand add:\n```\nfrom app import app\n\n\nif __name__ == \"__main__\":\n    app.run()\n\n```\n```\ngunicorn --bind 0.0.0.0:5000 wsgi:app\n```\n```\ndeactivate\n```\n```\nsudo vi /etc/systemd/system/app.service\n```\nand add\n```\n[Unit]\nDescription=Gunicorn instance to server app Flask app\nAfter=network.target\n\n[Service]\nUser=ubuntu\nGroup=www-data\nWorkingDirectory=/home/ubuntu/My_App/learner-pub-key-uploader\nEnvironment=\"Path=/home/ubuntu/My_App/learner-pub-key-uploader/.venv/bin\"\nExecStart=/home/ubuntu/My_App/learner-pub-key-uploader/.venv/bin/gunicorn --workers 3 --bind unix:app.sock -m 007 wsgi:app\n\n[Install]\nWantedBy=multi-user.target\n```\n```\nsudo systemctl start app\n```\n```\nsudo systemctl enable app # You might have to run sudo systemctl daemon-reload first\n```\n```\nsudo systemctl status app # Should be active and running\n```\n```\nsudo apt install nginx\n```\n```\nsudo vi /etc/nginx/site-available/app.conf\n```\nand add:\n```\nserver {\n        listen 80;\n        server_name alx1.parallel-cumpus.tech;\n\n        location / {\n                include proxy_params;\n                proxy_pass http://unix:/home/ubuntu/learner-pub-key-uploader/app.sock;\n        }\n}\n\n```\n```\nsudo ln -s /etc/nginx/sites-available/app.conf /etc/nginx/sites-enabled/\n```\n```\nsudo nginx -t # test should be successful and syntax ok\n```\n```\nsudo systemctl restart nginx\n```\n```\nsudo ufw enable\nsudo ufw allow ssh\nsudo ufw allow \"Nginx Full\"\n```\nTest your app. If you get `502 Bad Gateway`, run:\n```\nsudo chmod 775 /home/user\n```\n\n\u003e setting up https with let's encrypt\n```\nsudo apt update; sudo snap install core; snap refresh core\n```\n```\nsudo snap install --classic certbot\n```\n```\nsudo ln -s /snap/bin/certbot /usr/bin/certbot\n```\n```\nsudo certbot --nginx\n```\n\n## Built with\n\n- \u003cimg src=\"https://img.icons8.com/ios/452/flask.png\" alt=\"Flask\" width=\"20\" height=\"20\" style=\"filter: invert(45%) sepia(100%) saturate(2525%) hue-rotate(88deg) brightness(94%) contrast(91%);\"/\u003e [Flask](https://flask.palletsprojects.com/en/3.0.x/)\n- \u003cimg src=\"https://img.icons8.com/ios/452/console.png\" alt=\"Bash\" width=\"20\" height=\"20\" style=\"filter: invert(45%) sepia(100%) saturate(2525%) hue-rotate(88deg) brightness(94%) contrast(91%);\"/\u003e [Bash](https://www.gnu.org/software/bash/)\n- \u003cimg src=\"https://www.w3.org/html/logo/downloads/HTML5_Logo_512.png\" alt=\"HTML\" width=\"20\" height=\"20\"/\u003e [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML)\n- \u003cimg src=\"https://cdn.iconscout.com/icon/free/png-512/css3-9-1175237.png\" alt=\"CSS\" width=\"20\" height=\"20\"/\u003e [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS)\n\n# [Simple REST API](/rest-apis-flask-python/Flask_Rest/)\n\n## Features\n\n- Create stores, each with a `name` and a list of stocked `items`.\n- Create an item within a store, each with a `name` and a `price`.\n- Retrieve a list of all stores and their items.\n- Given its `name`, retrieve an individual store and all its items.\n- Given a store `name`, retrieve only a list of item within it.\n\n## Create stores\n\nRequest:\n```\nPOST /store {\"name\": \"My Store\"}\n```\n\nResponse:\n```\n{\"name\": \"My Store\", \"items\": []}\n```\n\n## Create items\n\nRequest:\n```\nPOST /store/My Store/item {\"name\": \"Chair\", \"price\": 175.50}\n```\nResponse:\n```\n{\"name\": \"Chair\", \"price\": 175.50}\n```\n\n## Retrieve all stores and their items\n\nRequest:\n```\nGET /store\n```\nResponse:\n```\n{\n    \"stores\": [\n        {\n            \"name\": \"My Store\",\n            \"items\": [\n                {\n                    \"name\": \"Chair\",\n                    \"price\": 175.50\n                }\n            ]\n        }\n    ]\n}\n```\n\n## Get only items in a store\n\nRequest:\n```\nGET /store/My Store/item\n```\nResponse:\n```\n[\n    {\n        \"name\": \"Chair\",\n        \"price\": 175.50\n    }\n]\n```\n\n# [CMD Todo App](/Todo_CMD_App/)\n\nA command-line to-do app to manage your tasks effectively.\n\n## Features\n\n1. Add new tasks\n2. View all tasks\n3. Mark tasks as completed\n4. Delete tasks\n\nTasks are persistently stored in a JSON file\n\n## Getting Started\n\n1. Clone or download this repository:\n```\nhttps://github.com/kiminzajnr/Python_Mini_Projects.git\n```\n2. Navigate to the project directory: \n```\ncd Python_Mini_Projects\n```\n3. Ensure you have Python installed on your system.\n4. Run the app\n```\npython todo.py\n```\n## Usage\n\n- Add a task: Enter 1 and provide the task description/name.\n- Show tasks: Enter 2 to view a list of all tasks with their completion status.\n- Complete a task: Enter 3 and specify the task ID to mark it as completed.\n- Delete a task: Enter 4 and specify the task ID to remove it.\n- Quit: Enter 5 to exit the app.\n\n![usage_demo](/Todo_CMD_App/gif/demo.gif)\n\n## File Structure\n\n- `todo.py`: Main Python script containing the todo app logic.\n- `tasks.json`: JSON file to persist tasks.\n\n## Contributing\n\nPull requests are welcome!\n\n## License\n\nThis project is licensed under the MIT License.\n\n\n=============================\n\n\n# [Grammar Checker](/Grammer_Checker/) ![Alt text](image.png)\n\nGrammar Checker is a simple Python program that uses the [language_tool_python](https://pypi.org/project/language-tool-python/) library to check grammar in a given text or file.\n\n## Features\n\n- Check grammar issues in text.\n- Save corrected sentences to a file.\n- Check grammar in a file.\n\n## Getting Started\n\n1. Clone the Repository $ Navigate to the project directory:\n```\ngit clone https://github.com/kiminzajnr/Python_Mini_Projects.git\ncd /Python_Mini_Projects/Grammer_Checker/\n```\n\n2. Install Dependencies:\n```\npip install -r requirements.txt\n```\n\n3. Run the Program:\n```\npython grammar_checker.py\n```\n\n## Usage\nThe program provides two options:\n\n1. Check grammar in a text.\n2. Check grammar in a file.\nFollow the on-screen prompts to use the program. You can choose to save corrected sentences to a file.\n\n## Dependencies\n- [language_tool_python](https://pypi.org/project/language-tool-python/): An open-source grammar checker for Python. 📝\n\n## Contributing\nIf you'd like to contribute to this project, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch `git checkout -b feature/your-feature-name`.\n3. Commit your changes `git commit -am 'Add new feature'`.\n4. Push to the branch `git push origin feature/your-feature-name`.\n5. Create a new pull request.\n\n## License\nThis project is licensed under the MIT License.\n\n\n=============================================\n\n\n# [End of civilization predictor](/Python_Mini_Projects/EOC_Predictor/)\n*Note, This Is Entirely Fictional*\n\n## Overview\n\nThe End of Civilization Predictor is a Python script that simulates various factors contributing to the potential end of civilization. It provides a probability-based simulation, allowing users to customize the duration of the simulation and receive warnings if the probability of civilization ending is high.\n\n## Features\n\n- Simulates the impact of factors such as climate change, overpopulation, probability of war, deadly pathogens, and technological catastrophes.\n- Provides a customizable simulation duration.\n- Displays warnings if the probability of civilization ending is high.\n\n## Getting Started\n\n1. Clone the repository:\n   ```bash\n   https://github.com/kiminzajnr/Python_Mini_Projects.git\n   cd end-of-civilization-predictor\n2. Run the script:\n    ```\n    python end_of_civilization.py\n3. Follow the on-screen prompts to customize the simulation.\n\n## Factors and Probabilities\nThe simulation considers the following factors and their probabilities:\n\n- Climate Change: 30%\n- Overpopulation: 20%\n- Probability of War: 25%\n- Deadly Pathogens: 15%\n- Technological Catastrophe: 10\n\n## Customization\nYou can customize the simulation by entering the number of years you want to simulate. The script will then simulate the impact of factors over the specified duration.\n\n## Warning\nIf the overall probability of civilization ending is higher than 50%, the script displays a warning, suggesting users take necessary precautions.\n\n## Contributing\nIf you'd like to contribute to this project, please follow these steps:\n\n- Fork the repository.\n- Create a new branch `git checkout -b feature/your-feature-name`.\n- Commit your changes `git commit -am 'Add new feature`.\n- Push to the branch `git push origin feature/your-feature-name`.\n- Create a new pull request.\n\n## Acknowledgments\n- [Python](https://www.python.org/): The programming language used for this project.\n- [Random Library](https://docs.python.org/3/library/random.html): Used for generating random values.\n\n\n\n======================================================\n\n# [Automated File Organizer](/File_Organizer/)\n\nThis script organizes files in a directory based on their types (e.g., images, documents, videos) using file extensions to determine file types.\n\n## Table of Contents\n\n- [Features](#features)\n- [Usage](#usage)\n- [Installation](#installation)\n- [Command-Line Interface](#command-line-interface)\n- [Logging](#logging)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **File Organization:** Automatically organizes files into directories based on their types.\n- **File Type Recognition:** Determines file types using file extensions.\n\n## Usage\n\n1. Clone the repository:\n```\ngit clone https://github.com/kiminzajnr/Python_Mini_Projects.git\n```\n2. Navigate to the project directory:\n```\ncd Python_Mini_Projects/File_Organizer\n```\n3. Run the script:\n```\npython3 file_organizer.py source_directory destination_directory\n```\nReplace source_directory and destination_directory with the actual paths.\n\n# Installation\n```\npip install click\n```\n\n# Command-Line Interface\nThe script supports a command-line interface (CLI) using the `click` library. You can specify source and destination directories directly from the command line.\n`python file_organizer.py source_directory destination_directory`\n\n# Logging\nThe script generates a log file `file_organizer.log` to keep track of files being organized and any errors encountered during the process.\n\n# Contributing\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n# License\nThis project is licensed under the MIT License\n\n\n==================================================================\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiminzajnr%2Fpython_projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiminzajnr%2Fpython_projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiminzajnr%2Fpython_projects/lists"}