ANN: knife 0.5.1

2012-04-22 Thread L. C. Rees
knife is a powerful Python multitool loosely inspired by underscore.js
but remixed for maximum pythonicity. knife concentrates power normally
found dispersed across the universe of Python packages in one
convenient shrink-wrapped package.

knife works with Python 2.6, 2.7, and 3.2.

knife documentation can be found at http://readthedocs.org/docs/knife/en/latest/
or http://packages.python.org/knife/

3 second knife
-

Things go in:

   gauntlet = __(5, 4, 3, 2, 1)

Things get knifed:

   gauntlet.initial().rest().slice(1, 2).last()

Things come out:

   gauntlet.get()
  3

Slightly More
---

knife features over 40 methods that can be chained into pipelines:

   from knife import __
   __(5, 4, 3, 2, 1).initial().rest().slice(1, 2).last().get()
  3

Or object-oriented style:

   from knife import knife
   oo = knife(('a', 1), ('b', 2), ('c', 3))
   oo.wrap(dict)
   oo.map()
   oo.get()
  {'a': 1, 'b': 2, 'c': 3}

knife knives can roll thing in its pipeline back to the results of
the immediately preceding steps, a baseline snapshot, or even the
original
arguments.

   undone = __(1, 2, 3).prepend(1, 2, 3, 4, 5, 6)
   undone.peek()
  [1, 2, 3, 4, 5, 6, 1, 2, 3]
   undone.append(1).undo().peek()
  [1, 2, 3, 4, 5, 6, 1, 2, 3]
   undone.append(1, 2).undo(2).peek()
  [1, 2, 3, 4, 5, 6, 1, 2, 3, 1]
  undone.snapshot().append(1, 2).baseline().peek()
  [1, 2, 3, 4, 5, 6, 1, 2, 3, 1]
  undone.original().peek()
  [1, 2, 3]
   one.original().minmax().pipe(two).merge().back().max().get()
  1000
   one.original().minmax().pipe(two).merge().back().sum().get()
  1002

Installation


knife can be installed the usual ways from:

http://pypi.python.org/pypi/knife/

Development
---

 * Public repository: https://bitbucket.org/lcrees/knife.
 * Mirror: https://github.com/kwarterthieves/knife/
 * Issue tracker: https://bitbucket.org/lcrees/knife/issues
 * License: BSD
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: shove 0.1, the next-generation shelve

2007-01-17 Thread L. C. Rees
shove is a object storage frontend inspired by the standard library's
shelve module. It features a dictionary-style API, automatic object
storage (with pickle) with in-storage compression (with zlib), and
multiple storage and caching backends.

The currently supported storage backends are:

* Amazon S3 Web Service
* Berkeley Source Database
* Filesystem-based
* Firebird
* FTP
* DBM
* Durus
* Memory
* Microsoft SQL Server
* MySQL
* Oracle
* PostgreSQL
* SQLite
* Subversion
* Zope Object Database (ZODB)

Currently supported caching backends are:

