pid
Pidfile featuring stale detection and file-locking, can also be used as context-manager or decorator
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
ASL (permissive) — Licensed under Apache Software License (permissive), so you can use, modify, and distribute freely with minimal restrictions.
last release 2020-07-18 (2218 days) · last repo commit 2022-11-04 · 105 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 191,560 downloads/mo, #9,881 on PyPI
Alternatives
Verify before relying
from pid import PidFile
with PidFile('myapp') as p:
print(p.pidname) # 'myapp'
# Your application code here
# PidFile cleaned up automatically on exit- 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
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 on this page. Verify before relying on it.
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
pid on PyPI
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 | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepsutil |
| Maintenance | Abandoned 2,218 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 191,560 / month, #9,881 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: PyPy |
Evidence: pid-3.0.4-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pidfile management”
- pidManages process ID files with stale detection, file locking, and…
- azure-mgmt-managementpartnerProvides a Python client library for managing Azure Management…
- smpSerializes and deserializes the Simple Management Protocol (SMP),…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also dumb-init · python-daemon · zc.lockfile · simple-pid · daemonize · portalocker · filelock · flufl.lock · redlock-py · systemd-python