distribute all generated documentation
[rrdtool.git] / doc / rrdpython.pod
1 =head1 NAME
2
3 rrdpython - About the RRD Python bindings
4
5 =head1 SYNOPSIS
6
7  import rrdtool
8  rrdtool.create('/tmp/test.rrd', 'DS:foo:GUAGE:20:0:U')
9
10 =head1 DESCRIPTION
11
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)
15
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.
18
19 =head1 EXAMPLE
20
21  sys.path.append('/path/to/rrdtool/lib/python2.3/site-packages/')
22  import rrdtool, tempfile
23
24  DAY = 86400
25  YEAR = 365 * DAY
26  fd,path = tempfile.mkstemp('.png')
27
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')
39
40  info = rrdtool.info('downloads.rrd')
41  print info['last_update']
42  print info['ds']['downloads']['minimal_heartbeat']
43
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.
46
47 If rrdtool runs into trouble, it will throw an exception which you might want to catch.
48
49 =head1 SEE ALSO
50
51 rrdcreate, rrdupdate, rrdgraph, rrddump, rrdfetch, rrdtune, rrdlast,
52 rrdxport, rrdinfo
53
54 =head1 AUTHOR
55
56 Hye-Shik Chang E<lt>perky@i18n.orgE<gt>
57
58 Alan Milligan E<lt>alan.milligan@last-bastion.netE<gt>
59