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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file entropy-calculator-0.0.1.tar.gz
.
File metadata
- Download URL: entropy-calculator-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb430b14207a4ee129f2a705bdbb0a6ee78dfbf9d8a15e887d8d82a2a1aefe77 |
|
MD5 | 8138f33735858fa21227858de23470ce |
|
BLAKE2b-256 | 0381a7ed15f7066c8cb1b670b537e425e192f98ba43aacdff2c7c2825e6de9e1 |
File details
Details for the file entropy_calculator-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: entropy_calculator-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1947c9be31b7bb00e8333df8fd87b82b7efc141c6c6640bd253c859aee4d63ab |
|
MD5 | 47ce9e025f00cac0a9e6475fb804c98b |
|
BLAKE2b-256 | 1443e35c2ffe8f49fcb3ae9fc1dd68a3c234c7838beb35431434d4e30361e587 |