Skip to main content

Calculate entropy

Project description

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.

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

entropy-calculator-0.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

entropy_calculator-0.0.1-py3-none-any.whl (3.4 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