Skip to main content

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 .

If you are on Windows ensure that you have either MS-Office or LibreOffice installed in the default locations for now. So "C:\Program Files\Microsoft Office" or "C:/Program Files/LibreOffice/"

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

Metadata

Release files for selected-words-counter 0.7

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

Source distribution (sdist)

Source distribution for selected-words-counter 0.7
File Size Uploaded
selected_words_counter-0.7.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for selected-words-counter 0.7
File Interpreter ABI Platform
selected_words_counter-0.7-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / selected_words_counter-0.7.tar.gz

Download URL selected_words_counter-0.7.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
936bb0b1c8e232c63878ec3b265a58d63c9423e1210f14b85d8abbba978aa15d
BLAKE2b-256 checksum
How to use checksums
df20bb60b00dd8b40aa9ad2110d688a70775812c6daa18f7310fbc690a3d984b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release files / selected_words_counter-0.7-py3-none-any.whl

Download URL selected_words_counter-0.7-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8867c67965cd015311bcb640a6de4db0b85d0a15c4e5de7c74541107b7a0a4c
BLAKE2b-256 checksum
How to use checksums
513eb3a43566115639b619a1b66f63af44e47b8516d6339c82db2b15626dea42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.7 This release

2 release files

0.6

2 release files

0.5

2 release files

0.4

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