Skip to content

heapsortjobs/python-stachetag

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

python-stachetag

Implement stachetags in your Pythons lickety-split.

Stachetags?

http://blog.heapsortjobs.com/stachetags-we-have-the-solution

ITS SO EASY

>>> import stachetag
>>> stachestring = "This string{ has multiple{ stachetags{ in it!"

>>> waxer = stachetag.StacheWaxer(stachestring)

>>> waxer.get_tags()
['string', 'multiple', 'stachetags']

>>> waxer.get_stachetags()
['string{', 'multiple{', 'stachetags{']

>>> for stache in waxer:
...     print stache
...
<stachetag.StacheTag object at 0x102e87650>
<stachetag.StacheTag object at 0x102e87710>
<stachetag.StacheTag object at 0x102e87750>

>>> waxer.format_staches(format_string="<a href='#{tag}'>{stachetag}</a>")
"This <a href='#string'>string{</a> has <a href='#multiple'>multiple{</a> <a href='#stachetags'>stachetags{</a> in it!"

Contribute!

Pull requests welcome. Integrations encouraged. Shaving is frowned upon.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages