Skip to main content

No project description provided

Project description

NULLSCREAM


img.png

Upload Python Package


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nullscream-0.1.3.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distribution

nullscream-0.1.3-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page