Metadata-Version: 2.1
Name: PTWordFinder
Version: 1.2.5
Summary: A command line tool that help to find specific words from a file  in any selected file.
Author: DarekRepos
License: MIT License
        
        Copyright (c) 2022 DarekRepos
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10.6
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: click>=8.1.3
Requires-Dist: attrs>=22.1.0
Requires-Dist: exceptiongroup>=1.0.4
Requires-Dist: iniconfig>=1.1.1
Requires-Dist: packaging>=21.3
Requires-Dist: pluggy>=1.0.0
Requires-Dist: pyparsing>=2.4.2
Requires-Dist: tomli>=2.0.1

PTWordFinder
============

“What specific words would you like to read?” Counting words in “Pan
Tadeusz” poem

It is a Python-based command-line tool designed to efficiently find and count occurrences of specific words within text files. It offers flexible input options, supporting both individual words, patterns and word lists in various formats.

Python version
--------------

tested with Python >= 3.10.6

Why
---

It was started as a project to exercise python language. The code helped
to find specific words in a selected file. It became command line tool
that help find any word within any file. The files can be selected by
command line

Install
----------

you can run the following command in your terminal to install the program from pip:

::

       pip install PTWordFinder

This will download and install the program, along with any required dependencies.


If you prefer, you can also install the program from source:

Clone the repository containing the program code:

::

       git clone https://github.com/DarekRepos/PanTadeuszWordFinder.git


Replace your-username with your actual username on GitHub.
Navigate to the cloned directory:

::

       cd  PanTadeuszWordFinder

This method requires poetry or Python build tools. If you don't have them, install poetry using pip install poetry or install your system's package manager's equivalent for build.
Install the program using poetry (https://python-poetry.org/):

::

       poetry install

The second method involves directly building the wheel and installing it, which is less commonly used.
Install the program directly:

::

       python -m build

::

       python -m pip install dist/PTWordFinder-*.whl

Note:

    If you install from source, you will need to have Python development tools installed. You can usually install these using your system's package manager.
    Installing from pip is the easiest and most recommended method for most users.



Usage: 
----------

::

       python word_counter.py [OPTIONS]
       Options:
        -w, --words-input-file FILE          File containing words to search for (mutually exclusive with --single-word)
        -s, --searched-file FILE              Path to the text file to search in (required)
        -w, --single-word WORD                Specific word to count (mutually exclusive with --words-input-file)
        -p, --pattern PATTERN                 Regular expression pattern to match
        -h, --help                            Show this help message and exit


Examples:
----------


Count the word "python" in my_text.txt:

::

       python word_counter.py --single-word python --searched-file my_text.txt

Find the frequency of all words in word_list.txt in large_file.txt:

::

       python word_counter.py --words-input-file word_list.txt --searched-file large_file.txt

Match instances of the regular expression [a-z0-9]{5} in passwords.txt:

::

       python word_counter.py --pattern "[a-z0-9]{5}" --searched-file passwords.txt
