skillfed

pyprctl

An interface to Linux's prctl() syscall written in pure Python using ctypes.

pyprctl v0.1.3 194.5K downloads/30d#9,832 on PyPI12
Permissive license MIT Abandoned released

What it is and what it does

pyprctl wraps Linux's prctl() system call in pure Python, letting you read and modify process attributes and capabilities directly from your code. It uses ctypes to call the underlying C function without requiring compiled extensions, making it portable across Python versions that support ctypes.

The package targets system-level operations—process scheduling hints, capability management, security attributes—that are typically needed in containerization, privilege management, or low-level process control. Because it is abandoned and has not been updated since 2021-10-26, it may not reflect changes to the prctl() API or Linux capabilities in newer kernels, and no security patches are forthcoming.

Use it for:

  • Drop or restrict Linux capabilities in a containerized application to reduce attack surface.
  • Set process dumpability or other security attributes before executing untrusted code.
  • Query or modify process scheduling hints and resource control attributes at runtime.
  • Implement privilege-dropping logic in a Python daemon without calling external commands.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a pure-Python interface to Linux's prctl() system call and Linux capabilities using ctypes, allowing direct manipulation of process attributes from Python code.

No. The project is abandoned with last commit on 2021-10-26 and no active maintenance or security patches. While it has low install friction and a permissive MIT license, the lack of updates means it may not work correctly with modern Linux kernels, and any bugs or security issues will not be fixed. Use only if you are certain your target environment is compatible and you can maintain a fork yourself.

Install

pyprctl on PyPI

pip

pip install pyprctl

uv

uv add pyprctl

poetry

poetry add pyprctl

Installing pyprctl

Before you install

Low install friction with a pure-Python wheel, but the project is abandoned—last commit was 2021-10-26. No active maintenance or security updates should be expected.

License in practice

MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pyprctl

import pyprctl

# Example: query process capabilities
caps = pyprctl.cap_get_proc()
print(caps)

Requires Linux; will not work on Windows, macOS, or other non-Linux systems. Also requires Python 3.6 or later.

Verify before relying

  • Whether the package works correctly on modern Linux kernels and distributions released after 2021-10-26.
  • Whether all prctl() operations and Linux capabilities are fully supported or only a subset.
  • Whether there are known incompatibilities with Python versions beyond 3.10.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 1 — dataclasses
Maintenance abandoned — 1,753 days since the last release
Last repo commit
First released
Downloads 194,527/month — #9,832 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyprctl-0.1.3-py3-none-any.whl

Keywords: prctl

License :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

linux prctl system callprocess capabilities controllinux process attributesctypes prctl wrapperprocess resource limitslinux capabilities pythonprctl interface
linux-syscallprocess-controlabandoned

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

pyseccomp

pyseccomp provides a pure-Python interface to…

permissive · top 5,000 on PyPI

jaraco.windows

Provides a pure-Python interface to Windows…

permissive · top 15,000 on PyPI

PyRIC

PyRIC provides programmatic control over Linux…

copyleft · top 15,000 on PyPI

pywin32-ctypes

A pure-Python reimplementation of pywin32 that…

permissive · top 5,000 on PyPI

ghostscript

Provides a Python interface to the Ghostscript…

copyleft · top 15,000 on PyPI

pyftdi

PyFtdi provides a pure-Python user-space driver…

permissive · top 15,000 on PyPI

cwrap

cwrap is a Python wrapper around C code that…

copyleft · top 15,000 on PyPI

python-xmp-toolkit

Read and write XMP metadata in image and…

permissive · top 15,000 on PyPI

comtypes

comtypes is a pure Python library for defining,…

permissive · top 5,000 on PyPI

libpci

Provides Python bindings to libpci, allowing…

copyleft · top 15,000 on PyPI