Read excel file (xlsx) currently working on python3 using cpython binding.
- python3
- cargo
- rust
- cpython
run this command and build the target/release/reader.so
cargo build --release
run this command and build the target/release/
cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup
or add this file in ~/.cargo/config
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
and run
cargo build --release
cargo build --release
Image of excel below
Result
{0: [{'SKU': 'MP13-0001', 'Product Designation': 'Mac book Pro 13"', 'Unit Price': '1299'}], 1: [{'SKU': 'MP16-0001', 'Product Designation': 'Mac book Pro 16"', 'Unit Price': '1599'}], 2: [{'SKU': 'IPX-0001', 'Product Designation': 'IPhone X', 'Unit Price': '1199'}]}
build program
python3 ./tests/test_reader.py
import rust2py
rust2py.excel_reader("../sample.xlsx")
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.