Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

selected-words-counter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selected-words-counter

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

  • 0.7
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc