Skip to content

eigenhombre/parsepy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parsepy

A Clojure module for parsing Python configuration files.

See the Marginalia docs for more documentation.

Author

John Jacobsen

Dependencies

Uses the truly awesome Instaparse library.

Usage

Add to project.clj:

[parsepy "0.0.1-SNAPSHOT"]

And import parsepy.core.

Example:

(ns my.great.namespace
  (require [parsepy.core :as parsepy]))

(parsepy/parse "

# This is a Python configuration file, suitable for parsing 
# with ConfigParser or parsepy.

[section_one]
x = 1
s = string_value
")

;;=> ([:section section_one :x 1 :s string_value])

Limitations:

Does not handle quoted or multiline strings yet, variable interpolation, or allow_no_value options. I'll implement them when I need to; pull requests welcome in the mean time.

About

Parse Python configuration files with Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published