
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
keytext is an all-in-one versatile and efficient Python package designed for keyword-based text search, manipulation, and data cleansing. Whether you need to extract contextual information around specific keywords, remove unwanted terms from texts and dataframes, precisely locate the positions of keywords within a Pandas DataFrame, replacing single or a set of keywords, keytext is your indispensable toolkit for advanced robust toolkit text analysis and data management.
Here are just a few of the things that keytext does well:
PyPI
pip install keytext
- text (str): The input text
- keywords (str or list): The keyword or a list of keywords to count occurrences for
- Returns a dictionary mapping each keyword to its frequency in the text
- text (str): The input text
- keyword (str or list): The keyword or a list of keywords to be replaced
- replacement (str or list): The replacement string or a list of replacement strings corresponding to the keyword(s)
- Returns the text with replacements
- text (str): The input text
- keyword (str): The keyword need to be searched
- Return all starting and ending position of the keyword from a text
- Output will be in list of tuples
- text (str): The input text
- keyword (str): The keyword need to be searched in the sentences of given text
- format (str): By default format is l, that means list of sentences. If we pass p then the outpt format will be paragraph.
- This function extract all the sentences from a giuven text that contain the keyword
- text (str): The input text
- keyword (str): The keyword need to be searched in the given text
- left (int): The number of words from the left side of the keyword
- right (int): The number of words from the right side of the keyword
- This function extract the neighbourhood words of the keyword from a given text.
- In case of left_w = 0, right_w = n it will provide n number of words from the right side of the keyword
- In case of left_w = m, right_w = 0 it will provide m number of words from the left side of the keyword
- In case of left_w = m, right_w = n it will provide m left words and n right words of the keyword
- text (str): The input text
- keyword (str): The keyword need to be searched in the given text
- left_chr (int): The number of charecters from the left side of the keyword
- right_chr (int): The number of charecters from the right side of the keyword
- This function extract the neighbourhood charecters of the keyword from a given text.
- In case of left_chr = 0, right_chr = n it will provide n number of charecters from the right side of the keyword
- In case of left_chr = m, right_chr = 0 it will provide m number of charecters from the left side of the keyword
- In case of left_chr = m, right_chr = n it will provide m left charecters and n right charecters of the keyword
- text (str): The input text
- keyword (str): The keyword need to be searched in the given text
- occurrence (int or str): The number of charecters from the left side of the keyword, Occurene should be 1,2,...,n,'all'
- This function will return the left side of the keyword i.e. from the keyword to beginning of the text based on all occurence of keyword
- If we pass the 1 or 2 in occurence then it will return the left side text of 1st or 2nd occurence of the keyword from a text
- Provid the output in list format if occurence is "all"
- text (str): The input text
- keyword (str): The keyword need to be searched in the given text
- occurrence (int or str): The number of charecters from the left side of the keyword, Occurene should be 1,2,...,n,'all'
- occurence means the repeation of the keyword in text
- This function will return the right side of the keyword i.e. from the keyword to ending of the text based on all occurence of keyword
- If we pass the 1 in occurence then it will return the right side text of 1st occurence of the keyword from a text
- Provid the output in list format if occurence is "all"
- text (str): The input text
- keyword (str): The keyword replicating in given text
- Provide the part of the text between two same keyword
- Output will come in list format
- text (str): The input text
- keyword_start (str): The starting keyword
- keyword_end (str): The ending keyword that should be different from strating keyword
- keyword_start_occurence (int): indicates the the repeatition of the starting keyword in given string
- keyword_end_occurence (int): indicates the the repeatition of the ending keyword in given string
- Provide the part of the text between two distinct keyword
- Output will come in list format
- For getting all snap texts in list format pass keyword_start_occurence = 0 and keyword_end_occurence = 0
- text (str): The input text
- remover_list (list): List of keywords along with regex patterns need to be removed
- replaced_by (str): Replacing the unwanted list of keyword or patterns with some special charecters like space(" ")
- Non alphanumeric charecters need to be write in regex format
- Return the text after removing the unranted keyword or patterns
- text (str): The input text
- pattern_list (list): List of regex patterns need to be searched within the text
- It will return the matched word with location
- dataframe (dataframe): The input table
- keyword (str): The keyword need to be searched in the dataframe
- Return all cells position of the keyword from a giuven dataframe
- Output will be in list of tuples
- dataframe (dataframe): The input table
- remover_list (list): List of keywords along with regex patterns need to be removed
- replaced_by (str): Replacing the unwanted list of keyword or patterns with some special charecters like space(" ")
- This function remove the keyword from the dataframe
- Non alphanumeric charecters need to be write in regex format
- dataframe (dataframe): The input table
- pattern (str): List of regex patterns need to be searched within the dataframe
- This function find the list of regex patterns from the dataframe
- It will return the matched word with cell identity
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. Feel free to ask questions on the mailing list
FAQs
Keyword based text extraction Pacakage (keytext)
We found that keytext demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.