Skip to content

Commit 0a2eada

Browse files
author
Matéo Fernandez
committed
docs: add README + License
1 parent e395007 commit 0a2eada

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
name = "excel_gen"
33
version = "0.1.0"
44
edition = "2021"
5+
authors = [
6+
"Matéo Fernandez <[email protected]>",
7+
"Gilles Gauthier <[email protected]>",
8+
]
59

610
[dependencies]
711
apache-avro = "0.17"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024-present, Spiriit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# excel_gen
2+
3+
A CLI tool, written in Rust :crab:, to generate Excel files from an HTML or Avro file (if needed, we can add other input types).
4+
5+
It is used by our PHP library [SpiriitLabs/php-excel-rust](https://github.com/SpiriitLabs/php-excel-rust) to generate Excel files.
6+
7+
Why did we do it ?
8+
Because PHP was too slow to generate our excel files, and because it's fun. :D
9+
10+
## How to use
11+
12+
```md
13+
Usage: excel_gen [OPTIONS] --output <OUTPUT> <COMMAND>
14+
15+
Commands:
16+
avro Input from Avro
17+
html Input from HTML
18+
help Print this message or the help of the given subcommand(s)
19+
20+
Options:
21+
-o, --output <OUTPUT> Path to excel file output
22+
-v, --verbose... Increase logging verbosity
23+
-q, --quiet... Decrease logging verbosity
24+
-h, --help Print help
25+
-V, --version Print version
26+
```
27+
28+
### Use with Avro
29+
30+
```bash
31+
excel_gen --output ./output.xlsx avro --file ./input.avro
32+
```
33+
34+
> [!NOTE]
35+
> You can find the Avro schema here: [`./schema.json`](./schema.json)
36+
37+
### Use with HTML
38+
39+
```bash
40+
excel_gen --output ./output.xlsx html --file ./input.html
41+
```
42+
43+
> [!NOTE]
44+
> <details>
45+
> <summary>HTML example</summary>
46+
>
47+
> ```html
48+
> <table>
49+
> <thead>
50+
> <tr>
51+
> <th>Name</th>
52+
> <th>Age</th>
53+
> <th>City</th>
54+
> </tr>
55+
> </thead>
56+
> <tbody>
57+
> <tr>
58+
> <td>
59+
> John Doe
60+
> </td>
61+
> <td>30</td>
62+
> <td>New York</td>
63+
> </tr>
64+
> <tr>
65+
> <td>Jane Smith</td>
66+
> <td>25</td>
67+
> <td>Los Angeles</td>
68+
> </tr>
69+
> <tr>
70+
> <td>Emily Johnson</td>
71+
> <td>40</td>
72+
> <td>Chicago</td>
73+
> </tr>
74+
> <tr>
75+
> <td colspan="2"></td>
76+
> <td>3</td>
77+
> </tr>
78+
> </tbody>
79+
> </table>
80+
> ```
81+
>
82+
> </details>
83+
84+
## Roadmap
85+
86+
- [x] Avro input
87+
- [x] with format options
88+
- [x] HTML input
89+
- [x] handle colspan (skip cells)
90+
- [ ] with format options
91+
- [ ] add testing
92+
- [ ] add benchmarks
93+
94+
If you have any suggestions, feel free to open an issue.
95+
96+
## Credits
97+
98+
- Huge thanks to [jmcnamara/rust_xlsxwriter](https://github.com/jmcnamara/rust_xlsxwriter) for their amazing excel library
99+
100+
## License
101+
102+
This bundle is under the MIT license.
103+
For the whole copyright, see the [LICENSE](./LICENSE) file distributed with this source code.

0 commit comments

Comments
 (0)