Python bindings to libgetargv, a library to correctly and quickly get other process's args
Project description
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file getargv-0.20.tar.gz.
File metadata
- Download URL: getargv-0.20.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25d11a0171b748acb020bdc46d930d751ef8d795ed7d88b18745ab55df24c3a1
|
|
| MD5 |
8145b3d3871333ca5859a42c2d9e6779
|
|
| BLAKE2b-256 |
f0eed6c11ec2fd07dcce1dc1f3e80542ad73a652663c7d5490a73b1da550d20d
|
Provenance
The following attestation bundles were made for getargv-0.20.tar.gz:
Publisher:
python-package.yml on getargv/getargv.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
getargv-0.20.tar.gz -
Subject digest:
25d11a0171b748acb020bdc46d930d751ef8d795ed7d88b18745ab55df24c3a1 - Sigstore transparency entry: 599857827
- Sigstore integration time:
-
Permalink:
getargv/getargv.py@22711321094df44b1d66bdb51f3a420261668bf7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/getargv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@22711321094df44b1d66bdb51f3a420261668bf7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file getargv-0.20-cp314-cp314-macosx_15_0_universal2.whl.
File metadata
- Download URL: getargv-0.20-cp314-cp314-macosx_15_0_universal2.whl
- Upload date:
- Size: 13.2 kB
- Tags: CPython 3.14, macOS 15.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e47986a7fd666c05e7de18f9d18ec3a96b4354b8e10d66a9da96996ddc73e02
|
|
| MD5 |
415b78ae12dec25425ba2ad8c866da4b
|
|
| BLAKE2b-256 |
79d1c7cf56cd2ef2ec98d7a28c68af18aae9f95d572ff7d7964ac4796b3255bd
|
Provenance
The following attestation bundles were made for getargv-0.20-cp314-cp314-macosx_15_0_universal2.whl:
Publisher:
python-package.yml on getargv/getargv.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
getargv-0.20-cp314-cp314-macosx_15_0_universal2.whl -
Subject digest:
6e47986a7fd666c05e7de18f9d18ec3a96b4354b8e10d66a9da96996ddc73e02 - Sigstore transparency entry: 599857851
- Sigstore integration time:
-
Permalink:
getargv/getargv.py@22711321094df44b1d66bdb51f3a420261668bf7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/getargv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@22711321094df44b1d66bdb51f3a420261668bf7 -
Trigger Event:
push
-
Statement type: