I present a project potentially useful for the Numba ecosystem: charex. This package is designed to extend Numba’s capabilities by integrating NumPy’s string operations within Numba-optimized functions.
Overview
charex stands for “Character Extensions” and enables Numba access to the suite of string comparison operations and occurrence and property methods available in NumPy’s char module:
import charex
For those interested in trying out charex, you can find the package and more details on GitHub at the charex repository. The benchmarks and tests are also available within the repository, providing insights into the package’s performance.
Comparison operations:
char.equalchar.not_equalchar.greater_equalchar.less_equalchar.greaterchar.lesschar.compare_chararrays
Occurrence and Property information:
char.countchar.endswithchar.startswithchar.findchar.rfindchar.indexchar.rindexchar.str_lenchar.isalphachar.isalnumchar.isspacechar.isdecimalchar.isdigitchar.isnumericchar.istitlechar.isupperchar.islower
Further Information
I’ve tested charex to ensure compatibility and performance, with the latest tests conducted using Numba 0.59.0 and NumPy 1.26.3. Please feel free to contribute, validate, provide feedback, and discuss how charex can be further improved. The aim is to gather feedback and further refine the project for integration into Numba (see: #8500).