Skip to content

Commit a9e6334

Browse files
authored
Merge pull request #1 from Annmayn/dev
Dev
2 parents 428cbb2 + 175eaea commit a9e6334

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
1217
from html2excel import ExcelParser
1318

html2excel/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
from .excel.parser import ExcelParser
2-
3-
__all__ = ["ExcelParser"]
2+
__all__ = ["ExcelParser"]

html2excel/__main__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

html2excel/base/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = []

main.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
setup(
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
)

0 commit comments

Comments
 (0)