
<p align="center">
<a href="https://pypi.org/project/swarmauri_tool_searchword/">
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_searchword" alt="PyPI - Downloads"/></a>
<a href="https://github.com/swarmauri/swarmauri-sdk/pkgs/pkgs/community/swarmauri_tool_searchword">
<img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/swarmauri/swarmauri-sdk/pkgs/pkgs/community/swarmauri_tool_searchword&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false" alt="GitHub Hits"/></a>
<a href="https://pypi.org/project/swarmauri/swarmauri_tool_searchword">
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_searchword" alt="PyPI - Python Version"/></a>
<a href="https://pypi.org/project/swarmauri/swarmauri_tool_searchword">
<img src="https://img.shields.io/pypi/l/swarmauri_tool_searchword" alt="PyPI - License"/></a>
<br />
<a href="https://pypi.org/project/swarmauri/swarmauri_tool_searchword">
<img src="https://img.shields.io/pypi/v/swarmauri_tool_searchword?label=swarmauri_tool_searchword&color=green" alt="PyPI - swarmauri_tool_searchword"/></a>
</p>
---
# `swarmauri_tool_searchword`
A tool for extracting the number of occurances of a word or phrase (case insensitive) within a file.
## Installation
To install the `swarmauri_tool_searchword` package, you can use pip. Ensure that you have Python 3.10 or newer installed on your system. You can install the package directly from PyPI using the following command:
```bash
pip install swarmauri_tool_searchword
```
If you are using Poetry for dependency management, you can add it to your project by executing:
```bash
poetry add swarmauri_tool_searchword
```
## Usage
The `swarmauri_tool_searchword` package provides a single class, `SearchWordTool`, to search for specific words or phrases within a file. Below is an example of how to use it.
### Example
```python
from swarmauri_tool_searchword import SearchWordTool
# Create an instance of the SearchWordTool
search_tool = SearchWordTool()
# Specify the file path and the search word
file_path = 'path/to/your/file.txt'
search_word = 'your_search_term'
# Execute the search
result = search_tool(file_path=file_path, search_word=search_word)
print(f"Occurrences of '{search_word}': {result['count']}")
for line in result['lines']:
print(line)
```
### Functionality
1. **Create an Instance**: Instantiate the `SearchWordTool` class.
2. **Specify Parameters**: Provide the file path and the word or phrase you want to search.
3. **Execute the Search**: Call the instance with the specified parameters to get the occurrences.
This package highlights the occurrences of the search term in the output, making it easy to identify where the term appears in the text.
Raw data
{
"_id": null,
"home_page": null,
"name": "swarmauri_tool_searchword",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": "search, tool, word, phrase, file, highlight, swarmauri",
"author": "Vijay Vignesh Prasad Rao",
"author_email": "vijayvigneshp02@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/df/65/2f94351113bd8dc3030b7e63198f3b591f663c4a15757081e1a6831e48ad/swarmauri_tool_searchword-0.1.1.tar.gz",
"platform": null,
"description": "\n\n<p align=\"center\">\n <a href=\"https://pypi.org/project/swarmauri_tool_searchword/\">\n <img src=\"https://img.shields.io/pypi/dm/swarmauri_tool_searchword\" alt=\"PyPI - Downloads\"/></a>\n <a href=\"https://github.com/swarmauri/swarmauri-sdk/pkgs/pkgs/community/swarmauri_tool_searchword\">\n <img src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/swarmauri/swarmauri-sdk/pkgs/pkgs/community/swarmauri_tool_searchword&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false\" alt=\"GitHub Hits\"/></a>\n <a href=\"https://pypi.org/project/swarmauri/swarmauri_tool_searchword\">\n <img src=\"https://img.shields.io/pypi/pyversions/swarmauri_tool_searchword\" alt=\"PyPI - Python Version\"/></a>\n <a href=\"https://pypi.org/project/swarmauri/swarmauri_tool_searchword\">\n <img src=\"https://img.shields.io/pypi/l/swarmauri_tool_searchword\" alt=\"PyPI - License\"/></a>\n <br />\n <a href=\"https://pypi.org/project/swarmauri/swarmauri_tool_searchword\">\n <img src=\"https://img.shields.io/pypi/v/swarmauri_tool_searchword?label=swarmauri_tool_searchword&color=green\" alt=\"PyPI - swarmauri_tool_searchword\"/></a>\n</p>\n\n---\n\n# `swarmauri_tool_searchword`\n\nA tool for extracting the number of occurances of a word or phrase (case insensitive) within a file. \n\n## Installation\n\nTo install the `swarmauri_tool_searchword` package, you can use pip. Ensure that you have Python 3.10 or newer installed on your system. You can install the package directly from PyPI using the following command:\n\n```bash\npip install swarmauri_tool_searchword\n```\n\nIf you are using Poetry for dependency management, you can add it to your project by executing:\n\n```bash\npoetry add swarmauri_tool_searchword\n```\n\n## Usage \n\nThe `swarmauri_tool_searchword` package provides a single class, `SearchWordTool`, to search for specific words or phrases within a file. Below is an example of how to use it.\n\n### Example\n\n```python\nfrom swarmauri_tool_searchword import SearchWordTool\n\n# Create an instance of the SearchWordTool\nsearch_tool = SearchWordTool()\n\n# Specify the file path and the search word\nfile_path = 'path/to/your/file.txt'\nsearch_word = 'your_search_term'\n\n# Execute the search\nresult = search_tool(file_path=file_path, search_word=search_word)\nprint(f\"Occurrences of '{search_word}': {result['count']}\")\nfor line in result['lines']:\n print(line)\n\n```\n\n### Functionality\n\n1. **Create an Instance**: Instantiate the `SearchWordTool` class.\n2. **Specify Parameters**: Provide the file path and the word or phrase you want to search.\n3. **Execute the Search**: Call the instance with the specified parameters to get the occurrences.\n\nThis package highlights the occurrences of the search term in the output, making it easy to identify where the term appears in the text.\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A tool for searching a specific word or phrase in a file.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"search",
" tool",
" word",
" phrase",
" file",
" highlight",
" swarmauri"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d3f6f501c22b799ccc17a27c1938ea664a7da59a7a278742e43bea388ab4b615",
"md5": "faaa30830f21f691c36becc618944a03",
"sha256": "a5e5fbf108f77c0f9ca708d705ad742d7e2ce350c4f36c72b74e882589d70006"
},
"downloads": -1,
"filename": "swarmauri_tool_searchword-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "faaa30830f21f691c36becc618944a03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 8336,
"upload_time": "2025-05-23T11:59:01",
"upload_time_iso_8601": "2025-05-23T11:59:01.699041Z",
"url": "https://files.pythonhosted.org/packages/d3/f6/f501c22b799ccc17a27c1938ea664a7da59a7a278742e43bea388ab4b615/swarmauri_tool_searchword-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "df652f94351113bd8dc3030b7e63198f3b591f663c4a15757081e1a6831e48ad",
"md5": "40410ed6f1ccc8d2d986965385bfbeed",
"sha256": "acc37dd15cd728ad97af6cb79154f161cbc8b74aad754fbe03c8ddb00e933e7d"
},
"downloads": -1,
"filename": "swarmauri_tool_searchword-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "40410ed6f1ccc8d2d986965385bfbeed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 7590,
"upload_time": "2025-05-23T11:59:02",
"upload_time_iso_8601": "2025-05-23T11:59:02.505677Z",
"url": "https://files.pythonhosted.org/packages/df/65/2f94351113bd8dc3030b7e63198f3b591f663c4a15757081e1a6831e48ad/swarmauri_tool_searchword-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-05-23 11:59:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "swarmauri_tool_searchword"
}