Professional Python wrapper for PM2 (Process Manager 2) with async support
Project description
๐ PM2 Python Library
Professional Python wrapper for PM2 Process Manager
๐ฅ Project Homepage | ๐ Complete Documentation
โ ๏ธ IMPORTANT: This project received its first major update since January 2024, featuring a complete rewrite from scratch. The previous buggy version has been entirely redesigned and significantly improved. Please refer to the new documentation site for the latest information.
๐ Language: ๐บ๐ธ English | ๐น๐ท Tรผrkรงe
โจ Overview
A powerful, production-ready Python library that provides seamless integration with PM2 Process Manager - the industry-standard runtime process manager for Node.js applications. This library extends PM2's capabilities to Python environments, enabling developers and system administrators to programmatically control their processes with the reliability and flexibility of Python.
PM2 is a battle-tested, feature-rich production process manager that has been trusted by thousands of companies worldwide to manage their Node.js applications in production environments. Our Python wrapper brings this enterprise-grade process management power directly to your Python applications and scripts.
๐ฏ Perfect for: Web applications, microservices, background tasks, data processing pipelines, and production deployments.
๐จ New Version Notice
This library received its first major update since January 2024 and has been completely rewritten from scratch to address all issues from the previous version. The new version features:
- Complete code rewrite with modern Python practices
- Enhanced reliability and error handling
- Comprehensive documentation at docs.yakupkaya.me/pm2
- Professional project page at projects.yakupkaya.me/pm2
๐ Key Features
| Feature | Description |
|---|---|
| ๐ Complete Process Control | Start, stop, restart, reload, and delete processes |
| โก Async & Sync Support | Both synchronous and asynchronous interfaces |
| ๐ Real-time Monitoring | CPU, memory, uptime, and performance metrics |
| ๐ก๏ธ Production Ready | Comprehensive error handling and robust architecture |
| ๐ง Flexible Configuration | Environment variables, custom settings, and deployment options |
| ๐ Rich Process Info | Detailed insights including logs, status, and health metrics |
๐ Documentation
๐ Please visit our main documentation site for complete information:
- ๐ Project Homepage - Official project page
- ๐ Main Documentation - Complete guide and tutorials
- ๐ฅ Examples - Practical code examples
- โ๏ธ Advanced Usage - Advanced patterns and configurations
- ๐ง Troubleshooting - Solutions to common issues
๐ฆ Installation
# Install from PyPI (recommended)
pip install pm2
# Or install from source
git clone https://github.com/y4kupkaya/PM2.git
cd PM2
pip install -e .
โก Quick Start
from pm2 import PM2Manager
# Initialize PM2 manager
pm2 = PM2Manager()
# Start a process
process = pm2.start_app(
script="app.py",
name="my-app",
env={"PORT": "3000"}
)
# Monitor the process
print(f"Status: {process.status}")
print(f"CPU: {process.metrics.cpu}%")
print(f"Memory: {process.metrics.memory_mb} MB")
# List all processes
for proc in pm2.list_processes():
print(f"{proc.name}: {proc.status}")
๐ Why Choose PM2 Python Library?
- ๐ฏ Production Ready - Battle-tested in production environments
- ๐ High Performance - Optimized for minimal overhead
- ๐ Type Safe - Full type hints and mypy compatibility
- ๐งช Well Tested - Comprehensive test suite with 95%+ coverage
- ๐ Great Documentation - Extensive docs with real-world examples
๐ Prerequisites
PM2 must be installed on your system. PM2 is the world's most popular production process manager for Node.js applications, trusted by companies like Microsoft, IBM, and Netflix for managing critical production workloads.
# Install PM2 globally
npm install -g pm2
# Verify installation
pm2 --version
About PM2: PM2 (Process Manager 2) is an advanced, production-grade runtime and process manager for Node.js applications. It provides features like automatic restarts, load balancing, memory monitoring, and seamless deployments. Learn more at pm2.keymetrics.io.
๐ง Advanced Usage
For advanced patterns, async operations, production deployments, and complex configurations, visit our Advanced Usage Guide.
๐ Troubleshooting
Having issues? Check our Troubleshooting Guide for solutions to common problems.
๐ค Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
๐ Acknowledgments
- PM2 Team - For creating the amazing PM2 process manager
- Community Contributors - Thank you for your valuable contributions
- Users - For testing and providing feedback to make this library better
๐ Support
- ๐ Project Homepage
- ๐ Documentation
- ๐ Issue Tracker
- ๐ง Author Website
Made with โค๏ธ by Yakup Kaya
Project details
Release history Release notifications | RSS feed
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 pm2-1.0.0.tar.gz.
File metadata
- Download URL: pm2-1.0.0.tar.gz
- Upload date:
- Size: 42.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ec6efa707a6683e3b1f55e4651370e72a5a02525ab46a813e9608965912efc0
|
|
| MD5 |
401088c38df16b5b9aea17f5fe65f137
|
|
| BLAKE2b-256 |
0229bd00d21b816852b50a81db119c7b7aca7088e195ca3ad8936bf574b8d89e
|
File details
Details for the file pm2-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pm2-1.0.0-py3-none-any.whl
- Upload date:
- Size: 38.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80930d92c5750f89397ff1e25a18dc0a1d69bb43080a581a54c0131047979cd3
|
|
| MD5 |
26778b2f18ebbb1abb7d84a8ec543793
|
|
| BLAKE2b-256 |
b20fa0c96fac75a7204057684f1686dc97d536b7ad871c99d8656174ce6a0ce2
|