Giter Site home page Giter Site logo

lbyzx123 / sods Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miachm/sods

0.0 1.0 0.0 450 KB

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)

License: Apache License 2.0

Java 100.00%

sods's Introduction

SODS

Build Status Maven Central License

A simple library for process ODS files in Java. It allows read/write ODS files.

Install

Maven

If you use maven, you can add it to your pom file:

<dependency>
  <groupId>com.github.miachm.sods</groupId>
  <artifactId>SODS</artifactId>
  <version>1.0.1</version>
</dependency>

Manually

Check out releases section for download the lastest release in a JAR file. After that, you can add the jar in your java project.

Here some help in differents IDE:

Docs

You can access the javadocs here

There is an examples folder where you can read codes samples.

F.A.Q

What is an ODS?

ODS means Open Document Spreadsheet. It's used in applications like Libreoffice or Open Office.

Libreoffice Calc

What is the motivation of this?

I needed to generate ODS files in Java. I looked for libraries, but they are:

  • Deprecated or dead, like Apache ODF Toolkit. It's not working with Java 8.
  • It has Libre Office as dependency in the user's computer. That's so much (Libre Office Api).
  • Poorly designed or bloated.

So, i decided create my own library from scratch. The objetive is load and generate ODS files in a simple and easy way.

What is the current state?

Right now you can:

  • Load the cell's values from an ODS file.
  • Manipulate these values.
  • Some formating (bold fonts, italic style, underline...).
  • Save it back to an ODS file.

This is an example of an ODS file in LibreOffice Sample Libreoffice

Here, i am using SODS for load the file and rendering it with JavaFX

Sample SODS

How it works?

This is a code example:

package com.github.miachm.sods.examples;

import com.github.miachm.sods.spreadsheet.Range;
import com.github.miachm.sods.spreadsheet.Sheet;
import com.github.miachm.sods.spreadsheet.SpreadSheet;

import java.io.File;
import java.io.IOException;
import java.util.List;

public class BasicUsage{
    public static void main(String args[]){
        try {
            SpreadSheet spread = new SpreadSheet(new File("resources/BasicExample.ods"));
            System.out.println("Number of sheets: " + spread.getNumSheets());

            List<Sheet> sheets = spread.getSheets();

            for (Sheet sheet : sheets) {
                System.out.println("In sheet " + sheet.getName());

                Range range = sheet.getDataRange();
                System.out.println(range.toString());
            }
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}

Check more examples here

Contributions are welcome!

sods's People

Contributors

miachm avatar lbyzx123 avatar estuardolh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.