Metadata-Version: 2.1
Name: entropy-calculator
Version: 0.0.1
Summary: Calculate entropy
Home-page: https://github.com/fionn/entropy
Author: Fionn Fitzmaurice
Project-URL: Source Code, https://github.com/fionn/entropy
Project-URL: Changelog, https://github.com/fionn/entropy/tags
Project-URL: Documentation, https://github.com/fionn/entropy/blob/master/README.md
Project-URL: Bug Tracker, https://github.com/fionn/entropy/issues
Project-URL: PyPI, https://pypi.org/project/entropy/
Project-URL: Download, https://github.com/fionn/entropy/archive/refs/heads/master.zip
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev

# Entropy

Calculate the information entropy of a string, file, etc.

## Installation

Install with `pip`

## Usage

### Command Line

Basic usage: `entropy [-h] [-f FILE | -t TEXT | -p] [-b BASE] [-s] [-m]`.

Requires one of `--shannon` (to calculate the Shannon entropy)
or `--metric` (to calculate the Shannon entropy normalised by input size).

Takes input fdom stdin by default, but can read from a file with `--file`
or from the `--text` argument.

Entropy is calculated in base 2 by default, but this can be changed with `--base`.

See `--help` for extended command line usage.

### Module

Importing provides an `Entropy` class which takes bytes and a base (both optional)
and exposes methods `shannon` and `metric` to calculate the Shannon and normalised entropy.
The data can be updated with the `update` method.