* Filesystem-based
* Firebird
* memcached
* Memory (thread-safe or non-thread-sa
* Microsoft SQL Server
* MySQL
* Oracle
* PostgreSQL
* SQLite

The simplest use case for shove is:

from shove import Shove

store = Shove()

creating an in-memory store and cache.

To use a different storage or caching backend, a backend-specific URI
or an existing store or cache instance must be passed to the Shove
class using the format:

STORENAME = Shove(STORE, CACHE)

Each backend-specific URI format is documented in its module source
code. The URI format follows the URI format used by SQLAlchemy:

http://www.sqlalchemy.org/docs/dbengine.myt#dbengine_establishing

shove is available for download from its CheeseShop page:

http://cheeseshop.python.org/pypi/shove

or it can be installed by using setuptools:

easy_install shove

shove has been tested and confirmed to work on Python 2.4 and Python
2.5.

shove has an extension, multishove, with the same features but with
added support for storing objects to multiple storage backends
simultaneously. shove itself can only store objects to one backend at a
time.

To use multiple backends with multishove, multiple backend-specific
URIs or store instances must be passed to the MultiShove class
following the format:

from multishove import MultiShove

STORENAME = MultiShove(STORE1, STORE2 ..., cache=CACHE)

multishove is available for download from its CheeseShop page:

http://cheeseshop.python.org/pypi/multishove

or it can be installed by using setuptools:

easy_install multishove

multishove has been tested and confirmed to work on Python 2.4 and
Python 2.5.

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: webstring 0.5 [correction]

2007-01-06 Thread L. C. Rees
[correction: CheeseShop URL pointed to the incorrect package]

webstring is a template engine for programmers whose favorite template
language is Python. webstring can be used to generate any text output
with the additional advantages of advanced XML and HTML templating
using the lxml and cElementTree libraries. webstring includes a
TurboGears/Buffet template API compatible plugin and support for using
webstring as WSGI middleware.

This release of webstring replaces the standalone packages webstring,
lwebstring, TurboWebstring, and LturboWebstring.

 webstring was designed to meet the following goals:

   1. To separate model and view logic from controller logic.
   2. To separate template logic from template data.
   3. To require only Python for templating.
   4. To use Python syntax, idiom, and patterns.
   5. To play well with other Python software.

webstring's XML and HTML templating was designed to meet the following
goals:

   1. To use XML as a data format, not a programming language.
   2. To use existing XML formats.
   3. To hide the parts of an XML document that are not being used.
   4. To use the best Python XML libraries.
   5. To bridge HTML and XML.

webstring can be downloaded from its Python CheeseShop page at:

http://cheeseshop.python.org/pypi/webstring/

or installed using setuptools' easy_install:

easy_install webstring

More information on webstring including documentation and an
introduction is available at:

http://psilib.sourceforge.net/webstring.html

An introduction to webstring's plaintext templating is available at:

http://psilib.sourceforge.net/text.html

Highlights of the 0.5 release include:

- templating support for non-XML text formats
- the ability to use lxml as the XML processing library for XML
templates
- the inclusion of a TurboGears/Buffet compatible template plug-in
- XInclude support (using lxml as the XML processing library)
- can apply XSLT stylesheets to any part of an XML template using the
transform method (using lxml as the XML processing library)
- the replication operator (*) now repeats the current state of a
template instead of the default state
- the order in which XML elements are concatenated (+) with other XML
elements is now preserved
- decorators for WSGI templating middleware
- cElementTree and lxml-based XML templates pickle and unpickle properly

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: webstring 0.5

2007-01-05 Thread L. C. Rees
webstring is a template engine for programmers whose favorite template
language is Python. webstring can be used to generate any text output
from a template with the additional advantages of advanced XML and HTML
templating using the lxml and cElementTree libraries. webstring
includes a TurboGears/Buffet template API compatible plugin and support
for using webstring as WSGI middleware.

This release of webstring replaces the standalone packages webstring,
lwebstring, TurboWebstring, and LturboWebstring.

 webstring was designed to meet the following general goals:

   1. To separate model and view logic from controller logic.
   2. To separate template logic from template data.
   3. To require only Python for templating.
   4. To use Python syntax, idiom, and patterns.
   5. To play well with other Python software.

webstring's XML and HTML templating was designed to meet the following
goals:

   1. To use XML as a data format, not a programming language.
   2. To use existing XML formats.
   3. To hide the parts of an XML document that are not being used.
   4. To use the best Python XML libraries.
   5. To bridge HTML and XML.

webstring can be downloaded from its Python CheeseShop page at:

http://cheeseshop.python.org/pypi/lwebstring/

or installed using setuptools' easy_install:

easy_install webstring

More information on webstring including documentation and an
introduction is available at:

http://psilib.sourceforge.net/webstring.html

An introduction to webstring's plaintext templating is available at:

http://psilib.sourceforge.net/text.html

Highlights of the 0.5 release include:

- templating support for non-XML text formats
- the ability to use lxml as the XML processing library for XML
templates
- the inclusion of a TurboGears/Buffet compatible template plug-in
- XInclude support (using lxml as the XML processing library)
- can apply XSLT stylesheets to any part of an XML template using the
transform method (using lxml as the XML processing library)
- the replication operator (*) now repeats the current state of a
template instead of the default state
- the order in which XML elements are concatenated (+) with other XML
elements is now preserved
- decorators for WSGI templating middleware
- cElementTree and lxml-based XML templates pickle and unpickle properly

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: lwebstring 0.5

2006-10-07 Thread L. C. Rees
lwebstring is a lxml-based implementation of webstring, an XML template
engine where Python is the template language. lxml exposes the power of
the libxml2 and libxslt libraries to the Python programmer using the
elegant and powerful yet simple ElementTree API. lwebstring extends
this power to easy XML and HTML templating using the highly Pythonic
webstring API inspired by PyMeld.

lwebstring can be downloaded from its Python CheeseShop page at:

http://cheeseshop.python.org/pypi/lwebstring/

or installed using setuptools' easy_install:

easy_install lwebstring

More information on lwebstring including documentation and an
introductory tutorial
can be found at:

http://psilib.sourceforge.net/webstring.html

Highlights of 0.5 include:

- Support for including external XML files in an XML document using
XInclude. This is useful for reusing common features between XML
templates.
- Function decorators for WSGI templating. This allows XML and HTML
templating to be just another piece of WSGI middleware instead of using
a separate API standard.

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: webstring 0.4 and lwebstring 0.4 released

2006-07-10 Thread L. C. Rees
webstring is an XML template engine that uses Python as its template
language. It exposes the XML you need and hides the XML you don't. XML
manipulation is done with Python so you don't have to learn a separate
template language. webstring templates are plain XML or HTML so
designers don't need to become programmers. webstring can take broken
HTML and output it as HTML 4.01 or XHTML along with other XML formats.
It can also act as WSGI middleware for templating web output on the
fly.

webstring uses cElementTree or elementtree as its XML processing
backend. lwebstring uses lxml, a Python binding for the libxml2 and
libxsl libraries.

Highlights of release 0.4 of webstring and lwebstring include:

- Output changes: fields and groups output a marked element, its
children, and new siblings
instead of the marked element's parent element when rendered as a
string.
- Template concatenation can be chained i.e. template1 + template2 +
template3
- includes middleware for using the Template and HTMLTemplate classes
with WSGI applications.

Highlights of release 0.4 of lwebstring include:

- can apply XSLT stylesheets to a Template using the transform method

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: webstring 0.3 released

2006-06-14 Thread L. C. Rees
webstring is a template system designed for programmers whose preferred
template languages are Python and HTML (and XML for people that swing
that way).

Highlights of 0.3 include:

- an HTMLTemplate class for taking questionable HTML and outputting it
as correct XHTML 1.0, XHTML 1.1, or HTML 4.0
- better support for integrating string.Template and Python string
formatting so they can be used to format XML/HTML element and attribute
content.
- better batch templating
- support for pickling webstring's Template objects
- more tests including doctests
- removal of unit tests from the main module
- support for elementtree as an XML processing backend
- speed enhancements
- code changes to increase ease of use
- more documentation and examples

Changelog is available here:

http://psilib.sourceforge.net/CHANGELOG-0.3

The webstring module is available for download at:

http://prdownloads.sourceforge.net/psilib/webstring.py?download

More information on webstring including documentation and a tutorial
can be found at:

http://psilib.sourceforge.net/webstring.html

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


webstring 0.2 released

2006-04-23 Thread L. C. Rees
This is the second public release of webstring.

Improvements in this version include speed enhancements and the ability
to mark groups of fields inside an XML/HTML document with an XML/HTML
attribute (by default class) so they can be manipulated in a single
operation.

webstring is a template system that lets Python programmers manipulate
XML and HTML documents using standard Python sequence and string
operators. It is designed for those whose preferred web template
languages are Python and HTML. webstring's design is inspired by PyMeld
but with a stricter Python feel. Like PyMeld, webstring separates the
view (the XML/HTML document) from the controller (Python). It uses
XML/HTML attributes (by default id) to mark which tags in a document
are fields where content can be inserted or substituted. webstring
flattens a document into a Python object hierarchy, exposing only parts
of the document you need to manipulate.

webstring is a wrapper for Fredrik Lundh's cElementTree package, so
both cElementTree and elementtree are required. It also requires
Fredrik Lundh's elementtidy package for trying hack through odd HTML.
These packages are available for download at:

http://effbot.org/downloads/

webstring is currently only known to work with Python 2.4.

webstring documentation can be found at:

http://psilib.sourceforge.net/webstring.html

Future planned enhancements include making webstring capable of using
lxml as an optional backend.

The file is available for download from:

http://prdownloads.sourceforge.net/psilib/webstring.py?download

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


ANN: webstring 0.1 released

2006-03-07 Thread L. C. Rees
This is the first public release of webstring.

webstring is a web templating engine that allows programs to manipulate
XML and HTML documents with standard Python sequence and string
operators. It is designed for those whose preferred web template
languages are Python and HTML (and XML for people who swing that way).

webstring's design is inspired by PyMeld but with a stricter Python
feel. Like PyMeld, it strictly seperates the view (XML/HTML) from the
controller (Python). Web designers can rest easy knowing that they can
devote more time to mastering the complexities of HTML while
programmers can now spend their days writing controller logic.

webstring was written as a wrapper for Fredrik Lundh's cElementTree
package, so the cElementTree and ElementTree packages are required. It
also requires Fredrik Lundh's elementtidy package for trying to make
sense of HTML from off the beaten track. All of these packages are
available for download at:

http://effbot.org/downloads/

webstring is currently only known to work with Python 2.4.

webstring's documentation at this point is found in its source code
alongside its unit tests.

The file is available for download from:

http://prdownloads.sourceforge.net/psilib/webstring.py?download

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html