Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/test_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Test & Coverage

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Run tests with coverage
run: |
pytest --cov=Utilities --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install flake8 black isort mypy

- name: Check formatting with Black
run: black --check --line-length=100 .

- name: Check imports with isort
run: isort --check-only --profile black .

- name: Lint with Flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --max-line-length=100 --statistics

- name: Type checking with MyPy
run: |
mypy Utilities --ignore-missing-imports --warn-return-any || true

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Bandit
run: pip install bandit

- name: Run Bandit security scan
run: bandit -r . -lll -f json -o bandit-report.json || true

- name: Upload Bandit report
uses: actions/upload-artifact@v4
with:
name: bandit-security-report
path: bandit-report.json
retention-days: 30
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
```
# Dependencies
.venv/
venv/
__pycache__/
*.pyc
*.pyo
*.pyd

# Build artifacts
dist/
build/
*.egg-info/

# Environment
.env
.env.local
*.env.*

# Editors
.vscode/
.idea/
*.swp
*.swo

# Logs
*.log

# Coverage
.coverage
coverage/
htmlcov/

# Testing
.pytest_cache/
.mypy_cache/

# OS
.DS_Store
Thumbs.db
```
90 changes: 90 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Pre-commit configuration for python-projects repository
# See https://pre-commit.com for more information

repos:
# Core Python formatting and linting
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-merge-conflict
- id: detect-private-key
- id: debug-statements

# Black code formatter
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3.10
args: [--line-length=100]

# Isort import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--line-length=100"]

# Flake8 linter
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=100, --extend-ignore=E203,W503]
additional_dependencies: [flake8-docstrings]

# Security scanning with Bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: ["-r", "-lll"]
exclude: ^tests/

# Type checking with mypy (optional, can be slow)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--ignore-missing-imports, --warn-return-any]
additional_dependencies: []
exclude: ^(machine_learning|GUI|Game)/

# Pyupgrade for modern Python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py310-plus]

# Security vulnerability check
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.12.1]

# Check for common security issues in dependencies
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.3
hooks:
- id: python-safety-dependencies-check
files: requirements.txt
Comment on lines +73 to +78

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): The safety hook is scoped only to requirements.txt, which may be ineffective if dependencies are managed via pyproject.toml.

Since you define dependencies in pyproject.toml, this hook may never see your real dependency set. Consider either adding a documented step to export requirements.txt from pyproject, or updating the hook/tooling to operate directly on pyproject.toml (e.g., via pip-audit or a similar tool) so that all actual dependencies are checked.

Suggested change
# Check for common security issues in dependencies
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.3
hooks:
- id: python-safety-dependencies-check
files: requirements.txt
# Check for common security issues in dependencies defined in pyproject.toml
- repo: https://github.com/pypa/pip-audit
rev: v2.7.3
hooks:
- id: pip-audit
args: ["-P", "pyproject.toml"]


ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
125 changes: 125 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Changelog

All notable changes to the python-projects repository will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Production-grade package configuration with `pyproject.toml` and `setup.cfg`
- Pre-commit hooks for code quality automation
- Comprehensive CI/CD workflow for testing, linting, and security scanning
- Unit tests for Utilities module (24 test cases)
- Development guide documentation
- Proper package structure with `__init__.py` files including version info and `__all__` exports
- `.pre-commit-config.yaml` with Black, isort, Flake8, Bandit, and MyPy hooks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Consider using consistent capitalization for "Mypy" across the documentation.

Here it's written as "MyPy" while DEVELOPMENT.md uses "Mypy". Please choose one capitalization (e.g., "mypy" or "Mypy") and use it consistently across the docs.

Suggested change
- `.pre-commit-config.yaml` with Black, isort, Flake8, Bandit, and MyPy hooks
- `.pre-commit-config.yaml` with Black, isort, Flake8, Bandit, and Mypy hooks

- GitHub Actions workflow for multi-Python version testing
- MANIFEST.in for proper package distribution
- Enhanced `.gitignore` for Python projects

