Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

A simple spin-syntax parser for Python

Project description

https://badge.fury.io/py/pyspinner.png

pyspinner is simple library for parsing text that uses spin-syntax.

Installation

To install pyspinner, simply:

$ pip install pyspinner

or download the source code and do:

$ python setup.py install

How to use it

>>> import spinning
>>> spinning.unique('The {quick|fast} {brown|gray|red} fox jumped over the lazy dog.')
'The quick gray fox jumped over the lazy dog.'

Running tests

$ python spinning-tests.py
....
----------------------------------------------------------------------
Ran 2 tests in 0.000s

OK

Features

  • Supports nested syntax.
  • Supports custom opening, closing and separator characters by using the override_params function.

TO-DO

  • Allow optional phrases: The quick{ red|} fox...
  • Allow special characters {,|,} inside text by escaping them.
  • Write more tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyspinner-0.1.0.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None May 18, 2014
pyspinner-0.1.0.zip (4.8 kB) Copy SHA256 hash SHA256 Source None May 18, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page