Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 64 lines (37 sloc) 1.263 kb
1caabec Daniel Lindsley Reformatted README.
authored
1 bitty.py
2 ========
a734960 Daniel Lindsley Added README.
authored
3
6b954ba Daniel Lindsley Added MySQLAdapter. v0.4!
authored
4 A tiny storage layer.
a734960 Daniel Lindsley Added README.
authored
5
6
6b954ba Daniel Lindsley Added MySQLAdapter. v0.4!
authored
7 Why another storage layer?
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
8 --------------------------
a734960 Daniel Lindsley Added README.
authored
9
10 I wanted one that was small (both in terms of a single file and in actual kloc),
11 tested and could handle multiple data stores. And because it was fun.
12
13 Example
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
14 -------
a734960 Daniel Lindsley Added README.
authored
15
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
16 `bitty` supports the usual CRUD methods. For example::
a734960 Daniel Lindsley Added README.
authored
17
18 from bitty import *
19
20 bit = Bitty('sqlite:///home/code/my_database.db')
21
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
22 bit.add('people', name='Claris', says='Moof!', age=37)
23 bit.add('people', name='John Doe', says='No comment.', age=37)
a734960 Daniel Lindsley Added README.
authored
24
25 # Select all.
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
26 for row in bit.find('people'):
a734960 Daniel Lindsley Added README.
authored
27 print row['name']
666010e Daniel Lindsley Added PostgresAdapter. v0.3!
authored
28
29 bit.close()
a734960 Daniel Lindsley Added README.
authored
30
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
31 See `examples/` and `tests.py` for more usages.
fd7ecc3 Daniel Lindsley One more try, because GitHub hates me.
authored
32
a734960 Daniel Lindsley Added README.
authored
33
6b954ba Daniel Lindsley Added MySQLAdapter. v0.4!
authored
34 Supported Backends
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
35 ------------------
6b954ba Daniel Lindsley Added MySQLAdapter. v0.4!
authored
36
37 * SQLite
38 * Postgres
39 * MySQL
40
41
a734960 Daniel Lindsley Added README.
authored
42 Schema
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
43 ------
a734960 Daniel Lindsley Added README.
authored
44
45 You're responsible for your own schema. bitty does the smallest amount of
46 introspection it can to get by.
47
48
fd7ecc3 Daniel Lindsley One more try, because GitHub hates me.
authored
49 When to use bitty?
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
50 ------------------
a734960 Daniel Lindsley Added README.
authored
51
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
52 `bitty` is best used in environments like resource-based APIs and when
a734960 Daniel Lindsley Added README.
authored
53 integrating with other software (like a bigger web framework).
54
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
55 Tastes great when used with [itty][1].
fd7ecc3 Daniel Lindsley One more try, because GitHub hates me.
authored
56
57 Serious Python Programmers™ with Enterprise Requirements need not apply.
58
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
59 [1]: http://github.com/toastdriven/itty
a734960 Daniel Lindsley Added README.
authored
60
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
61 *author: Daniel Lindsley*
331e8be Daniel Lindsley Added the ability to specify the port. Thanks to akrito for the original...
authored
62
8070fe0 Daniel Lindsley A bunch of README fixes. Thanks akrito!
authored
63 *date: 2010-01-20*
Something went wrong with that request. Please try again.