Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qsoulior/scheduleparser


https://github.com/qsoulior/scheduleparser

Last synced: 30 days ago
JSON representation

Awesome Lists containing this project

README

        

# Schedule Parser

[![Go Reference](https://img.shields.io/badge/-docs-007d9c?style=flat-square&logo=go&logoColor=white)](https://pkg.go.dev/github.com/qsoulior/scheduleparser)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/qsoulior/scheduleparser?style=flat-square)
[![Go Report Card](https://goreportcard.com/badge/github.com/qsoulior/scheduleparser?style=flat-square)](https://goreportcard.com/report/github.com/qsoulior/scheduleparser)

Schedule Parser is a library for parsing pdf schedules with specific layout.

## Installation

```
go get -u github.com/qsoulior/scheduleparser
```

## Features

### Parse file

```go

initialDate := time.Now()

err := scheduleparser.ParseFile("input.pdf", "output.json", initialDate)
if err != nil {
log.Fatal(err)
}
```

### Parse bytes

```go
initialDate := time.Now()

// os.ReadFile (as of Go 1.16) reads file and returns bytes
contents, err := os.ReadFile("input.pdf")
if err != nil {
log.Fatal(err)
}
// or get bytes in another way

result, err := scheduleparser.ParseBytes(contents, initialDate)
if err != nil {
log.Fatal(err)
}
```