swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

Add an edn_parse.tag decorator, + docs and tests on tags #59

Closed bfontaine closed 4 years ago

bfontaine commented 4 years ago

This adds an edn_format.tag decorator as a shortcut for add_tag:

Before:

def parse_dog(name):
    return {
        "kind": "dog",
        "name": name,
        "message": "woof-woof",
    }

edn_format.add_tag("dog", parse_dog)

After:

@edn_format.tag("dog")
def parse_dog(name):
    return {
        "kind": "dog",
        "name": name,
        "message": "woof-woof",
    }

I also added some docs and tests.

bfontaine commented 4 years ago

Done. I also updated the Contributor’s Note in the README to use twine, as the python setup.py upload command is deprecated.