Skip to content

sherzberg/python-grok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

GROK

Grok is a Python port of ruby-grok written by @jordansissel.

Here is the refrerence implementation Link

Status

The project is a work in progress. I have implemented a few base line tests to prove out the api and have started filling these in, but this is no where near working.

Here are things to do:

  • Setup test framework
  • Setup Python classes for dummy api
  • Tox tests for py26, py27, py33, pypy, jython
  • Setup Travis-CI
  • Grok.add_pattern(name, pattern)
  • Grok.add_patterns_from_file(filename)
  • Grok.compile(pattern)
  • Grok.discover(input)
  • Grok.match(text)
  • Release to pypi

Usage

from grok import Grok

grok = Grok()
grok.add_patterns_from_file('/path/to/my/patterns')

grok.compile('%{GREEDYDATA} - %{NUMBER}')

input = "My Fancy Input - 9999"

print(input)
print("Matches" if grok.matches(input) else "Doens't Match")

For more usage, see the specs/example_spec.py.

Running Tests

$ pip install -r dev-requirements.txt
$ pspec specs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages