# RegexAi
[![Release](https://img.shields.io/pypi/v/regexai?label=Release&style=flat-square)](https://pypi.org/project/regexai/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Open in Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/1hN9JohE5BdZrH5viCkDLfGF5pRI9S4KQ?usp=sharing)
RegexAI is a user-friendly library powered by generative AI, simplifying regular expression use. It interprets plain language regex queries, making data extraction and text manipulation easy. Whether you're a beginner or pro, RegexAI adapts to your needs, streamlining [regex](https://pypi.org/project/regex/) tasks for enhanced efficiency and accessibility.
## 🔧 Quick install
```bash
pip install regexai
```
## 🔍 Demo
Try out RegexAI in your browser :
[![Open in Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/1hN9JohE5BdZrH5viCkDLfGF5pRI9S4KQ?usp=sharing)
RegexAI is designed to be used in conjunction with regex. It makes regex conversational, allowing you to ask questions to your data in natural language.
### Queries
For example, you can ask RegexAI to Find words that contain the letter 'q' but not followed by 'u,' and replace them with the word 'quarantined.' from the user given paragraph :
```python
from regexai.pattern import apikey
# Sample paragraph and regex query
test_paragraph = """In a racecar, the radar detected an abnormal level of radioactive materials. Please contact support at support@example.com or visit our website at https://www.example.com. You can also reach us at +1 (123) 456-7890. For inquiries, please send an email to info@example.org. Remember, regex is a powerful tool that can validate 1234 different types of input data! Not all q
words are quirky, but regex can help you find them. Please enter your 16-digit credit card number: 4532015115898164."""
query = """ Find words that contain the letter 'q' but not followed by 'u,' and replace them with the word 'quarantined.' """
# Instantiate an object
od=apikey("your openai key")
print("Output : ", od.find_all(test_paragraph,query))
print("Generated Code for your Query : ")
print(od.get_pattern())
```
The above code will return the following:
```
Output : In a racecar, the radar detected an abnormal level of radioactive materials.
Please contact support at support@example.com or visit our website at https://www.example.com. You can also reach us at +1 (123) 456-7890. For inquiries, please send an email to info@example.org. Remember, regex is a powerful tool that can validate 1234 different types of input data! Not all quarantined words are quirky, but regex can help you find them.
Please enter your 16-digit credit card number: 4532015115898164.
Generated Code for your Query :
import re
result = re.sub(r'\bq(?!u)\w+\b', 'quarantined', da)
```
Of course, you can also ask RegexAI to perform more complex queries depending upon your need and requirements.
## 🔒 Privacy & Security
In order to protect your privacy and safety , we do not save any type of file or data on our side and the package totally runs on your local system.
## 🤝 Contributing
Contributions are welcome! Please check out the to-dos below, and feel free to open a pull request.
To-dos:
1. Connect with different file sources feteching from different databases.
2. Ideas to bypass token limit set by openai.
3. Multiagent capabilities to perform parallel operations on different chunk of text data.
4. Any contributions which you think can boost regexai use in your daily life.
For more information, please visit our [github page](https://github.com/riteshtambe/RegexAI).
After installing the virtual environment, please remember to install `pre-commit` to be compliant with our standards:
```bash
pre-commit install
```
## Contributors
[![Contributors](https://contrib.rocks/image?repo=riteshtambe/RegexAI)](https://github.com/riteshtambe/RegexAI/graphs/contributors)
## 📜 License
RegexAI is licensed under the MIT License. See the LICENSE file for more details.
## Acknowledgements
- This project is based on the regex library by independent contributors, but it's in no way affiliated with the regex project.
- This project is meant to be used as a tool for data extraction, feature processing from textual data, and it's not meant to be used for production purposes. Please use it responsibly.
Raw data
{
"_id": null,
"home_page": "",
"name": "regexai",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "openai,regex,pattern,text_analysis,text_preprocessing",
"author": "Shreyash Rote and Ritesh Tambe",
"author_email": "shreyashrote321@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b4/bd/4c117c36efaab26085ceca7e27fc8e750dc2fd8a2ce02ce980f7f0f51ade/regexai-0.0.13.tar.gz",
"platform": null,
"description": "# RegexAi \r\n\r\n[![Release](https://img.shields.io/pypi/v/regexai?label=Release&style=flat-square)](https://pypi.org/project/regexai/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Open in Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/1hN9JohE5BdZrH5viCkDLfGF5pRI9S4KQ?usp=sharing)\r\n\r\nRegexAI is a user-friendly library powered by generative AI, simplifying regular expression use. It interprets plain language regex queries, making data extraction and text manipulation easy. Whether you're a beginner or pro, RegexAI adapts to your needs, streamlining [regex](https://pypi.org/project/regex/) tasks for enhanced efficiency and accessibility.\r\n\r\n\r\n## \ud83d\udd27 Quick install\r\n\r\n```bash\r\npip install regexai\r\n```\r\n\r\n## \ud83d\udd0d Demo\r\n\r\nTry out RegexAI in your browser :\r\n\r\n[![Open in Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/1hN9JohE5BdZrH5viCkDLfGF5pRI9S4KQ?usp=sharing)\r\n\r\n\r\n\r\nRegexAI is designed to be used in conjunction with regex. It makes regex conversational, allowing you to ask questions to your data in natural language.\r\n\r\n### Queries\r\n\r\nFor example, you can ask RegexAI to Find words that contain the letter 'q' but not followed by 'u,' and replace them with the word 'quarantined.' from the user given paragraph :\r\n\r\n```python\r\nfrom regexai.pattern import apikey\r\n\r\n# Sample paragraph and regex query\r\ntest_paragraph = \"\"\"In a racecar, the radar detected an abnormal level of radioactive materials. Please contact support at support@example.com or visit our website at https://www.example.com. You can also reach us at +1 (123) 456-7890. For inquiries, please send an email to info@example.org. Remember, regex is a powerful tool that can validate 1234 different types of input data! Not all q\r\nwords are quirky, but regex can help you find them. Please enter your 16-digit credit card number: 4532015115898164.\"\"\" \r\nquery = \"\"\" Find words that contain the letter 'q' but not followed by 'u,' and replace them with the word 'quarantined.' \"\"\"\r\n\r\n# Instantiate an object\r\nod=apikey(\"your openai key\")\r\nprint(\"Output : \", od.find_all(test_paragraph,query))\r\nprint(\"Generated Code for your Query : \")\r\nprint(od.get_pattern())\r\n```\r\n\r\nThe above code will return the following:\r\n\r\n```\r\nOutput : In a racecar, the radar detected an abnormal level of radioactive materials.\r\nPlease contact support at support@example.com or visit our website at https://www.example.com. You can also reach us at +1 (123) 456-7890. For inquiries, please send an email to info@example.org. Remember, regex is a powerful tool that can validate 1234 different types of input data! Not all quarantined words are quirky, but regex can help you find them.\r\nPlease enter your 16-digit credit card number: 4532015115898164.\r\n\r\nGenerated Code for your Query : \r\nimport re\r\nresult = re.sub(r'\\bq(?!u)\\w+\\b', 'quarantined', da)\r\n```\r\n\r\nOf course, you can also ask RegexAI to perform more complex queries depending upon your need and requirements. \r\n\r\n## \ud83d\udd12 Privacy & Security\r\n\r\nIn order to protect your privacy and safety , we do not save any type of file or data on our side and the package totally runs on your local system.\r\n\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nContributions are welcome! Please check out the to-dos below, and feel free to open a pull request.\r\n\r\nTo-dos:\r\n1. Connect with different file sources feteching from different databases.\r\n2. Ideas to bypass token limit set by openai.\r\n3. Multiagent capabilities to perform parallel operations on different chunk of text data.\r\n4. Any contributions which you think can boost regexai use in your daily life.\r\n\r\nFor more information, please visit our [github page](https://github.com/riteshtambe/RegexAI).\r\n\r\nAfter installing the virtual environment, please remember to install `pre-commit` to be compliant with our standards:\r\n\r\n```bash\r\npre-commit install\r\n```\r\n\r\n## Contributors\r\n\r\n[![Contributors](https://contrib.rocks/image?repo=riteshtambe/RegexAI)](https://github.com/riteshtambe/RegexAI/graphs/contributors)\r\n\r\n## \ud83d\udcdc License\r\n\r\nRegexAI is licensed under the MIT License. See the LICENSE file for more details.\r\n\r\n## Acknowledgements\r\n\r\n- This project is based on the regex library by independent contributors, but it's in no way affiliated with the regex project.\r\n- This project is meant to be used as a tool for data extraction, feature processing from textual data, and it's not meant to be used for production purposes. Please use it responsibly.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Tranform regex into regexai",
"version": "0.0.13",
"project_urls": null,
"split_keywords": [
"openai",
"regex",
"pattern",
"text_analysis",
"text_preprocessing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "25fdd37caf2e88f74af1b03098b3fd8573d134b53bf3816bd18d4410399d557c",
"md5": "470846df7a7b4de148ba3bc97ecffb2e",
"sha256": "2b64c2cb87bea68c82335177da604907fa4376442e7b7adb1325d3ed1aa35010"
},
"downloads": -1,
"filename": "regexai-0.0.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "470846df7a7b4de148ba3bc97ecffb2e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5317,
"upload_time": "2023-11-02T10:25:09",
"upload_time_iso_8601": "2023-11-02T10:25:09.340437Z",
"url": "https://files.pythonhosted.org/packages/25/fd/d37caf2e88f74af1b03098b3fd8573d134b53bf3816bd18d4410399d557c/regexai-0.0.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b4bd4c117c36efaab26085ceca7e27fc8e750dc2fd8a2ce02ce980f7f0f51ade",
"md5": "3e40c3e5dc79187cdbf9f1053c52d074",
"sha256": "7cf4db590eb479fcac68735f242ee2e4b592e1cc1bdca81e900a9994e8cdc219"
},
"downloads": -1,
"filename": "regexai-0.0.13.tar.gz",
"has_sig": false,
"md5_digest": "3e40c3e5dc79187cdbf9f1053c52d074",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5053,
"upload_time": "2023-11-02T10:25:10",
"upload_time_iso_8601": "2023-11-02T10:25:10.915385Z",
"url": "https://files.pythonhosted.org/packages/b4/bd/4c117c36efaab26085ceca7e27fc8e750dc2fd8a2ce02ce980f7f0f51ade/regexai-0.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-02 10:25:10",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "regexai"
}