1 =head1 NAME
3 rrdpython - About the RRD Python bindings
5 =head1 SYNOPSIS
7 import rrdtool
8 rrdtool.create('/tmp/test.rrd', 'DS:foo:GUAGE: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 sys.path.append('/path/to/rrdtool/lib/python2.3/site-packages/')
22 import rrdtool, tempfile
24 DAY = 86400
25 YEAR = 365 * DAY
26 fd,path = tempfile.mkstemp('.png')
28 rrdtool.graph(path,
29 '--imgformat', 'PNG',
30 '--width', '540',
31 '--height', '100',
32 '--start', "-%i" % YEAR,
33 '--end', "-1",
34 '--vertical-label', 'Downloads/Day',
35 '--title', 'Annual downloads',
36 '--lower-limit', '0',
37 'DEF:downloads=downloads.rrd:downloads:AVERAGE',
38 'AREA:downloads#990033:Downloads')
40 info = rrdtool.info('downloads.rrd')
41 print info['last_update']
42 print info['ds']['downloads']['minimal_heartbeat']
44 If you use the B<site-python-install> make target you can drop to first sys.path.append
45 line since the rrdtool module will be available everywhere.
47 If rrdtool runs into trouble, it will throw an exception which you might want to catch.
49 =head1 SEE ALSO
51 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,
52 rrdxport, rrdinfo
54 =head1 AUTHOR
56 Hye-Shik Chang E<lt>perky@i18n.orgE<gt>
58 Alan Milligan E<lt>alan.milligan@last-bastion.netE<gt>