Skip to main content
wordfreak logo

A Python library to extract word frequencies from files.

Main Build Last Commit

Supported File Types

File Extension Explanation Supported
.doc Microsoft Word document pre-2007 ❌
.docx Microsoft Word document post-2007 ✔️
.pdf Portable Document Format ✔️
.txt Plain text file ✔️

Installation

Use the package manager pip to install..

pip install wordfreak

Usage

import wordfreak

# Takes a text source and extracts the word frequencies from it in order from most -> least occurring.
# Extracts word frequencies from "inputFile.txt" and returns them as a Python dictionary.
wordFrequencies = wordfreak.extractWordFrequencies("C:\\inputFile.txt")

# If an output file path is given, it will also save the results there as JSON.
wordFrequencies = wordfreak.extractWordFrequencies("C:\\inputFile.txt", "C:\\outputFile.json")

# Takes a saved word frequencies JSON file and converts it to a Python dictionary.
# Loads word frequencies from "wordFrequencies.json" and returns them as a Python dictionary.
wordFrequencies = wordfreak.pythonizeWordFrequencies("C:\\wordFrequencies.json")

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for wordfreak 2.0.0

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

Source distribution (sdist)

Source distribution for wordfreak 2.0.0
File Size Uploaded Provenance Actions
wordfreak-2.0.0.tar.gz 5.7 kB Without provenance Details for wordfreak-2.0.0.tar.gz

Release files / wordfreak-2.0.0.tar.gz

Download URL wordfreak-2.0.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e202f95c35fbb3a2c888730b7ed0e9e0ed4783974240129f350bd15bcd09e30d
BLAKE2b-256 checksum
How to use checksums
b5b9ede64fb4db10534fff83e019daf75013e7081d000a11587cbb893936cc51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Security for wordfreak 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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