{"id":9375,"library":"types-influxdb-client","title":"Typing Stubs for InfluxDB Client","description":"types-influxdb-client is a PEP 561 type stub package providing static type annotations for the `influxdb-client` library. It enables type-checking tools like Mypy, Pyright, and PyCharm to perform static analysis on code using `influxdb-client`. This particular version (`1.45.0.20241221`) targets `influxdb-client==1.45.*`. It is part of the actively maintained Typeshed project, which generally releases updates frequently.","status":"active","version":"1.45.0.20241221","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","influxdb","typeshed","type checking","mypy"],"install":[{"cmd":"pip install types-influxdb-client","lang":"bash","label":"Install package"},{"cmd":"pip install influxdb-client","lang":"bash","label":"Install peer dependency"}],"dependencies":[{"reason":"This package provides type stubs for the `influxdb-client` library itself; it is a peer dependency.","package":"influxdb-client","optional":false},{"reason":"Requires `urllib3>=2` since `types-influxdb-client` v1.37.0.1. Older `urllib3<2` requires `types-influxdb-client<1.37.0.1`.","package":"urllib3","optional":false}],"imports":[{"wrong":"from influxdb_client_stubs import InfluxDBClient","symbol":"InfluxDBClient","correct":"from influxdb_client_stubs import InfluxDBClient"}],"quickstart":{"code":"import os\nfrom influxdb_client import InfluxDBClient, Point\nfrom influxdb_client.client.write_api import SYNCHRONOUS\n\n# Configuration (use environment variables or replace with actual values)\nINFLUXDB_URL = os.environ.get('INFLUXDB_URL', 'http://localhost:8086')\nINFLUXDB_TOKEN = os.environ.get('INFLUXDB_TOKEN', 'my-super-secret-token')\nINFLUXDB_ORG = os.environ.get('INFLUXDB_ORG', 'my-org')\nINFLUXDB_BUCKET = os.environ.get('INFLUXDB_BUCKET', 'my-bucket')\n\ndef write_and_query_data() -> None:\n    try:\n        with InfluxDBClient(url=INFLUXDB_URL, token=INFLUXDB_TOKEN, org=INFLUXDB_ORG) as client:\n            write_api = client.write_api(write_options=SYNCHRONOUS)\n\n            p = Point(\"my_measurement\").tag(\"location\", \"Prague\").field(\"temperature\", 25.3)\n            write_api.write(bucket=INFLUXDB_BUCKET, record=p)\n            print(f\"Successfully wrote point: {p.to_line_protocol()}\")\n\n            query_api = client.query_api()\n            tables = query_api.query(f'from(bucket:\"{INFLUXDB_BUCKET}\") |> range(start: -1h)')\n\n            print(\"\\nQuery Results:\")\n            for table in tables:\n                for record in table.records:\n                    print(f\"  {record.get_measurement()}: {record.get_field()}={record.get_value()} @ {record.get_time()}\")\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    write_and_query_data()","lang":"python","description":"This quickstart demonstrates basic InfluxDB client usage with type hints. It connects to an InfluxDB instance, writes a data point using a `Point` object, and then queries the data, showcasing how the type stubs aid in correct API usage and provide autocompletion and static checks."},"warnings":[{"fix":"If `influxdb-client>=1.46.0` is installed, uninstall this stub package: `pip uninstall types-influxdb-client`.","message":"The `influxdb-client` library (runtime package) includes its own type annotations from version `1.46.0` onwards. If you are using `influxdb-client>=1.46.0`, you MUST uninstall `types-influxdb-client` to avoid duplicate type definitions and potential type-checking errors.","severity":"breaking","affected_versions":"types-influxdb-client (all versions) used with influxdb-client>=1.46.0"},{"fix":"Always align the `types-influxdb-client` version with the `influxdb-client` version you are using. The stub package's version number (excluding the last part) usually indicates the target `influxdb-client` version (e.g., `1.45.0.x` for `influxdb-client==1.45.*`).","message":"This specific version of `types-influxdb-client` (`1.45.0.20241221`) is intended to provide accurate annotations for `influxdb-client==1.45.*`. Using it with significantly different versions of `influxdb-client` (e.g., `1.30.x` or `1.49.x`) may lead to incorrect type-checking results due to API mismatches.","severity":"gotcha","affected_versions":"All versions of types-influxdb-client when runtime library version is mismatched."},{"fix":"Ensure `urllib3>=2` is installed. If `urllib3<2` is strictly required, you must downgrade `types-influxdb-client` to a version `<1.37.0.1` (e.g., `pip install 'types-influxdb-client<1.37.0.1'`).","message":"This package, `types-influxdb-client`, requires `urllib3>=2` since its version `1.37.0.1`. If your project environment necessitates `urllib3<2`, you will encounter dependency conflicts or runtime issues.","severity":"gotcha","affected_versions":"types-influxdb-client>=1.37.0.1 with urllib3<2"}],"env_vars":null,"search_vec":"'1.45':56 '1.45.0.20241221':51 '561':13 'activ':62 'analysi':41 'annot':20 'check':31,76 'client':5,9,25,47,55 'code':43 'enabl':28 'frequent':70 'general':67 'influxdb':4,8,24,46,54,73 'influxdb-cli':23,45,53 'librari':26 'like':33 'maintain':63 'mypi':34,77 'packag':16 'part':59 'particular':49 'pep':12 'perform':39 'project':65 'provid':17 'pycharm':37 'pyright':35 'releas':68 'static':18,40 'stub':2,15,72 'target':52 'tool':32 'type':1,7,14,19,30,71,75 'type-check':29 'types-influxdb-cli':6 'typesh':64,74 'updat':69 'use':44 'version':50","created_at":"2026-04-16T18:49:53.740012+00:00","updated_at":"2026-04-16T18:49:53.740012+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'influxdb_client_stubs'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.45.0.20241221","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/typeshed-internal/stub_uploader","docs":null,"changelog":"https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/influxdb-client.md","pypi":"https://pypi.org/project/types-influxdb-client/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}