--- id: pid version: "3.0.4" license: ASL license_treatment: permissive maintenance: abandoned --- # pid — Pidfile featuring stale detection and file-locking, can also be used as context-manager or decorator License: permissive · Maintenance: abandoned · Downloads: 191.6K/mo ## What it is and what it does pid is a lightweight library for creating and managing Unix-style process ID files. It wraps pidfile creation with stale detection (identifying leftover files from crashed processes), fcntl-based file locking to prevent concurrent execution, and permission control via chmod and chown. The package depends only on psutil. It supports three usage patterns: as a context manager (recommended for clean resource handling), as a decorator on functions, or integrated with daemon frameworks. The library handles signal cleanup via atexit and is designed to work with daemonization workflows. However, the project has been abandoned since its last release on 2020-07-18, so it receives no maintenance or updates. Use it for: - Enforce single-instance execution of a long-running service or batch job by locking a pidfile on startup - Detect and clean up stale pidfiles left behind after a process crash, preventing false 'already running' errors - Integrate pidfile management into a daemon context manager to coordinate process lifecycle with logging and signal handling - Decorate a main function to automatically acquire and release a pidfile without explicit context manager syntax - Manage process identity across fork operations in daemon scenarios where PID determination must happen at lock time ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Manages process ID files with stale detection, file locking, and permission control, available as a context manager or decorator for daemon and single-instance enforcement. Yes, if you need pidfile management for a daemon or single-instance application and can tolerate an unmaintained package. The code is stable and has no known vulnerabilities, but expect no fixes for compatibility issues or edge cases. For new projects, consider whether a more actively maintained alternative exists; for existing code already using pid, there is no urgent reason to migrate. ## Install pip install pid uv add pid poetry add pid ## Installing pid Before you install: Low install friction; pure Python wheel. Maintenance is abandoned—last release was 2020-07-18, so expect no updates for bugs or Python version changes, though the package is marked Production/Stable and has no known vulnerabilities. License in practice: Licensed under Apache Software License (permissive), so you can use, modify, and distribute freely with minimal restrictions. Quickstart: from pid import PidFile with PidFile('myapp') as p: print(p.pidname) # 'myapp' # Your application code here # PidFile cleaned up automatically on exit Verify before relying: - Whether the package works reliably with modern Python versions given no updates since 2020 - Whether fcntl-based locking behaves as expected on non-POSIX systems or in containerized environments - Compatibility with Python versions beyond 3.8 listed in classifiers ## Package facts - License: ASL (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 191.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pidfile management, process id file locking, daemon pidfile context manager, stale pid detection, single instance enforcement, pidfile decorator, fcntl-based pid locking, daemon-lifecycle, process-locking [View on SkillFed](https://skillfed.io/packages/pid) · [View on PyPI](https://pypi.org/project/pid/)