A web-based tool for managing multiple Python scripts with real-time monitoring, logging, and control. Perfect for managing microservices, data pipelines, background jobs, or any collection of Python scripts.
- π Multi-Script Management: Start, stop, and restart Python scripts from anywhere on your system
- π Real-time Monitoring: Track CPU and memory usage for each script
- π Auto-Restart: Automatically restart scripts on failure with configurable retry limits
- π Centralized Logging: View logs for all scripts in one place
- π Web Interface: Modern, responsive dashboard accessible from any browser
- π REST API: Full API for programmatic control and automation
- π Flexible Path Support: Add scripts from ANY location on your system
- β‘ WebSocket Support: Real-time status updates without page refresh
- π― Easy Deployment: Multiple installation options for different use cases
git clone https://github.com/yourusername/python-manager.git
cd python-manager
python deploy/setup.py
# Clone the repository
git clone https://github.com/yourusername/python-manager.git
cd python-manager
# Install requirements
pip install -r requirements.txt
# (Optional) Download Socket.IO for offline use
python download_socketio.py
# Start the manager
python start_manager.py
Then open your browser to: http://localhost:5000
Python Manager uses Socket.IO for real-time updates. By default, it loads from CDN (cdnjs.cloudflare.com). For offline use or better reliability:
python download_socketio.py
This downloads Socket.IO locally (MIT licensed, freely redistributable). The application automatically falls back to the local file if CDN is unavailable.
- Python 3.7 or higher
- pip (Python package manager)
Required packages (automatically installed):
- Flask
- Flask-SocketIO
- Flask-CORS
- psutil
-
Via Web Interface (Easy):
- Click the "β Manage Scripts" button
- Enter the full path to your Python script or browse for it
- Configure display name, arguments, and auto-restart options
- Click "Add Script"
-
Via Configuration File: Edit
py_manager/config.json
:{ "scripts": [ { "id": "my_script", "name": "My Awesome Script", "path": "C:/path/to/your/script.py", "args": ["--arg1", "value"], "auto_restart": true, "enabled": true, "max_memory_mb": 512, "log_file": "my_script.log" } ] }
- Start/Stop: Click the respective buttons on each script card
- View Logs: Click "View Logs" to see real-time output
- Bulk Actions: Use "Start All" or "Stop All" for multiple scripts
- Auto-restart: Enable to automatically restart failed scripts
Python Manager provides a REST API for automation:
import requests
# Base URL
base_url = "http://localhost:5000/api"
# Start a script
response = requests.post(f"{base_url}/scripts/my_script/start")
# Stop a script
response = requests.post(f"{base_url}/scripts/my_script/stop")
# Get all scripts status
response = requests.get(f"{base_url}/scripts/status")
print(response.json())
# Get logs
response = requests.get(f"{base_url}/scripts/my_script/logs?lines=50")
Method | Endpoint | Description |
---|---|---|
GET | /api/health |
Health check |
GET | /api/scripts |
List all scripts |
GET | /api/scripts/status |
Get status of all scripts |
POST | /api/scripts/{id}/start |
Start a script |
POST | /api/scripts/{id}/stop |
Stop a script |
POST | /api/scripts/{id}/restart |
Restart a script |
GET | /api/scripts/{id}/logs |
Get script logs |
POST | /api/scripts/add |
Add new script |
DELETE | /api/scripts/{id}/remove |
Remove script |
python deploy/setup.py
Follow the interactive prompts to set up Python Manager in your project.
- Clone to your server
- Set up as a systemd service (Linux) or Windows Service
- Configure authentication in
api_config.json
- Use a reverse proxy (nginx/Apache) for HTTPS
python deploy/create_package.py
This creates a distributable ZIP file with everything needed.
python-manager/
βββ start_manager.py # Main entry point
βββ allin1.py # All-in-one server
βββ requirements.txt # Python dependencies
βββ py_manager/ # Core modules
β βββ py_process.py # Process management
β βββ py_logger.py # Logging system
β βββ py_api.py # REST API
β βββ py_manager.html # Web interface
β βββ ...
βββ scripts/ # Example scripts
βββ logs/ # Log files
βββ deploy/ # Deployment tools
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask and Flask-SocketIO
- Process monitoring powered by psutil
- UI inspired by modern dashboard designs
- Create an Issue for bug reports or feature requests
- Check the Wiki for detailed documentation
- Join our Discussions for community support
- Docker support
- Script scheduling (cron-like functionality)
- Resource usage graphs
- Script dependencies management
- Email/webhook notifications
- Dark mode theme
- Multi-user support with authentication
Made with β€οΈ by the Python community