Word Count Package (word-count-package)
========================================

A simple Python package that counts words & characters in any given text.
Useful for text processing, analytics, and word-based analysis. 🚀

Installation
------------

Install this package using pip:

.. code-block:: bash

    pip install word-count-package

Importing the Package
---------------------

Once installed, import it into your Python script:

.. code-block:: python

    import wordcount

Available Functions
-------------------

**count_words_and_chars(text)**  
This function counts words and characters in a given text.

Function Signature
------------------

.. code-block:: python

    wordcount.count_words_and_chars(text: str) -> dict

Parameters
----------
+-----------+---------+--------------------------------+
| Parameter | Type    | Description                    |
+===========+=========+================================+
| text      | str     | The input text to analyze      |
+-----------+---------+--------------------------------+


Returns
-------

This function returns a dictionary containing:

- **"words"** → Number of words in the text.
- **"characters"** → Number of characters in the text.

Example Usage
-------------

Create a Python script (e.g., `test_script.py`) and use the package:

.. code-block:: python

    import wordcount

    text = "Python packaging is fun and useful!"
    result = wordcount.count_words_and_chars(text)

    print(f"Words: {result['words']}, Characters: {result['characters']}")

✅ **Expected Output**:

.. code-block:: yaml

    Words: 6, Characters: 37

More Examples
-------------

.. code-block:: python

    result = wordcount.count_words_and_chars("Hello world!")
    print(result)

**Output:**

.. code-block:: python

    {'words': 2, 'characters': 12}

.. code-block:: python

    result = wordcount.count_words_and_chars("This is a Python package example.")
    print(result)

**Output:**

.. code-block:: python

    {'words': 6, 'characters': 35}

Updating the Package
--------------------

If a new version is released, upgrade using:

.. code-block:: bash

    pip install --upgrade word-count-package

Supported Environments
----------------------

✅ Windows (Command Prompt, PowerShell)  
✅ macOS (Terminal)  
✅ Linux (Bash, Zsh, etc.)  

Works with **Python 3.6+**.
