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.21.tar.gz (10.9 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.21-cp314-cp314-macosx_15_0_universal2.whl (13.2 kB view details)

Uploaded CPython 3.14macOS 15.0+ universal2 (ARM64, x86-64)

File details

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

File metadata

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

File hashes

Hashes for getargv-0.21.tar.gz
Algorithm Hash digest
SHA256 c0e521c6153e21196fd7a886e66dccca71edb0507e007cd43127e279bc332c48
MD5 90398c43569c1fb13527b7c9784e9562
BLAKE2b-256 28e197a37bd9af1d14632a0b9e5d8517fbd6f7021c7a9fb23ffbda408697b517

See more details on using hashes here.

Provenance

The following attestation bundles were made for getargv-0.21.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.21-cp314-cp314-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for getargv-0.21-cp314-cp314-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 640b540ec4e1b0b7090d2d65a729bc20a679390a50e3e4d1aace5d7e96b6c1a7
MD5 220c86a5a430b90db4c097723c28313e
BLAKE2b-256 e1e1e06faae4e7fecbc5c8731379c5ba1654d8e8241ca6cf0a5aed581c6a2dee

See more details on using hashes here.

Provenance

The following attestation bundles were made for getargv-0.21-cp314-cp314-macosx_15_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