https://github.com/capsize-games/nullscream
Override modules with noop representations
https://github.com/capsize-games/nullscream
Last synced: 5 months ago
JSON representation
Override modules with noop representations
- Host: GitHub
- URL: https://github.com/capsize-games/nullscream
- Owner: Capsize-Games
- License: gpl-3.0
- Created: 2024-04-23T13:11:46.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-14T12:12:18.000Z (over 1 year ago)
- Last Synced: 2025-10-11T13:32:06.035Z (9 months ago)
- Language: Python
- Size: 1.17 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NULLSCREAM
---

[](https://github.com/Capsize-Games/nullscream/actions/workflows/python-publish.yml)
---
`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
```bash
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.
```python
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.
```python
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`
```python
import nullscream
nullscream.uninstall(blacklist=["requests"])
```
Now when you import requests, you will get the original requests library.
```python
import requests
print(requests.__doc__)
# Output: Original requests library docstring
```
---
## Testing
```bash
python -m unittest discover -s tests
```