Skip to main content

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.

Metadata

Release files for entropy-calculator 0.0.1

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

Source distribution (sdist)

Source distribution for entropy-calculator 0.0.1
File Size Uploaded
entropy-calculator-0.0.1.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entropy-calculator 0.0.1
File Interpreter ABI Platform
entropy_calculator-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / entropy-calculator-0.0.1.tar.gz

Download URL entropy-calculator-0.0.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eb430b14207a4ee129f2a705bdbb0a6ee78dfbf9d8a15e887d8d82a2a1aefe77
BLAKE2b-256 checksum
How to use checksums
0381a7ed15f7066c8cb1b670b537e425e192f98ba43aacdff2c7c2825e6de9e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release files / entropy_calculator-0.0.1-py3-none-any.whl

Download URL entropy_calculator-0.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1947c9be31b7bb00e8333df8fd87b82b7efc141c6c6640bd253c859aee4d63ab
BLAKE2b-256 checksum
How to use checksums
1443e35c2ffe8f49fcb3ae9fc1dd68a3c234c7838beb35431434d4e30361e587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.0.1 This release

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