File tree Expand file tree Collapse file tree 6 files changed +26
-20
lines changed
Expand file tree Collapse file tree 6 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ Library to convert HTML Tables to Excel file.
88
99## Usage
1010
11+ ### Running from command line
12+
13+ ``` python -m html2excel input_file output_file ```
14+
15+ ### Using as package
1116``` python
1217from html2excel import ExcelParser
1318
Original file line number Diff line number Diff line change 11from .excel .parser import ExcelParser
2-
3- __all__ = ["ExcelParser" ]
2+ __all__ = ["ExcelParser" ]
Original file line number Diff line number Diff line change 1+ import sys
2+ from html2excel import ExcelParser
3+
4+ def run ():
5+ if len (sys .argv ) == 3 :
6+ file_path = sys .argv [1 ]
7+ save_path = sys .argv [2 ]
8+ parser = ExcelParser (file_path )
9+ parser .to_excel (save_path )
10+ else :
11+ # First argument for file name, we'll ignore that
12+ print ("Expected 2 arguments. Got {num}" .format (num = len (sys .argv )- 1 ))
13+
14+ if __name__ == "__main__" :
15+ run ()
16+
17+ # TODO: handle exceptions
Original file line number Diff line number Diff line change 1+ __all__ = []
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55
66setup (
77 name = "html2excel" ,
8- version = "0.0.1 " ,
8+ version = "0.0.4 " ,
99 author = "Neema Tsering" ,
1010 author_email = "ntvirus333@gmail.com" ,
1111 description = ("Convert HTML Table to Excel file" ),
1212 long_description = readme ,
1313 long_description_content_type = "text/markdown" ,
1414 install_requires = ['bs4' , 'openpyxl' ],
1515 license = "MIT" ,
16- packages = [ "html2excel" ] ,
16+ packages = find_packages () ,
1717)
You can’t perform that action at this time.
0 commit comments