-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boosted performance to hundreds with lazy stati caching
- Loading branch information
1 parent
59d5ddd
commit 6aefebd
Showing
6 changed files
with
106 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ crate-type = ["cdylib"] | |
[dependencies] | ||
pyo3 = "0.21.1" | ||
regex = "1.10.5" | ||
lazy_static = "1.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,61 @@ | ||
<div align="center"> | ||
<img src="https://svgshare.com/i/17F2.svg" height="300"> | ||
<img src="https://svgshare.com/i/17F2.svg" height="300" alt="flpc logo"> | ||
|
||
# flpc | ||
<img alt="Star" src="https://img.shields.io/badge/Please%20Give%20A%20Star%20%E2%AD%90-30323D"> | ||
<img alt="PyPI - Implementation" src="https://img.shields.io/pypi/implementation/flpc?style=flat-square"> | ||
<img alt="GitHub Issues or Pull Requests" src="https://img.shields.io/github/issues/itsmeadarsh2008/flpc?style=flat-square"> | ||
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dd/flpc?style=flat-square"> | ||
# flpc: Lightning-Fast Python Regex | ||
|
||
![Star](https://img.shields.io/badge/Please%20Give%20A%20Star%20%E2%AD%90-30323D?style=flat-square) | ||
![PyPI - Implementation](https://img.shields.io/pypi/implementation/flpc?style=flat-square) | ||
![GitHub Issues](https://img.shields.io/github/issues/itsmeadarsh2008/flpc?style=flat-square) | ||
![PyPI - Downloads](https://img.shields.io/pypi/dd/flpc?style=flat-square) | ||
![GitHub License](https://img.shields.io/github/license/itsmeadarsh2008/flpc?style=flat-square) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/itsmeadarsh2008/flpc?display_timestamp=committer&style=flat-square) | ||
|
||
A Rust-based **[regex crate](https://crates.io/crates/regex) wrapper** for Python3 to get faster performance. 👾 | ||
|
||
## DEAD-SIMPLE | ||
Just import `flpc` as `re` and use it as you like and the namings are same as the native `re` module. Only thing is that `match` function name of the `re` native library is replaced with `fmatch` | ||
|
||
### MIT Licensed | ||
|
||
🚀 Supercharge your Python regex with Rust-powered performance! | ||
</div> | ||
|
||
## 🌟 Why flpc? | ||
|
||
flpc is a powerful Python library that wraps the blazing-fast [Rust regex crate](https://crates.io/crates/regex), bringing enhanced speed to your regular expression operations. It's designed to be a drop-in replacement for Python's native `re` module, with some minor syntax differences. | ||
|
||
## 🚀 Quick Start | ||
|
||
1. Install flpc: | ||
``` | ||
pip install flpc | ||
``` | ||
|
||
2. Use it in your code as shown in the API | ||
|
||
## 🔧 API | ||
|
||
flpc mirrors the `re` module's API, with a few small exceptions: | ||
|
||
- Use `fmatch()` instead of `match()` (to avoid conflicts with Python's keyword) | ||
- When using `group()` on a match object, always provide an index (e.g., `group(0)` for the entire match) | ||
|
||
Common functions include: | ||
|
||
- `compile()` | ||
- `search()` | ||
- `findall()` | ||
- `finditer()` | ||
- `split()` | ||
- `sub()` | ||
- `subn()` | ||
|
||
## 💡 Pro Tips | ||
|
||
- Pre-compile your patterns for faster execution | ||
- Use raw strings (`r''`) for cleaner regex patterns | ||
- Always check if a match is found before accessing groups | ||
- Remember to use `group(0)` to get the entire match | ||
|
||
## 🤝 Contributing | ||
|
||
We welcome contributions! Whether it's bug reports, feature requests, or code contributions, please feel free to reach out. Check our [contribution guidelines](CONTRIBUTING.md) to get started. | ||
|
||
## 📄 License | ||
|
||
flpc is open-source software licensed under the MIT license. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters