Count the number of occurrences of a word in a text file
Project description
pycounts_gf
Calculate word counts in a text file!
Installation
$ pip install pycounts_gf
Usage
pycounts_gf
can be used to count words in a text file and plot results
as follows:
from pycounts_gf.pycounts_gf import count_words
from pycounts_gf.plotting import plot_words
import matplotlib.pyplot as plt
file_path = "test.txt" # path to your file
counts = count_words(file_path)
fig = plot_words(counts, n=10)
plt.show()
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
pycounts_gf
was created by Gabe Fairbrother. It is licensed under the terms
of the MIT license.
Credits
pycounts_gf
was created with
cookiecutter
and
the py-pkgs-cookiecutter
template.
package originally based on this tutorial
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 pycounts_gf-1.0.tar.gz
.
File metadata
- Download URL: pycounts_gf-1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa6e0061f3cbba79c53e477e203e871ad2c5c9c685ad6b1f5c72aa23e1a5408 |
|
MD5 | 6bc6cfa978a5f06cdaeea42e8a51ca4e |
|
BLAKE2b-256 | fc6665e6798bb129e68eaa559f43bc76f04267064ef72c22904b186e158784fe |
File details
Details for the file pycounts_gf-1.0-py3-none-any.whl
.
File metadata
- Download URL: pycounts_gf-1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.9.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db1912789656081fdd5f19856614f4893062d60299aaaedeea3ef7daff28a58 |
|
MD5 | 45c8d119a30807008f0e2b6b70918f07 |
|
BLAKE2b-256 | 8fd2f40463f904e3ec0bbe157bb5bd058788cee1adb27312906a37509213ff40 |