Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 9216a55

Browse files
authored
Merge branch 'master' into ping
2 parents 738b033 + 2b95797 commit 9216a55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1315
-711
lines changed

.travis.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,35 @@ addons:
66
- wget
77

88
matrix:
9+
allow_failures:
10+
- python: 3.4
11+
env: TOX_ENV=docs
912
include:
1013
- python: 2.7
1114
env: TOX_ENV=py27
15+
- python: 2.7
16+
env: TOX_ENV=pep257
1217
- python: pypy-5.3.1
1318
env: TOX_ENV=pypy
1419
- python: 3.4
1520
env: TOX_ENV=py34
16-
# An issue in travis-ci prevents this case from running
17-
# Link to issue: https://github.com/travis-ci/travis-ci/issues/6304
18-
# - python: pypy3.3-5.2-alpha1
19-
# env: TOX_ENV=pypy3
20-
- python: 3.4
21+
- python: 3.5
22+
env: TOX_ENV=py35
23+
- python: 3.6
24+
env: TOX_ENV=py36
25+
- python: 3.6
2126
env: TOX_ENV=docs
22-
- python: 3.4
27+
- python: 3.6
2328
env: TOX_ENV=flake8
24-
- python: 3.4
29+
- python: 3.6
2530
env: TOX_ENV=coverage
2631

2732
install:
2833
- pip install tox
34+
- pip install setuptools==20.6.6
2935
- pip install coveralls
3036
- mkdir influxdb_install
31-
- wget https://dl.influxdata.com/influxdb/releases/influxdb_1.1.0_amd64.deb
37+
- wget https://dl.influxdata.com/influxdb/releases/influxdb_1.2.4_amd64.deb
3238
- dpkg -x influxdb*.deb influxdb_install
3339
script:
3440
- export INFLUXDB_PYTHON_INFLUXD_PATH=$(pwd)/influxdb_install/usr/bin/influxd

