ShellContexts
A few useful context managers for temporarily changing the environment.
ModificationContext
`- chdir
`- set_umask
`- increase_umask
`- decrease_umask
`- seteuid
`- setegid
They are simple wrappers around the syscalls in their names. Therefore they are not thread-safe, so use them sanely. They are however reentry safe :)
chdir serves the same purpose as contextlib.chdir. It is here for completion-ist sake, and to demonstrate the abstraction provided by ModificationContext.
We decided to not add the rest to the standard library, in shutil or contextlib, whence I decided to make this package.
Installing
Available on PyPI as ShellContexts
$ pip install ShellContexts
Metadata
Release files for ShellContexts 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shellcontexts-1.0.0.tar.gz | 39.4 kB | Without provenance | Details for shellcontexts-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ShellContexts-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ShellContexts-1.0.0-py3-none-any.whl |
Total release size: 67.3 kB
Release files / shellcontexts-1.0.0.tar.gz
| Download URL | shellcontexts-1.0.0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59e92aa8e77a3da3a6e824d7d0ef83097c9f8ab1e9550dd06e9941dac41e495b
|
|
BLAKE2b-256 checksum How to use checksums |
aa864dd77274bcf5e577657e62e8e7463ac62e797a16f0e77ff870343af5f6c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / ShellContexts-1.0.0-py3-none-any.whl
| Download URL | ShellContexts-1.0.0-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbaed243edeb3dcea2b19290f7c0021bf9fe6f2f05d2ce1b9f79a6842c9f17ad
|
|
BLAKE2b-256 checksum How to use checksums |
2715a045c96efce59fbcd98cf913b9c2858346e321bb01eb9b2f362d759b85d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for ShellContexts 1.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.