Skip to main content

Python bindings to libgetargv, a library to correctly and quickly get other process's args

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getargv-0.14.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getargv-0.14-cp313-cp313-macosx_14_0_universal2.whl (13.8 kB view details)

Uploaded CPython 3.13macOS 14.0+ universal2 (ARM64, x86-64)

File details

Details for the file getargv-0.14.tar.gz.

File metadata

  • Download URL: getargv-0.14.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for getargv-0.14.tar.gz
Algorithm Hash digest
SHA256 b387b1c66aa14f0080cc5a7ffa7c9cdfe91d3b80135fca5d89a1926e364d1f01
MD5 b5a2cd7a7c39a277cf2bc13f45c52823
BLAKE2b-256 ca53c5030f681d21208b6766e6ee29088f5b8fd0d20604cafeaf11f5d379d9b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for getargv-0.14.tar.gz:

Publisher: python-package.yml on getargv/getargv.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file getargv-0.14-cp313-cp313-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for getargv-0.14-cp313-cp313-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 355e6f0796ccd597dec6ee113ead689fc2be2ea592e5a5b5dc49f3f2f41d47d6
MD5 75b116e4018c9ecb2b91a539570e527f
BLAKE2b-256 3c41741b41e9a5fc27f2677921cd35bc78bbd6462806060f5c21ca4e052bf502

See more details on using hashes here.

Provenance

The following attestation bundles were made for getargv-0.14-cp313-cp313-macosx_14_0_universal2.whl:

Publisher: python-package.yml on getargv/getargv.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page