Skip to main content

py-sysctl is a wrapper for the sysctl* system functions. The core is written in C.

Examples

py-sysctl provides a very simple interface to access sysctls through the filter method.

Sysctls for CPU #0

>>> import sysctl
>>> sysctl.filter('dev.cpu.0')
[<Sysctl: dev.cpu.0.%desc>, <Sysctl: dev.cpu.0.%driver>, <Sysctl: dev.cpu.0.%location>, <Sysctl: dev.cpu.0.%pnpinfo>, <Sysctl: dev.cpu.0.%parent>, <Sysctl: dev.cpu.0.freq>, <Sysctl: dev.cpu.0.freq_levels>, <Sysctl: dev.cpu.0.cx_supported>, <Sysctl: dev.cpu.0.cx_lowest>, <Sysctl: dev.cpu.0.cx_usage>]

Inspect a sysctl

>>> import sysctl
>>> shmall = sysctl.filter('kern.ipc.shmall')[0]
>>> shmall.value
131072L
>>> shmall.tuneable
False
>>> shmall.writable
True

License

This python module is licensed under BSD 2 Clause, see LICENSE.

Metadata

Release files for sysctl 0.3.3

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

Source distribution (sdist)

Source distribution for sysctl 0.3.3
File Size Uploaded
sysctl-0.3.3.tar.gz 8.8 kB Details

Release files / sysctl-0.3.3.tar.gz

Download URL sysctl-0.3.3.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c3c6ce08be6e3181bb243f200a36644b2d4882913db204aeed2e2999543f8b00
BLAKE2b-256 checksum
How to use checksums
d54948e82ebcb5419c3703f7bbde69da1d0014abf62bb9f780049107bbf9d61a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7
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