Skip to content

marcpar/rust2py_excel_reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust to python excel

Read excel file (xlsx) currently working on python3 using cpython binding.

Requirements

  • python3
  • cargo
  • rust
  • cpython

Build

Linux

run this command and build the target/release/reader.so

cargo build --release

Mac

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

Windows

cargo build --release

Usage

Image of excel below

Excel Images

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'}]}

running test

build program

python3 ./tests/test_reader.py
import rust2py
rust2py.excel_reader("../sample.xlsx")

Contributing

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.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published