Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/cytec/releaseparser

A package to parse scene release names
https://github.com/cytec/releaseparser

file-info golang golang-package nameparser nameparsing

Last synced: about 1 month ago
JSON representation

A package to parse scene release names

Awesome Lists containing this project

README

        

releaseparser
===============

A package used to parse scene release names

[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/cytec/releaseparser)
[![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/cytec/releaseparser#license-mit)

## Installation

```bash
go get -u github.com/cytec/releaseparser/...
```

## Examples

### titles.go

```go
package main

import (
"fmt"
"io/ioutil"
"sort"

"github.com/cytec/releaseparser"
)

func main() {
files, err := ioutil.ReadDir("./")
if err != nil {
panic(err)
}

titles := []string{}

for _, f := range files {
if f.IsDir() {
r := releaseparser.Parse(f.Name())
if r.Title != "" {
titles = append(titles, r.Title)
}
}
}

sort.Strings(titles)

for _, title := range titles {
fmt.Println(title)
}
}
```

## License (MIT)

*Copyright (C) 2017 [cytec](http://cytec.us/)*

> Permission is hereby granted, free of charge, to any person obtaining
> a copy of this software and associated documentation files (the "Software"),
> to deal in the Software without restriction, including without limitation
> the rights to use, copy, modify, merge, publish, distribute, sublicense,
> and/or sell copies of the Software, and to permit persons to whom the
> Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included
> in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
> DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
> OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.