GithubHelp home page GithubHelp logo

tagpipe's Introduction

'A simple JSON tag parser'

Go Report Card GoDoc Build Status

Install

go get github.com/keremgocen/tagpipe

Tested using go version go1.6.2 darwin/amd64 on OS X 10.11.5

Usage

alt tag

Tags can be optionally passed as command line arguments. If no tags are found, a local file "tags.txt" will be used. You can try the example program as shown below, although the 2 usage options can't be mixed;

Option 1
./run tag1 tag2 ..
Option 2

Another running option is to provide custom path for tags.txt file or data folder which contains JSON files to be parsed. Using -c=false also ignores if a cache is present, overriding the new results.

$./run --help
Usage of ./run:
  -c	-c=false overrides cache (default true)
  -d string
    	data folder path is not set, use: --d <path-to-files> (default "../data/")
  -t string
    	tags file path is not set, use: --t <path-to-tags> (default "../tags.txt")

Corner Cases

  • If a cache file is present after a subsequent run on identical JSON files, changing the tags used will output the same result. Manually removing the cache file works around this.
  • Usage options can't be mixed. Tags provided via command line won't be parsed if any of the flags are present, and vice versa.
  • For the case when a "tag" is used as key of a JSON object (as in {"tag":"value"}), count for that particular tag is incremented. After JSON structure in the file is validated, a regex search is made over the whole content. This may not be ideal for when tags are not expected to appear as keys.

tagpipe's People

Contributors

keremgocen avatar

Stargazers

 avatar

Watchers

 avatar  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.