InfluxDB Python 客户端库使用教程

InfluxDB Python 客户端库使用教程

influxdb-client-python项目地址:https://gitcode.com/gh_mirrors/in/influxdb-client-python

1. 项目的目录结构及介绍

InfluxDB Python 客户端库的目录结构如下:

influxdb-client-python/
├── docs/
│   ├── api_reference.md
│   ├── async_api_reference.md
│   ├── development.md
│   ├── migration_guide.md
│   ├── user_guide.md
│   └── ...
├── examples/
│   ├── batching.py
│   ├── gzip.py
│   ├── pandas.py
│   ├── proxy.py
│   └── ...
├── influxdb_client/
│   ├── __init__.py
│   ├── client/
│   │   ├── __init__.py
│   │   ├── bucket_api.py
│   │   ├── organization_api.py
│   │   └── ...
│   ├── domain/
│   │   ├── __init__.py
│   │   ├── bucket.py
│   │   ├── organization.py
│   │   └── ...
│   ├── extras/
│   │   ├── __init__.py
│   │   ├── pandas_client.py
│   │   └── ...
│   ├── testing/
│   │   ├── __init__.py
│   │   ├── test_client.py
│   │   └── ...
│   └── ...
├── tests/
│   ├── __init__.py
│   ├── test_client.py
│   └── ...
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
└── ...

目录结构介绍

  • docs/:包含项目的文档文件,如API参考、用户指南、开发指南等。
  • examples/:包含使用该库的示例代码。
  • influxdb_client/:包含库的核心代码,包括客户端API、数据模型、额外功能等。
  • tests/:包含测试代码。
  • 根目录下的文件包括项目配置、许可证、README等。

2. 项目的启动文件介绍

项目的启动文件主要是influxdb_client/__init__.py,这个文件初始化了客户端库,并导入了主要的模块和类。

# influxdb_client/__init__.py

from .client import InfluxDBClient
from .client.bucket_api import BucketsApi
from .client.organization_api import OrganizationsApi
from .domain.bucket import Bucket
from .domain.organization import Organization
from .extras.pandas_client import PandasClient
from ._version import __version__

__all__ = [
    'InfluxDBClient',
    'BucketsApi',
    'OrganizationsApi',
    'Bucket',
    'Organization',
    'PandasClient',
    '__version__'
]

启动文件介绍

  • InfluxDBClient:主要的客户端类,用于与InfluxDB进行交互。
  • BucketsApiOrganizationsApi:用于管理存储桶和组织的API。
  • BucketOrganization:数据模型类。
  • PandasClient:用于与Pandas数据框架交互的额外功能。

3. 项目的配置文件介绍

项目的配置文件主要是setup.py,这个文件用于安装和管理依赖项。

# setup.py

from setuptools import setup, find_packages

with open('README.md', 'r') as fh:
    long_description = fh.read()

setup(
    name='influxdb-client',
    version='1.46.0dev0',
    author='InfluxData',
    author_email='contact@influxdata.com',
    description='InfluxDB 2.0 python client',
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://github.com/influxdata/influxdb-client-python',
    packages=find_packages(exclude=['tests']),
    install_requires=[
        'requests>=2.25.0',
        'rx>=3.1.0',
        'pandas>=1.1.5',
        'aiohttp>=3.7.4',
    ],
    classifiers=[
        'Development Status :: 5 - Production/Stable

influxdb-client-python项目地址:https://gitcode.com/gh_mirrors/in/influxdb-client-python

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潘俭渝Erik

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值