All-in-One Python Framework with built-in web, database, and utilities
Project description
PyFusion - All-in-One Python Framework 🚀
A comprehensive Python framework that bundles web development, database operations, and utility functions into a single, easy-to-use package.
✨ Features
🌐 Web Framework
- Built-in Web Server - Flask-based web framework with easy routing
- HTTP Client - Robust HTTP client for API interactions
- Background Server - Run servers in background threads
- API Endpoints - Easy creation of RESTful APIs
- HTML Templates - Serve dynamic HTML content
💾 Database Management
- SQLite Integration - Built-in database manager with ORM-like interface
- CRUD Operations - Simple insert, update, delete, and query methods
- Key-Value Store - Generic app data storage
- Auto-setup - Automatic table creation and connection management
- Transaction Support - Safe database operations
🔧 Utilities
- File Operations - JSON, CSV, and text file handling
- Network Tools - Internet connectivity checks, port scanning, IP detection
- Data Validation - Email, phone, password strength validation
- Data Formatting - Date, currency, and hashing utilities
- Security - Data hashing and input sanitization
⚡ Easy to Use
- Auto-dependency Installation - Automatically installs required packages
- Simple Import - Single import for all components
- Comprehensive Examples - Ready-to-run demo code
- Production Ready - Well-tested and documented
- Zero Configuration - Works out of the box
🚀 Quick Installation
pip install pyfusion-v1
📖 Quick Start
Web Server Example
from pyfusion_v1 import WebServer
# Create and configure server
app = WebServer()
@app.route('/hello')
def hello():
return {"message": "Hello from PyFusion!", "status": "success"}
@app.route('/users', methods=['POST'])
def create_user():
return {"message": "User created", "method": "POST"}
# Run server
app.run(host='localhost', port=5000)
Database Operations
from pyfusion_v1 import Database
# Initialize database
db = Database('my_app.db')
# Insert data
user_id = db.insert('users', {
'username': 'john_doe',
'email': 'john@example.com'
})
# Query data
users = db.fetch_all('SELECT * FROM users')
user = db.fetch_one('SELECT * FROM users WHERE id = ?', [1])
# Update data
db.update('users', {'username': 'john_updated'}, 'id = 1')
# Delete data
db.delete('users', 'id = ?', [1])
HTTP Client
from pyfusion_v1 import HttpClient
# Create client
client = HttpClient('https://api.example.com')
# Make requests
response = client.get('/users')
response = client.post('/users', {'name': 'John', 'email': 'john@example.com'})
File Operations
from pyfusion_v1 import FileManager
# Read/write JSON
data = FileManager.read_json('config.json')
FileManager.write_json('output.json', data)
# Read/write CSV
csv_data = FileManager.read_csv('data.csv')
FileManager.write_csv('output.csv', csv_data)
# Text files
content = FileManager.read_file('README.md')
FileManager.write_file('copy.txt', content)
Utilities
from pyfusion_v1 import Validator, Formatter, NetworkTools
# Validation
print(Validator.is_email('test@example.com')) # True
print(Validator.is_strong_password('Secure123!')) # True
# Formatting
print(Formatter.format_date('2024-01-15')) # 15/01/2024
print(Formatter.format_currency(1500.75)) # ₹1,500.75
# Network
print(NetworkTools.check_internet()) # True
print(NetworkTools.get_local_ip()) # 192.168.1.100
🏗️ Project Structure
pyfusion_v1/
├── __init__.py # Main package initialization
├── assets/
│ └── logo.jpg # Project logo
├── web/
│ ├── __init__.py
│ ├── server.py # WebServer class
│ └── client.py # HttpClient class
├── database/
│ ├── __init__.py
│ └── manager.py # Database class
└── utils/
├── __init__.py
├── file_ops.py # FileManager class
├── network.py # NetworkTools class
└── helpers.py # Validator & Formatter classes
📚 Examples
Check the examples/ directory for complete working examples:
· web_app.py - Full web application example · database_demo.py - Database operations demo · full_stack.py - Complete full-stack application
Running Examples:
# Clone the repository
git clone https://github.com/anshuman365/pyfusion.git
cd pyfusion
# Run web application example
python examples/web_app.py
# Run database demo
python examples/database_demo.py
# Run full-stack example
python examples/full_stack.py
🔧 Requirements
· Python 3.6 or higher · Dependencies (automatically installed): · Flask >= 2.0.0 · Requests >= 2.25.0 · SQLAlchemy >= 1.4.0 · Jinja2 >= 3.0.0
🎯 Use Cases
· Rapid Prototyping - Quickly build MVP applications · Learning Tool - Perfect for beginners learning web development · Internal Tools - Build admin panels and internal dashboards · API Development - Create RESTful APIs with minimal setup · Full-Stack Apps - End-to-end web applications · Scripting - Enhanced scripting with database and web capabilities
🤝 Contributing
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
- Fork the repository
- Create your feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes (git commit -m 'Add some AmazingFeature')
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Development Setup:
git clone https://github.com/anshuman365/pyfusion.git
cd pyfusion
pip install -e .
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🐛 Bug Reports
If you encounter any bugs or have suggestions, please open an issue.
❓ FAQ
Q: Is PyFusion suitable for production use? A: Yes! PyFusion is built with production-ready components and includes proper error handling.
Q: Can I use PyFusion with other databases? A: Currently PyFusion uses SQLite, but you can extend it to support other databases.
Q: How is this different from Flask/Django? A: PyFusion provides an all-in-one solution with built-in database, HTTP client, and utilities, reducing setup time.
Q: Is there documentation? A: Comprehensive documentation is available in the README and code examples.
🔗 Links
· PyPI: https://pypi.org/project/pyfusion-v1/ · GitHub: https://github.com/anshuman365/pyfusion · Issue Tracker: https://github.com/anshuman365/pyfusion/issues
📞 Support
If you need help or have questions:
- Check the examples directory
- Open an issue on GitHub
- Review the source code documentation
Made with ❤️ by PyFusion Team
Simplifying Python development, one line at a time.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyfusion_v1-1.0.3.tar.gz.
File metadata
- Download URL: pyfusion_v1-1.0.3.tar.gz
- Upload date:
- Size: 66.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/36.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.5.0 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba29d7f1f656c67ac8424a10dfd1485412808c57ea6bb3fe5de0510c85b3fd99
|
|
| MD5 |
c443a187d51f7f29a8fa1f833e2c9f03
|
|
| BLAKE2b-256 |
6ae79b3dba645ab2b8b3fc8ca363f18dab3844e65badd17337f01698240a9a41
|
File details
Details for the file pyfusion_v1-1.0.3-py3-none-any.whl.
File metadata
- Download URL: pyfusion_v1-1.0.3-py3-none-any.whl
- Upload date:
- Size: 62.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/36.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.5.0 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ed042a9023c8d20c7afd6939ee3f802f7df40d9c5001ada6de483ce9ec1f42
|
|
| MD5 |
923c39d8daebf8a01b31cb0a46a40bdc
|
|
| BLAKE2b-256 |
14cf12013729961b293d7af2acf5667e9e7cbfaa1e7b49d54672bd2702ceba5d
|