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

Commit cab86ba

Browse files
author
徐鹏
committed
rename the package & rewrite some doc
1 parent c2d9721 commit cab86ba

34 files changed

+90
-7
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: python
22

33
python:
4-
- "2.7"
5-
- "3.5"
64
- "3.6"
75
- "3.7"
86
- "pypy"

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
## InfluxDB-Python-Aio
2+
--------------
3+
4+
.. image:: https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
5+
:target: https://travis-ci.org/influxdata/influxdb-python
6+
.. image:: https://readthedocs.org/projects/influxdb-python/badge/?version=latest&style
7+
:target: http://influxdb-python.readthedocs.org/
8+
:alt: Documentation Status
9+
10+
.. image:: https://img.shields.io/coveralls/influxdata/influxdb-python.svg
11+
:target: https://coveralls.io/r/influxdata/influxdb-python
12+
:alt: Coverage
13+
14+
.. image:: https://img.shields.io/pypi/v/influxdb.svg
15+
:target: https://pypi.org/project/influxdb-aio/
16+
:alt: PyPI Status
17+
18+
--------------
19+
20+
### Statement
21+
**This was forked from (https://github.com/influxdata/influxdb-python), and support asyncio.**<br/>
22+
[Here](README.original.rst) is the original README document. You can find more detail about InfluxDB-Python (client) and also influxdb (database). Here is only some difference and basic usage.
23+
24+
InfluxDB-Python is a client for interacting with InfluxDB_.
25+
26+
Development of this library is maintained by:
27+
28+
| Github ID| URL |
29+
| --- | --- |
30+
| @aviau | (https://github.com/aviau) |
31+
| @xginn8 | (https://github.com/xginn8) |
32+
| @sebito91 | (https://github.com/sebito91) |
33+
34+
### Installation
35+
36+
Install, upgrade and uninstall influxdb-aio with these commands::
37+
38+
$ pip install influxdb-aio
39+
$ pip install --upgrade influxdb-aio
40+
$ pip uninstall influxdb-aio
41+
42+
### Dependencies
43+
44+
The influxdb-python distribution is supported only on Python 3.6, 3.7, etc.
45+
46+
47+
Main dependency is:
48+
49+
- httpx: A next generation HTTP client for Python. (https://github.com/encode/httpx)
50+
51+
52+
### Examples
53+
--------
54+
55+
Here's a basic example (for more see the examples directory)
56+
57+
~~~python
58+
import asyncio
59+
from influxdb_aio import InfluxDBClient
60+
61+
json_body = [
62+
{
63+
"measurement": "cpu_load_short",
64+
"tags": {
65+
"host": "server01",
66+
"region": "us-west"
67+
},
68+
"time": "2009-11-10T23:00:00Z",
69+
"fields": {
70+
"value": 0.64
71+
}
72+
}
73+
]
74+
75+
async def init_client():
76+
client = await InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
77+
await client.create_database('example')
78+
return client.write_points(json_body)
79+
80+
81+
async def main():
82+
client = await init_client()
83+
result = await client.query('select value from cpu_load_short;')
84+
print("Result: {0}".format(result))
85+
86+
87+
if __name__ == '__main__' :
88+
asyncio.get_event_loop().run_until_complete(main())
89+
~~~

README.rst renamed to README.original.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@ InfluxDB-Python
1212
:alt: Coverage
1313

1414
.. image:: https://img.shields.io/pypi/v/influxdb.svg
15-
:target: https://pypi.python.org/pypi/influxdb
15+
:target: https://pypi.org/project/influxdb-aio/
1616
:alt: PyPI Status
1717

18-
Statement
19-
-----------
20-
This is forked from (https://github.com/influxdata/influxdb-python), which support asyncio.
21-
2218
InfluxDB-Python is a client for interacting with InfluxDB_.
2319

2420
Development of this library is maintained by:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)