Debian Codegraph @

README.rst

raw
1 The v1 client libraries for InfluxDB were typically developed and maintained by
2 community members. For InfluxDB 3.0 users, this library is succeeded by the
3 lightweight `v3 client library <https://github.com/InfluxCommunity/influxdb3-python>`_.
4 For InfluxDB 2.0 users, look at the `v2 client library
5 <https://github.com/influxdata/influxdb-client-python>`_.
6
7 If there are still users of this v1 client library, and they or somebody else
8 are willing to keep them updated with security fixes at a minimum please reach
9 out on the `Community Forums <https://community.influxdata.com/>`_ or
10 `InfluxData Slack <https://influxdata.com/slack>`_.
11
12 InfluxDB-Python
13 ===============
14
15 .. image:: https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
16 :target: https://travis-ci.org/influxdata/influxdb-python
17 .. image:: https://readthedocs.org/projects/influxdb-python/badge/?version=latest&style
18 :target: http://influxdb-python.readthedocs.org/
19 :alt: Documentation Status
20
21 .. image:: https://img.shields.io/coveralls/influxdata/influxdb-python.svg
22 :target: https://coveralls.io/r/influxdata/influxdb-python
23 :alt: Coverage
24
25 .. image:: https://img.shields.io/pypi/v/influxdb.svg
26 :target: https://pypi.python.org/pypi/influxdb
27 :alt: PyPI Status
28
29 InfluxDB-Python is a client for interacting with InfluxDB_.
30
31 **Note: This library is for use with InfluxDB 1.x. For connecting to InfluxDB 2.x instances, please use the the** `influxdb-client-python <https://github.com/influxdata/influxdb-client-python>`_ **client.**
32
33 Development of this library is maintained by:
34
35 +-----------+-------------------------------+
36 | Github ID | URL |
37 +===========+===============================+
38 | @aviau | (https://github.com/aviau) |
39 +-----------+-------------------------------+
40 | @xginn8 | (https://github.com/xginn8) |
41 +-----------+-------------------------------+
42 | @sebito91 | (https://github.com/sebito91) |
43 +-----------+-------------------------------+
44
45 .. _readme-about:
46
47 InfluxDB is an open-source distributed time series database, find more about InfluxDB_ at https://docs.influxdata.com/influxdb/latest
48
49
50 .. _installation:
51
52 InfluxDB pre v1.1.0 users
53 -------------------------
54
55 This module is tested with InfluxDB versions: v1.2.4, v1.3.9, v1.4.3, v1.5.4, v1.6.4, and 1.7.4.
56
57 Those users still on InfluxDB v0.8.x users may still use the legacy client by importing ``from influxdb.influxdb08 import InfluxDBClient``.
58
59 Installation
60 ------------
61
62 Install, upgrade and uninstall influxdb-python with these commands::
63
64 $ pip install influxdb
65 $ pip install --upgrade influxdb
66 $ pip uninstall influxdb
67
68 On Debian/Ubuntu, you can install it with this command::
69
70 $ sudo apt-get install python-influxdb
71
72 Dependencies
73 ------------
74
75 The influxdb-python distribution is supported and tested on Python 2.7, 3.5, 3.6, 3.7, PyPy and PyPy3.
76
77 **Note:** Python <3.5 are currently untested. See ``.travis.yml``.
78
79 Main dependency is:
80
81 - Requests: HTTP library for human beings (http://docs.python-requests.org/)
82
83
84 Additional dependencies are:
85
86 - pandas: for writing from and reading to DataFrames (http://pandas.pydata.org/)
87 - Sphinx: Tool to create and manage the documentation (http://sphinx-doc.org/)
88 - Nose: to auto-discover tests (http://nose.readthedocs.org/en/latest/)
89 - Mock: to mock tests (https://pypi.python.org/pypi/mock)
90
91
92 Documentation
93 -------------
94
95 Documentation is available at https://influxdb-python.readthedocs.io/en/latest/.
96
97 You will need Sphinx_ installed to generate the documentation.
98
99 The documentation can be generated by running::
100
101 $ tox -e docs
102
103
104 Generated documentation can be found in the *docs/build/html/* directory.
105
106
107 Examples
108 --------
109
110 Here's a basic example (for more see the examples directory)::
111
112 $ python
113
114 >>> from influxdb import InfluxDBClient
115
116 >>> json_body = [
117 {
118 "measurement": "cpu_load_short",
119 "tags": {
120 "host": "server01",
121 "region": "us-west"
122 },
123 "time": "2009-11-10T23:00:00Z",
124 "fields": {
125 "value": 0.64
126 }
127 }
128 ]
129
130 >>> client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
131
132 >>> client.create_database('example')
133
134 >>> client.write_points(json_body)
135
136 >>> result = client.query('select value from cpu_load_short;')
137
138 >>> print("Result: {0}".format(result))
139
140
141 Testing
142 -------
143
144 Make sure you have tox by running the following::
145
146 $ pip install tox
147
148 To test influxdb-python with multiple version of Python, you can use Tox_::
149
150 $ tox
151
152
153 Support
154 -------
155
156 For issues with, questions about, or feedback for InfluxDB_, please look into
157 our community page: http://influxdb.com/community/.
158
159 We are also lurking on the following:
160
161 - #influxdb on irc.freenode.net
162 - #influxdb on gophers.slack.com
163
164
165 Development
166 -----------
167
168 All development is done on Github_. Use Issues_ to report
169 problems or submit contributions.
170
171 .. _Github: https://github.com/influxdb/influxdb-python/
172 .. _Issues: https://github.com/influxdb/influxdb-python/issues
173
174 Please note that we WILL get to your questions/issues/concerns as quickly as possible. We maintain many
175 software repositories and sometimes things may get pushed to the backburner. Please don't take offense,
176 we will do our best to reply as soon as possible!
177
178
179 Source code
180 -----------
181
182 The source code is currently available on Github: https://github.com/influxdata/influxdb-python
183
184
185 TODO
186 ----
187
188 The TODO/Roadmap can be found in Github bug tracker: https://github.com/influxdata/influxdb-python/issues
189
190
191 .. _InfluxDB: https://influxdata.com/time-series-platform/influxdb/
192 .. _Sphinx: http://sphinx.pocoo.org/
193 .. _Tox: https://tox.readthedocs.org