Skip to content

yogin16/prototxt_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages