Skip to content

keremgocen/tagpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple JSON tag parser in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages