0
I Use This!
Activity Not Available
Analyzed 12 months ago. based on code collected 12 months ago.

Project Summary

The main functions and classes of the ctemplate library are wrapped as native Python objects. This enables quick prototyping and testing of a ctemplate system.

Run python internal help() for an API overview: $ python -c "import ctemplate; help(ctemplate)"

Example

# loads example.tpl in current directory
template = ctemplate.Template("example.tpl", ctemplate.DO_NOT_STRIP)
dictionary = ctemplate.Dictionary("my example dict")
dictionary.SetValue("VALUE1", "TEST1")
# dict setters call SetValue() automatically
dictionary["VALUE2"] = "TEST2"
# all objects except booleans are converted to strings with str()
dictionary["NUMBER"] = 87411 # stores "87411"
dictionary["TUPLE"] = (1, 2, 3) # stores "(1, 2, 3)"
# Sections
dictionary.ShowSection("A_SECTION")
# boolean True calls ShowSection() automatically
dictionary["IN_CA"] = True
# boolean False is ignored (ie. this statement has no effect)
dictionary["IGNORED"] = False
# And of course the expand function
print template.Expand(dictionary)

Tags

ctemplate python template templating wrapper

In a Nutshell, python-ctemplate...

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    check out hot projects on the Open Hub
  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    search using multiple tags to find exactly what you need

Languages

Languages?height=75&width=75
C++
82%
Python
10%
Make
6%
HTML
2%

30 Day Summary

Apr 10 2016 — May 10 2016

12 Month Summary

May 10 2015 — May 10 2016

Ratings

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!