An open API service indexing awesome lists of open source software.

https://github.com/ikeikeikeike/python-eco

Python Eco Compiler
https://github.com/ikeikeikeike/python-eco

Last synced: 26 days ago
JSON representation

Python Eco Compiler

Awesome Lists containing this project

README

        

Python Eco
===========

Python Eco is a bridge to the [Eco](https://github.com/sstephenson/eco) (CoffeeScript Template) Compiler.

```python
import eco

eco.compile(open("template.eco"))
# Out: u"function(...) {...}"

context = eco.context_for("Hello <%= @name %>")
context.call("render", {"name": "Sam"})
# Out: u'Hello Sam'

eco.render("Hello <%= @name %>", name="world")
# Out: u'Hello world'
```

Setup
-----
```bash
$ pip install eco
```

License
========
MIT License