No project description provided
Project description
NULLSCREAM
nullscream
is a simple library that allows you to
import noop functions and classes that you can use as drop in replacements for functions you wish to override.
This allows anything on the blacklist to be importable, but not executable.
Installation
pip install nullscream
Usage
Import the install_nullscream
function the top of your main entry file (e.g. main.py
), import nullscream
before
importing any other libraries.
import nullscream
nullscream_blacklist = ["requests"]
nullscream.activate(
blacklist=nullscream_blacklist,
)
Now when you import requests, you will get a noop version of the requests library.
import requests
print(requests.__doc__)
# Output:
# This is a noop stand-in module.
print(requests.foobar())
# Output:
# MagicType instance
You can uninstall the noop module by calling uninstall_nullscream
import nullscream
nullscream.uninstall(blacklist=["requests"])
Now when you import requests, you will get the original requests library.
import requests
print(requests.__doc__)
# Output: Original requests library docstring
Testing
python -m unittest discover -s tests
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file nullscream-0.1.3.tar.gz
.
File metadata
- Download URL: nullscream-0.1.3.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5485bac1e227b6860d52c23d73a8224e45c848f49f19b28cafb9d2e641c1e9a1 |
|
MD5 | ae044c1301cbeb29645a0d0c4fe4ef9b |
|
BLAKE2b-256 | 09d8d8db9cfd7f0aadd7a448d1a1d8918838a4488954f55f05a5a6a3fd0dfc81 |
File details
Details for the file nullscream-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: nullscream-0.1.3-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda4bf7887ebb8af29ada7020a418ccc5a29e579781eafc2af881b140ea1c6a2 |
|
MD5 | 4fe1e6c4c2a6207b32ce6ec9c5060ecb |
|
BLAKE2b-256 | 0d16d99d74817e607e6c15cf0be652647e9182b02d2519b0471af545564ecae0 |