https://github.com/nndi-oss/spring-zerocell
Zerocell integration to extract data quickly, efficiently and automagically from Excel files in your Spring applications.
https://github.com/nndi-oss/spring-zerocell
excel java
Last synced: about 1 year ago
JSON representation
Zerocell integration to extract data quickly, efficiently and automagically from Excel files in your Spring applications.
- Host: GitHub
- URL: https://github.com/nndi-oss/spring-zerocell
- Owner: nndi-oss
- License: mit
- Created: 2020-08-01T23:19:46.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T00:20:36.000Z (about 2 years ago)
- Last Synced: 2025-04-01T06:35:25.114Z (over 1 year ago)
- Topics: excel, java
- Language: Java
- Homepage: https://nndi.cloud/oss/spring-zerocell/
- Size: 99.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Zerocell for Spring
===
[zerocell](https://github.com/creditdatamw/zerocell) integration for Spring Boot. It enables you to upload and extract data quickly, efficiently and _automagically_ from Excel files in your Spring application controllers. It's so magical that you won't see or write any code to read and map data from an Excel Sheet to a POJO.
> NOTE: This should not be considered production-ready.
> We are working towards a stable release towards early February 2022.
> YMMV
## Quick Start example
The code below is a complete Spring Boot application that allows users to
* upload an Excel file,
* process the Excel file by reading each row and mapping it to a POJO
* return the extracted Excel data as JSON data
_All without writing any code to actually deal with Excel!_
```java
public class PersonRow {
@Column(index=0, name= "ID")
private String ID;
@Column(index=1, name= "Name")
private String name;
@Column(index=2, name="Age")
private int age;
// .. getters and setters ...
}
@RestController
@Import(SpringZerocellSupport.class)
public class ExampleController {
@PostMapping(value = "/upload", produces = MediaType.APPLICATION_JSON_VALUE)
public List extractUsers(@ZerocellRequestBody List peopleFromExcel) {
return peopleFromExcel; // Return the loaded data to the user
}
}
@SpringBootApplication
public class ExampleApplication {
public static void main(String... args) {
SpringApplication.run(ExampleApplication.class, args);
}
}
```
A simple form to interact with the endpoint would looks something like this;
```html
Spring Zerocell Example
Upload an excel with the following columns 'ID', 'Name', 'Age'
Upload
```
A cURL request to the endpoint would look something like this:
```sh
$ curl -XPOST -F "file=@customers.xlsx" http://localhost:8080/upload
```
## Installation / Usage
Not yet on any repositories, so clone it and install it locally:
```sh
$ git clone https://github.com/nndi-oss/spring-zerocell.git
$ cd spring-zerocell
$ mvn clean install
```
Add to your pom and enjoy :) :
```xml
cloud.nndi.oss
spring-zerocell
0.3.0-SNAPSHOT
```
---
Copyright (c) 2022, NNDI