Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prototxt-parser

prototxt-parser allows to parse *.prototxt files to python dict objects

Tool using Python's parsy to define parse the serialized prototxt objects' grammar to python dict!

Usage:

Use pip to get the package:

pip3 install prototxt-parser

To run, from python, for converting prototxt to python dict:

input_string = ... # the prototxt string to be parsed e.g., open("some_prototxt_file").read()

from prototxt_parser.prototxt import parse
parsed_dict = parse(input_string)

To generate prototxt, from python dict:

from prototxt_parser.prototxt import serialize
text = serialize(dict, pretty=True)

Alternatively, from command line from this repo:

$ python3 prototxt_parser_main.py prototxt_file

About

parse prototxt files to python dict objects

Resources

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages