Code

rrdtool dump is now backward compatible with rrdtool 1.3 dump again. Default is ...
[rrdtool.git] / doc / rrdpython.pod
1 =head1 NAME
3 rrdpython - About the RRD Python bindings
5 =head1 SYNOPSIS
7  import rrdtool
8  rrdtool.create('/tmp/test.rrd', 'DS:foo:GAUGE:20:0:U')
10 =head1 DESCRIPTION
12 The B<rrdtool> functions are directly callable via the Python programming
13 language. This wrapper implementation has been written from the scratch
14 (without  SWIG)
16 The API's simply expects string parameters to the functions.  Please refer
17 to the other B<rrdtool> documentation for functions and valid arguments.
19 =head1 EXAMPLE
21  import sys
22  sys.path.append('/path/to/rrdtool/lib/python2.3/site-packages/')
23  import rrdtool, tempfile
25  DAY = 86400
26  YEAR = 365 * DAY
27  fd,path = tempfile.mkstemp('.png')
29  rrdtool.graph(path,
30               '--imgformat', 'PNG',
31               '--width', '540',
32               '--height', '100',
33               '--start', "-%i" % YEAR,
34               '--end', "-1",
35               '--vertical-label', 'Downloads/Day',
36               '--title', 'Annual downloads',
37               '--lower-limit', '0',
38               'DEF:downloads=downloads.rrd:downloads:AVERAGE',
39               'AREA:downloads#990033:Downloads')
41  info = rrdtool.info('downloads.rrd')
42  print info['last_update']
43  print info['ds']['downloads']['minimal_heartbeat']
45 If you use the B<site-python-install> make target you can drop to first sys.path.append
46 line since the rrdtool module will be available everywhere.
48 If rrdtool runs into trouble, it will throw an exception which you might want to catch.
50 =head1 SEE ALSO
52 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,
53 rrdxport, rrdinfo
55 =head1 AUTHOR
57 Hye-Shik Chang E<lt>perky@i18n.orgE<gt>
59 Alan Milligan E<lt>alan.milligan@last-bastion.netE<gt>