### Fixed
- Corrected typos in module imports across all `__init__.py` files:
- `brithday` → `birthday`
- `broswer` → `browser`
- `insta` → `inta`
- `secert_code` → `secret_code`
- Updated import statements from bare `import` to proper relative imports (`from .module import *`)

### Changed
- Improved import structure in all package `__init__.py` files
- Enhanced documentation with DEVELOPMENT.md guide
- Updated requirements.txt with pinned secure versions

## [1.0.0] - 2024

### Added
- Initial release with 80+ Python projects
- Five main categories: Calculator, Game, GUI, Utilities, Machine Learning
- Comprehensive documentation (README, CONTRIBUTING, FAQ, etc.)
- Multiple CI/CD workflows (15+ GitHub Actions)
- CircleCI integration
- DeepSource code quality integration
- Community support channels (Discord, Reddit, LinkedIn)
- Security scanning with Bandit and Codacy
- Automated code formatting with Black
- Dependency management with Dependabot

### Project Categories

#### Calculator (18 projects)
- Mega Calculator, Quadratic Equation Solver, BMI Calculator
- Stock Analyzer, Special Relativity Calculator
- Number Base Converter, Integration/Differentiation
- Time converters, Grade Calculator, Sudoku Solver
- Mortgage Calculator, Roman Numeral Converter, ASCII Value Finder

#### Games (16 projects)
- Snake Game, Hangman, Tic Tac Toe (GUI & Terminal)
- 2048 Blocks, Master Mind, Color Guessing
- Twenty-One, Rock Paper Scissors, Dice Rolling
- Number Guessing, Typing Speed Test, Star Patterns

#### GUI (21 projects)
- Form applications, Calculators, Clocks
- Games: Tic Tac Toe, Snake & Ladder, Quiz
- Creative: Paint app, Turtle graphics (Pikachu, Doraemon, Rainbow)
- Tools: Notepad, File Explorer, YouTube Downloader, Todo List
- Calendar, Application Search, Birthday Message Generator

#### Machine Learning (11 projects)
- Computer Vision: Eye Blink Detection, Hand Gesture Brightness Control
- NLP: Text-to-Speech, Language Detector, Sentiment Analysis, Spam Detection
- Prediction: Crypto Price, Gold Price (Prophet library)
- Image Processing: Image to Sketch
- Tools: Phone Camera on PC

#### Utilities (22 projects)
- Network: WiFi Password Retriever, Site Connectivity Checker
- Web: Browser automation, Google Search, Instagram Info, GitHub API
- Security: Password Manager, Password Generator, Hash Cracker, Secret Code
- Tools: Countdown Timer, QR Code Generator, WhatsApp Spam Sender
- File Transfer via QR, Word/Letter Counter, Short Form Generator
- Birthday Finder (zodiac, birthstone, life path number)

### Technical Stack
- **GUI**: pygame, pyqt5, pyqtwebengine, tkcalendar, pillow
- **ML/AI**: opencv-python, mediapipe, prophet, seaborn, scikit-learn
- **Web**: requests, googlesearch-python, instaloader, pytube
- **Utilities**: qrcode, pyautogui, pyttsx3, pyshorteners
- **Math/Science**: matplotlib, sympy, numpy, openpyxl, yfinance
- **NLP**: textblob, vaderSentiment, langdetect, nltk

### Documentation
- README.md - Comprehensive project overview
- CONTRIBUTING.md - Contribution guidelines
- CODE_OF_CONDUCT.md - Community standards
- SECURITY.md - Vulnerability reporting
- FAQ.md - Common questions
- SUMMARY.md - Quick summary
- How_to_use.md - Installation and usage
- prerequisites.md - System requirements
- PULL_REQUEST_TEMPLATE.md - PR template

### Known Issues
- Some modules may require Python 3.10+ compatibility verification
- Limited test coverage (only Utilities module tested initially)
- Some external dependencies may require API keys or authentication

---

## Version History

- **1.0.0** - Initial production-ready release with comprehensive improvements
- **0.x.x** - Development versions (pre-release)

---

## Contributing

We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to submit pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Loading
Loading