Skip to main content

getargv

Python package

This module uses libgetargv to obtain binary string representations of the arguments of other processes on macOS.

Motivation

On macOS you must use the KERN_PROCARGS2 sysctl to obtain other proc's args, however the returned representation is badly documented and a naive approach doesn't deal with leading empty args. libgetargv parses the results of the sysctl correctly, and this module provides Python bindings to libgetargv.

Installation

Install the module with pip by executing:

$ pip install getargv

Usage

import os
import getargv
getargv.as_bytes(os.getpid()) #=> b'arg0\x00arg1\x00'
getargv.as_list(os.getpid()) #=> [b'arg0',b'arg1']

Development

After checking out the repo, run python setup.py build. Then run python setup.py install. Then, run python test.py to run the tests. You can also run python -i load.py for an interactive prompt that will allow you to experiment. Python code goes in the file src/getargv/__init__.py, C code goes in the file src/getargv/getargvmodule.c.

To install this module onto your local machine, run python setup.py build && python setup.py install. To release a new version, update the version number in pyproject.toml, and then run make upload-production, which will create a git tag for the version, push git commits and the created tag, and push the .whl file to pypi.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/getargv/getargv.py.

License

The module is available as open source under the terms of the BSD 3-clause License.

Metadata

Release files for getargv 0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getargv 0.22
File Size Uploaded Provenance Actions
getargv-0.22.tar.gz 11.0 kB With provenance Details for getargv-0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for getargv 0.22
File Interpreter ABI Platform Actions
getargv-0.22-cp315-cp315-macosx_26_0_universal2.whl CPython 3.15 CPython 3.15 macOS 26.0+ universal2 (ARM64, x86-64) Details for getargv-0.22-cp315-cp315-macosx_26_0_universal2.whl

Total release size: 24.3 kB

Release files / getargv-0.22.tar.gz

Download URL getargv-0.22.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8449a63dd5c4012974082fab8289c0ece6e96e3b6f8c20c9f5bb26090f902743
BLAKE2b-256 checksum
How to use checksums
755ac015d060355c1e95f44058b7c6c15f2fe8f843f61401a68db66726b54dca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / getargv-0.22-cp315-cp315-macosx_26_0_universal2.whl

Download URL getargv-0.22-cp315-cp315-macosx_26_0_universal2.whl
Size 13.2 kB
Tags CPython 3.15 macOS 26.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
3570cba3b0f2226ab95d40e9f348ab9aa362170842703ecce412c35b9b0ab1be
BLAKE2b-256 checksum
How to use checksums
dee5e2a94979d1550319e4a54fcf16509c72efc98c52f9674313a5065d58f1a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for getargv 0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for getargv-0.22.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page