Skip to main content

A Python tool that counts specific selected words in a directory of files of different file formats. Outputs the results in a .excel file

Project description

Selected Words Counter

Selected Words Counter is a Python tool that scans various file formats within a specified directory for occurrences of specific words from a predefined list, outputting the results in an organized Excel file.

How It Works

  1. File Conversion: The tool automatically converts supported file formats to .txt for streamlined text searching.
  2. Word Count Analysis: It then searches each converted file for the words in your word list, creating an Excel report where each column represents a word and each row represents a file, displaying the count of occurrences.

Getting Started

Prerequisites

  • Python 3.x
  • Necessary packages (see requirements.txt)

Installation

Clone this repository and install the dependencies:

git clone https://github.com/Provincie-Zuid-Holland/selected_words_counter.git
cd selected-words-counter
pip install -r requirements.txt
pip install -e .

Configuration

Customize the config.py file to specify:

  • Your target directory
  • Supported file formats
  • List of words to search for

Usage

Run the tool using:

python main.py

The output Excel file will be saved to the specified location, providing a summary of word counts per file.

Unit Tests

To run unit tests on synthetic data, navigate to the ./tests folder and run pytest:

cd tests
pytest

Author

Michael de Winter

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

selected_words_counter-0.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

selected_words_counter-0.4-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file selected_words_counter-0.4.tar.gz.

File metadata

  • Download URL: selected_words_counter-0.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for selected_words_counter-0.4.tar.gz
Algorithm Hash digest
SHA256 a979cc7d67597035ef8e809b07dea302194230e0d5c5c72e51b78784f7dc858c
MD5 278e2bf42119bb128277b12bfb4f032a
BLAKE2b-256 a6914a7af55457f06aef8f56cc81b48ce00434521560987f1ae59812bb7013d3

See more details on using hashes here.

File details

Details for the file selected_words_counter-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for selected_words_counter-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 874d398bffa6f2469ce7a27e705d09cbac2df171bf55d37bcb06d8ae3a5aa857
MD5 4a9e5290ef3f309c7dac9dc4b9679a08
BLAKE2b-256 686618152ca069a3fac055e81583227c26066dba1233190d286e8c260304209c

See more details on using hashes here.

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