README.rst

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
2-
3-
InfluxDB-Python is a client for interacting with InfluxDB_. Maintained by @aviau (https://github.com/aviau).
4-
5-
**Help needed:** Development of this library is made by the community and help is needed. A co-maintainer would be welcome. To contribute, take a look at the issues list of simply contact @aviau.
1+
InfluxDB-Python
2+
===============
63

74
.. image:: https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
85
:target: https://travis-ci.org/influxdata/influxdb-python
@@ -15,22 +12,39 @@ InfluxDB-Python is a client for interacting with InfluxDB_. Maintained by @aviau
1512
:target: https://coveralls.io/r/influxdata/influxdb-python
1613
:alt: Coverage
1714

15+
16+
17+
InfluxDB-Python is a client for interacting with InfluxDB_. Development of this library is maintained by
18+
19+
+-----------+-------------------------------+
20+
| Github ID | URL |
21+
+===========+===============================+
22+
| @aviau | (https://github.com/aviau) |
23+
+-----------+-------------------------------+
24+
| @xginn8 | (https://github.com/xginn8) |
25+
+-----------+-------------------------------+
26+
| @sebito91 | (https://github.com/sebito91) |
27+
+-----------+-------------------------------+
28+
1829
.. _readme-about:
1930

20-
InfluxDB is an open-source distributed time series database, find more about InfluxDB_ at http://influxdata.com/
31+
InfluxDB is an open-source distributed time series database, find more about InfluxDB_ at https://docs.influxdata.com/influxdb/latest
2132

2233

2334
.. _installation:
2435

2536
InfluxDB pre v1.1.0 users
26-
=========================
37+
-------------------------
38+
39+
This module is tested with InfluxDB v1.2.4, our recommended version. Though there have been v1.3 (initial TSI branch) and v1.4 releases these are not
40+
yet supported.
2741

28-
InfluxDB 1.1.0 was released and it is the new recommended version. InfluxDB 0.8.x users may still use the legacy client by using ``from influxdb.influxdb08 import InfluxDBClient`` instead.
42+
Those users still on InfluxDB v0.8.x users may still use the legacy client by importing ``from influxdb.influxdb08 import InfluxDBClient``.
2943

3044
Installation
31-
============
45+
------------
3246

33-
Install, upgrade and uninstall InfluxDB-Python with these commands::
47+
Install, upgrade and uninstall influxdb-python with these commands::
3448

3549
$ pip install influxdb
3650
$ pip install --upgrade influxdb
@@ -41,11 +55,11 @@ On Debian/Ubuntu, you can install it with this command::
4155
$ sudo apt-get install python-influxdb
4256

4357
Dependencies
44-
============
58+
------------
4559

46-
The InfluxDB-Python distribution is supported and tested on Python 2.7, 3.3, 3.4, PyPy and PyPy3.
60+
The influxdb-python distribution is supported and tested on Python 2.7, 3.3, 3.4, 3.5, 3.6, PyPy and PyPy3.
4761

48-
**Note:** Python 3.2 is currently untested. See ``.travis.yml``.
62+
**Note:** Python 3.2 is currently untested. See ``.travis.yml``.
4963

5064
Main dependency is:
5165

@@ -61,9 +75,9 @@ Additional dependencies are:
6175

6276

6377
Documentation
64-
=============
78+
-------------
6579

66-
InfluxDB-Python documentation is available at http://influxdb-python.readthedocs.org
80+
Documentation is available at https://influxdb-python.readthedocs.io/en/latest/.
6781

6882
You will need Sphinx_ installed to generate the documentation.
6983

@@ -76,7 +90,7 @@ Generated documentation can be found in the *docs/build/html/* directory.
7690

7791

7892
Examples
79-
========
93+
--------
8094

8195
Here's a basic example (for more see the examples directory)::
8296

@@ -110,7 +124,7 @@ Here's a basic example (for more see the examples directory)::
110124

111125

112126
Testing
113-
=======
127+
-------
114128

115129
Make sure you have tox by running the following::
116130

@@ -122,34 +136,43 @@ To test influxdb-python with multiple version of Python, you can use Tox_::
122136

123137

124138
Support
125-
=======
139+
-------
126140

127141
For issues with, questions about, or feedback for InfluxDB_, please look into
128142
our community page: http://influxdb.com/community/.
129143

144+
We are also lurking on the following:
145+
146+
- #influxdb on irc.freenode.net
147+
- #influxdb on gophers.slack.com
148+
130149

131150
Development
132-
===========
151+
-----------
133152

134153
All development is done on Github_. Use Issues_ to report
135154
problems or submit contributions.
136155

137156
.. _Github: https://github.com/influxdb/influxdb-python/
138157
.. _Issues: https://github.com/influxdb/influxdb-python/issues
139158

140-
141-
TODO
142-
====
143-
144-
The TODO/Roadmap can be found in Github bug tracker: https://github.com/influxdata/influxdb-python/issues
159+
Please note that we WILL get to your questions/issues/concerns as quickly as possible. We maintain many
160+
software repositories and sometimes things may get pushed to the backburner. Please don't take offense,
161+
we will do our best to reply as soon as possible!
145162

146163

147164
Source code
148-
===========
165+
-----------
149166

150167
The source code is currently available on Github: https://github.com/influxdata/influxdb-python
151168

152169

170+
TODO
171+
----
172+
173+
The TODO/Roadmap can be found in Github bug tracker: https://github.com/influxdata/influxdb-python/issues
174+
175+
153176
.. _InfluxDB: https://influxdata.com/time-series-platform/influxdb/
154177
.. _Sphinx: http://sphinx.pocoo.org/
155178
.. _Tox: https://tox.readthedocs.org

dev-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
requests
1+
requests>=2.17.0
22
nose
33
mock
4-
pandas
5-
Sphinx==1.2.3
4+
pandas==0.20.1
5+
Sphinx==1.5.5
66
sphinx_rtd_theme
77
wheel
88
twine

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
3+
"""InfluxDB documentation build configuration file."""
4+
35
# InfluxDB documentation build configuration file, created by
46
# sphinx-quickstart on Thu Oct 16 00:33:06 2014.
57
#

examples/tutorial.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
"""Tutorial on using the InfluxDB client."""
3+
14
import argparse
25

36
from influxdb import InfluxDBClient
47

58

69
def main(host='localhost', port=8086):
10+
"""Instantiate a connection to the InfluxDB."""
711
user = 'root'
812
password = 'root'
913
dbname = 'example'
@@ -41,7 +45,7 @@ def main(host='localhost', port=8086):
4145
print("Write points: {0}".format(json_body))
4246
client.write_points(json_body)
4347

44-
print("Queying data: " + query)
48+
print("Querying data: " + query)
4549
result = client.query(query)
4650

4751
print("Result: {0}".format(result))
@@ -54,9 +58,11 @@ def main(host='localhost', port=8086):
5458

5559

5660
def parse_args():
61+
"""Parse the args."""
5762
parser = argparse.ArgumentParser(
5863
description='example code to play with InfluxDB')
59-
parser.add_argument('--host', type=str, required=False, default='localhost',
64+
parser.add_argument('--host', type=str, required=False,
65+
default='localhost',
6066
help='hostname of InfluxDB http API')
6167
parser.add_argument('--port', type=int, required=False, default=8086,
6268
help='port of InfluxDB http API')

examples/tutorial_pandas.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
"""Tutorial for using pandas and the InfluxDB client."""
3+
14
import argparse
25
import pandas as pd
36

47
from influxdb import DataFrameClient
58

69

710
def main(host='localhost', port=8086):
11+
"""Instantiate the connection to the InfluxDB client."""
812
user = 'root'
913
password = 'root'
10-
dbname = 'example'
14+
dbname = 'demo'
15+
# Temporarily avoid line protocol time conversion issues #412, #426, #431.
16+
protocol = 'json'
1117

1218
client = DataFrameClient(host, port, user, password, dbname)
1319

@@ -20,19 +26,21 @@ def main(host='localhost', port=8086):
2026
client.create_database(dbname)
2127

2228
print("Write DataFrame")
23-
client.write_points(df, 'demo')
29+
client.write_points(df, 'demo', protocol=protocol)
2430

2531
print("Write DataFrame with Tags")
26-
client.write_points(df, 'demo', {'k1': 'v1', 'k2': 'v2'})
32+
client.write_points(df, 'demo',
33+
{'k1': 'v1', 'k2': 'v2'}, protocol=protocol)
2734

2835
print("Read DataFrame")
2936
client.query("select * from demo")
3037

3138
print("Delete database: " + dbname)
32-
client.delete_database(dbname)
39+
client.drop_database(dbname)
3340

3441

3542
def parse_args():
43+
"""Parse the args from main."""
3644
parser = argparse.ArgumentParser(
3745
description='example code to play with InfluxDB')
3846
parser.add_argument('--host', type=str, required=False,

examples/tutorial_serieshelper.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
"""
2-
Tutorial/Example how to use the class helper `SeriesHelper`
3-
"""
1+
# -*- coding: utf-8 -*-
2+
"""Tutorial how to use the class helper `SeriesHelper`."""
43

54
from influxdb import InfluxDBClient
65
from influxdb import SeriesHelper
@@ -20,18 +19,28 @@
2019

2120

2221
class MySeriesHelper(SeriesHelper):
23-
# Meta class stores time series helper configuration.
22+
"""Instantiate SeriesHelper to write points to the backend."""
23+
2424
class Meta:
25+
"""Meta class stores time series helper configuration."""
26+
2527
# The client should be an instance of InfluxDBClient.
2628
client = myclient
27-
# The series name must be a string. Add dependent fields/tags in curly brackets.
29+
30+
# The series name must be a string. Add dependent fields/tags
31+
# in curly brackets.
2832
series_name = 'events.stats.{server_name}'
33+
2934
# Defines all the fields in this time series.
3035
fields = ['some_stat', 'other_stat']
36+
3137
# Defines all the tags for the series.
3238
tags = ['server_name']
33-
# Defines the number of data points to store prior to writing on the wire.
39+
40+
# Defines the number of data points to store prior to writing
41+
# on the wire.
3442
bulk_size = 5
43+
3544
# autocommit must be set to True when using bulk_size
3645
autocommit = True
3746

@@ -42,7 +51,8 @@ class Meta:
4251
MySeriesHelper(server_name='us.east-1', some_stat=159, other_stat=10)
4352
MySeriesHelper(server_name='us.east-1', some_stat=158, other_stat=20)
4453
MySeriesHelper(server_name='us.east-1', some_stat=157, other_stat=30)
45-
MySeriesHelper(server_name='us.east-1', some_stat=156, other_stat=40)
54+
MySeriesHelper(server_name='us.east-1', some_stat=156, other_stat=30)
55+
MySeriesHelper(server_name='us.east-1', some_stat=156)
4656
MySeriesHelper(server_name='us.east-1', some_stat=155, other_stat=50)
4757

4858
# To manually submit data points which are not yet written, call commit:

0 commit comments

Comments
 (0)