Skip to content
Newer
Older
100644 124 lines (87 sloc) 3.68 KB
59b12d4 @thobbs Moved a lot of documentation from the README into the docs
thobbs authored Dec 2, 2010
1 Note
2 ====
72c4eb3 @thobbs Make README note at the top less ugly
thobbs authored Oct 18, 2010
3
5bd7d03 @thobbs Minor readme fix
thobbs authored Jan 14, 2011
4 If you are using Cassandra 0.6, get pycassa 0.3.0 from the
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
5 [Downloads](https://github.com/pycassa/pycassa/downloads) section and read the
6 documentation contained within. This README applies to the current state of
7 pycassa, which tracks Cassandra 0.7.
8
9 See [the wiki](https://github.com/pycassa/pycassa/wiki/Pycassa-%2B-Cassandra-Compatibility)
10 for more compatibility notes.
efd0323 @vomjom Add a temporary notice in the README to help confused users who try t…
vomjom authored Jul 13, 2010
11
fdeccc9 @vomjom rename to pycassa because of a name conflict with another python proj…
vomjom authored Dec 23, 2009
12 pycassa
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
13 =======
14
25ad3b8 @thobbs Slight modification to README.mkd
thobbs authored Dec 2, 2010
15 pycassa is a python client library for Apache Cassandra with the following features:
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
16
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
17 1. Auto-failover for normal or thread-local connections
542d1b2 @thobbs Documentation and README updates
thobbs authored Nov 6, 2010
18 2. Connection pooling
19 3. A batch interface
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
20 4. A method to map an existing class to a Cassandra column family
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
21
cc4334d @thobbs Linked to documentation in README
thobbs authored Sep 12, 2010
22 Documentation
23 -------------
24
59b12d4 @thobbs Moved a lot of documentation from the README into the docs
thobbs authored Dec 2, 2010
25 Documentation can be found here:
cc4334d @thobbs Linked to documentation in README
thobbs authored Sep 12, 2010
26
27 [http://pycassa.github.com/pycassa/](http://pycassa.github.com/pycassa/)
28
59b12d4 @thobbs Moved a lot of documentation from the README into the docs
thobbs authored Dec 2, 2010
29 It includes [installation instructions](http://pycassa.github.com/pycassa/installation.html),
30 a [tutorial](http://pycassa.github.com/pycassa/tutorial.html),
31 [API documentation](http://pycassa.github.com/pycassa/api/index.html),
32 and a [change log](http://pycassa.github.com/pycassa/changelog.html).
33
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
34 Getting Help
35 ------------
36
37 IRC:
59b12d4 @thobbs Moved a lot of documentation from the README into the docs
thobbs authored Dec 2, 2010
38
39 * Use channel #cassandra on irc.freenode.net. If you don't have an IRC client,
40 you can use [freenode's web based client](http://webchat.freenode.net/?channels=#cassandra).
4f8b9a8 @vomjom mention IRC channel for questions
vomjom authored Apr 6, 2010
41
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
42 Mailing List:
59b12d4 @thobbs Moved a lot of documentation from the README into the docs
thobbs authored Dec 2, 2010
43
44 * User list: [http://groups.google.com/group/pycassa-discuss](http://groups.google.com/group/pycassa-discuss)
45 * Developer list: [http://groups.google.com/group/pycassa-devel](http://groups.google.com/group/pycassa-devel)
4f8b9a8 @vomjom mention IRC channel for questions
vomjom authored Apr 6, 2010
46
1ab10b6 @vomjom add optional setup.py flag to install cassandra package
vomjom authored Dec 22, 2009
47 Installation
48 ------------
49
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
50 If easy_install is available, you can use:
51
52 easy_install pycassa
53
54 The simplest way to install manually is to copy the pycassa directories to
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
55 your program. If you want to install, make sure you have thrift installed,
56 and run setup.py as a superuser.
1ab10b6 @vomjom add optional setup.py flag to install cassandra package
vomjom authored Dec 22, 2009
57
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
58 easy_install thrift05
1ab10b6 @vomjom add optional setup.py flag to install cassandra package
vomjom authored Dec 22, 2009
59 python setup.py install
60
d2067bf @vomjom reorganize README
vomjom authored Mar 13, 2010
61 Connecting
62 ----------
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
63
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
64 All functions are documented with docstrings. To read usage documentation,
65 you can use help:
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
66
fdeccc9 @vomjom rename to pycassa because of a name conflict with another python proj…
vomjom authored Dec 24, 2009
67 >>> import pycassa
68 >>> help(pycassa.ColumnFamily.get)
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
69
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
70 To get a connection pool, pass a Keyspace and an optional list of servers:
5094347 @vomjom clarify timeouts in README
vomjom authored Mar 13, 2010
71
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
72 >>> pool = pycassa.connect('Keyspace1') # Defaults to connecting to the server at 'localhost:9160'
73 >>> pool = pycassa.connect('Keyspace1', ['192.168.2.10:9160'])
2e23389 @vomjom add login()
vomjom authored Apr 17, 2010
74
c6960b8 @thobbs REAMDE and tutorial improvements.
thobbs authored Dec 5, 2010
75 See the [tutorial](http://pycassa.github.com/pycassa/tutorial.html#connecting-to-cassandra) for more details.
2e23389 @vomjom add login()
vomjom authored Apr 17, 2010
76
d2067bf @vomjom reorganize README
vomjom authored Mar 13, 2010
77 Basic Usage
78 -----------
79
bf412d3 @vomjom remove emphasis
vomjom authored Dec 21, 2009
80 To use the standard interface, create a ColumnFamily instance.
47730d9 @vomjom update README to reflect new features
vomjom authored Dec 20, 2009
81
6c17a11 @thobbs Update README.mkd
thobbs authored Dec 2, 2010
82 >>> pool = pycassa.connect('Keyspace1')
83 >>> cf = pycassa.ColumnFamily(pool, 'Standard1')
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
84 >>> cf.insert('foo', {'column1': 'val1'})
906bd7f @vomjom update timestamp examples in README
vomjom authored Mar 15, 2010
85 1261349837816957
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
86 >>> cf.get('foo')
87 {'column1': 'val1'}
88
542d1b2 @thobbs Documentation and README updates
thobbs authored Nov 6, 2010
89 insert() also acts to update values:
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
90
91 >>> cf.insert('foo', {'column1': 'val2'})
906bd7f @vomjom update timestamp examples in README
vomjom authored Mar 15, 2010
92 1261349910511572
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
93 >>> cf.get('foo')
94 {'column1': 'val2'}
95
542d1b2 @thobbs Documentation and README updates
thobbs authored Nov 6, 2010
96 You may insert multiple columns at once:
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
97
98 >>> cf.insert('bar', {'column1': 'val3', 'column2': 'val4'})
906bd7f @vomjom update timestamp examples in README
vomjom authored Mar 15, 2010
99 1261350013606860
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
100 >>> cf.multiget(['foo', 'bar'])
101 {'foo': {'column1': 'val2'}, 'bar': {'column1': 'val3', 'column2': 'val4'}}
102 >>> cf.get_count('bar')
103 2
104
bf412d3 @vomjom remove emphasis
vomjom authored Dec 21, 2009
105 get_range() returns an iterable. Call it with list() to convert it to a list.
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
106
5cf5e6c @vomjom document timestamp more, get rid of iter_get_range()
vomjom authored Dec 21, 2009
107 >>> list(cf.get_range())
108 [('bar', {'column1': 'val3', 'column2': 'val4'}), ('foo', {'column1': 'val2'})]
109 >>> list(cf.get_range(row_count=1))
110 [('bar', {'column1': 'val3', 'column2': 'val4'})]
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
111
19c8195 @vomjom add docstrings to README.mkd
vomjom authored Dec 20, 2009
112 You can remove entire keys or just a certain column.
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
113
6186e49 @vomjom convert remove() to batch_mutate(). INCOMPATIBLE CHANGE if using the …
vomjom authored Apr 17, 2010
114 >>> cf.remove('bar', columns=['column1'])
906bd7f @vomjom update timestamp examples in README
vomjom authored Mar 15, 2010
115 1261350220106863
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
116 >>> cf.get('bar')
117 {'column2': 'val4'}
118 >>> cf.remove('bar')
906bd7f @vomjom update timestamp examples in README
vomjom authored Mar 15, 2010
119 1261350226926859
4bdc6ab @vomjom convert README to markdown
vomjom authored Dec 20, 2009
120 >>> cf.get('bar')
47730d9 @vomjom update README to reflect new features
vomjom authored Dec 21, 2009
121 Traceback (most recent call last):
122 ...
017b14e @vomjom update the exception message in README.mkd
vomjom authored Dec 22, 2009
123 cassandra.ttypes.NotFoundException: NotFoundException()
Something went wrong with that request. Please try again.