Skip to main content
https://raw.githubusercontent.com/oskarfernlund/niteshade/master/docs/source/_figures/logo.png PyPI PyPI - Python Version PyPI - License

niteshade (/ˈnaɪt.ʃeɪd/) is a Python library for simulating data poisoning attack and defence strategies against online machine learning systems. The library is written in Python 3.10 and offers a simple and intuitive API which is heavily integrated with PyTorch’s machine learning framework.

For further details about the project, including background information, example usage and detailed API documentation, visit https://oskarfernlund.github.io/niteshade/.

Installation

niteshade requires Python 3.8 or higher.

niteshade binaries may be installed from PyPI using pip https://pypi.org/project/niteshade/.

$ pip install niteshade

Use of a virtual environment is strongly recommended.

Note: Installation with Anaconda is not currently available. Anaconda users should install niteshade with pip inside an Anaconda environment.

Usage

niteshade is a library of functions and classes which allow users to easily specify data poisoning attack and defence strategies and simulate their effects against online learning using PyTorch models. Detailed information regarding the python API and example usage can be found at https://oskarfernlund.github.io/niteshade/.

Dependencies

This project has separate package and developer dependencies, both of which can be found in the env/ directory in the form of requirements.txt and environment.yml files for pip and Anaconda users. Package dependencies (prefixed with “pkg”) consist exclusively of the packages required to use the library and are installed automatically when niteshade binaries are installed with pip. Developer dependencies (prefixed with “dev”), include the package dependencies as well as additional packages required for building the documentation, running tests, linting the source code and publishing releases.

$ cd env/

pip users:

$ pip install -r dev_requirements.txt # or pkg_requirements.txt

Anaconda users:

$ conda env create -f dev_environment.yml # or pkg_environment.yml

Building the Documentation

To build documentation in various formats, you will need Sphinx and the readthedocs theme (included in the developer dependencies). You can build the documentation by running make <format> from the docs/ directory. Run make to get a list of all available output formats.

$ cd docs/
$ make clean && make <format>

Running Unit and Integration Tests

This project uses pytest for unit and integration testing (included in the developer dependencies). The tests may be run from the root directory as follows:

$ pytest
...
===== x passed, x warnings in x.xx seconds =====

Package Releases

Package releases are published to PyPI automatically when a tag is pushed to GitHub.

$ export RELEASE=x.x.x
$ git commit --allow-empty -m "Release $RELEASE"
$ git tag -a $RELEASE -m "Version $RELEASE"
$ git push origin --tags

Contributors

niteshade was co-created by Mart Bakler, Oskar Fernlund, Alexandra Ntemourtsidou, Jaime Sabal-Bermudez and Mustafa Saleem in 2022 at Imperial College London. The authors may be contacted at the following email addresses:

Many thanks to Dr. Emil C. Lupu for all his insightful feedback and support.

Disclaimer: While niteshade is an open-source project and contributions are welcome, we cannot guarantee that the codebase will be actively maintained in the future.

License

niteshade uses the MIT license. Details regarding permissions to use and distribute the software may be found in the LICENSE file.

Release files for niteshade 0.1.4

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

Source distribution (sdist)

Source distribution for niteshade 0.1.4
File Size Uploaded
niteshade-0.1.4.tar.gz 56.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for niteshade 0.1.4
File Interpreter ABI Platform
niteshade-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 96.3 kB

Release files / niteshade-0.1.4.tar.gz

Download URL niteshade-0.1.4.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c17e5c94f6af9030b869f9def5a53f3e85b4d44c875fd27c35a9ed2364d1ff2b
BLAKE2b-256 checksum
How to use checksums
5dac9aed2c649eb3a6323c3c5c274de6d1563b0585dc82ed5324e9deca12a592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / niteshade-0.1.4-py3-none-any.whl

Download URL niteshade-0.1.4-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93584e1fd6704011b105a2fd73a3b1a7be0c596056ce542ece72db771834827e
BLAKE2b-256 checksum
How to use checksums
8bf58baf4151188db753a2d00c6fe521af64febc07976d14e1f8af43ac1999d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

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