A package for converting excel files to Numba optimized python code
Project description
xlNumba
xlNumba is utility to convert Excel spreadsheets into optimized Python code using Numba. This idea is to enable taking complex models built in Excel and converting them into high-performance Python code.
This library does not attempt to provide full Excel compatability. Instead it focusses on providing a subset of capabilities which can be compiled by Numba and optimized to provide high-performance execution.
In general numerical (and in the future date) related functions are supported while text functions have very limited support. Excel has some fairly complex exception handling and type coercion rules which are not supported.
Basic Example
from xlnumba import Compiler
ctx = Compiler("tests/fixtures/basic")
ctx.add_input('Raw', 'A1')
ctx.add_output('Adjusted', 'B1')
fn = ctx.compile()
adjusted = fn(Raw=3.0)
User Defined Functions example.
User defined functions can be created using the @xlnumba_function decorator. This decorator takes the name of the
excel function. Note that the function must be numba compilable.
@xlnumba_function("EXCEL_FNC_NAME")
def custom_func(x):
return 3 * x + 5
Acknowledgements
The original idea for this was inspired from the excellent pycel library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xlnumba-0.1.0.tar.gz.
File metadata
- Download URL: xlnumba-0.1.0.tar.gz
- Upload date:
- Size: 108.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d74a457609719452873715cfcb7aeadfb0252fa63bbb9e2c6b2c4b6d649a007
|
|
| MD5 |
294530306378e1d7382d9726eab01f11
|
|
| BLAKE2b-256 |
4c815fd4d524ac1a9c74ccd09c14ec2b772262af42115177c5afc2b55c7dc471
|
File details
Details for the file xlnumba-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xlnumba-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d56884e5579568a35acc72572226e095ec5db2e330ebbae65a8db81ad6e49ae
|
|
| MD5 |
8508d67c6d238c91f5353d76e00b2b5e
|
|
| BLAKE2b-256 |
c1c9eebac787be84c887c90529f80524acf5f3055beba6a9594a08818a2de533
|