2023-09-27T15:27:54,057 Created temporary directory: /tmp/pip-build-tracker-0nywb_ay 2023-09-27T15:27:54,059 Initialized build tracking at /tmp/pip-build-tracker-0nywb_ay 2023-09-27T15:27:54,059 Created build tracker: /tmp/pip-build-tracker-0nywb_ay 2023-09-27T15:27:54,059 Entered build tracker: /tmp/pip-build-tracker-0nywb_ay 2023-09-27T15:27:54,060 Created temporary directory: /tmp/pip-wheel-mujlt_mr 2023-09-27T15:27:54,064 Created temporary directory: /tmp/pip-ephem-wheel-cache-vpjwgf1j 2023-09-27T15:27:54,085 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-09-27T15:27:54,089 2 location(s) to search for versions of apache-iotdb: 2023-09-27T15:27:54,089 * https://pypi.org/simple/apache-iotdb/ 2023-09-27T15:27:54,089 * https://www.piwheels.org/simple/apache-iotdb/ 2023-09-27T15:27:54,089 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2023-09-27T15:27:54,090 Getting page https://pypi.org/simple/apache-iotdb/ 2023-09-27T15:27:54,092 Found index url https://pypi.org/simple/ 2023-09-27T15:27:54,348 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2023-09-27T15:27:54,360 Found link https://files.pythonhosted.org/packages/76/14/d01b6281df00530c69bc8eae2074b9970bbe865a5e971b5cd2019e8b8250/apache-iotdb-0.9.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.0 2023-09-27T15:27:54,361 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/84/aa/fa9401ccadb89ddce7c2b8a03baee9dbb9913c52b5936d0ec7968cabf056/apache_iotdb-0.9.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,362 Found link https://files.pythonhosted.org/packages/01/fa/e65db378e4d8e07322ec175f37568bceb55ebb3c8397fa7b48e9f087c451/apache-iotdb-0.9.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.2 2023-09-27T15:27:54,362 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/43/8d/72fa03325e9281b613a0eabae9cc7c606ce0e8952bee0c3ca855e4579a1d/apache_iotdb-0.9.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,363 Found link https://files.pythonhosted.org/packages/34/95/030c2da665358de8ba950099b3b0397dca437fcde60d5d1730d0c451d5e3/apache-iotdb-0.9.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.3 2023-09-27T15:27:54,364 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/5c/d4/2e329baab32ad93730ba4b79df9b91f1d55d0d37428a5dbbe2dd4c9f3a9d/apache_iotdb-0.9.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,365 Found link https://files.pythonhosted.org/packages/1d/dc/138e08717f8c2e0e238f35d39b34af6cfc1c7a1332b6aa4689750f4fda26/apache-iotdb-0.10.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.0 2023-09-27T15:27:54,366 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c3/76/46884f04945b6f02bbec4e06d83fafc16f326ca0f9b35b8c0141018990c0/apache_iotdb-0.10.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,367 Found link https://files.pythonhosted.org/packages/f6/4d/b229b9f309431e8164c9cd893431009a57efcaa059f58c1091d222601da3/apache-iotdb-0.10.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.1 2023-09-27T15:27:54,367 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d6/87/2e003dcf87ffa8e73f48a62a107b989967e906670d905a05ae1c1349f396/apache_iotdb-0.10.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,368 Found link https://files.pythonhosted.org/packages/16/8b/2ec65fa81d5961bd927c02d6a209490bf325b2a164506cd3b12e846d7061/apache-iotdb-0.11.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.0 2023-09-27T15:27:54,369 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/47/c8/047703f7e8125b15361c766b90c6f1cbdbf797f84803f38b1732c1a386cb/apache_iotdb-0.11.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,370 Found link https://files.pythonhosted.org/packages/55/a1/ef100f67e0f26fbc1d19b84115b21de942e7b7e01803706d19f841ac06c1/apache-iotdb-0.11.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.1 2023-09-27T15:27:54,371 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/9f/dce2d782c8b64700539039ef5d66f5f7a781689538c0a176cf56099ec9d1/apache_iotdb-0.11.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,372 Found link https://files.pythonhosted.org/packages/69/d5/f1b9ff293fe02eb1f1cb3cba13b5d9a4b547415ab0045b2a8a3612249e12/apache-iotdb-0.11.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.2 2023-09-27T15:27:54,372 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/96/a5f0c63659cc8477c53d8a8321c07ea5a0bb2430abaaab477a6185bb43a1/apache_iotdb-0.11.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,373 Found link https://files.pythonhosted.org/packages/7d/cf/0d672a828527f59cdc66c078b0b8e356ca0a3191224a4363ce2256337d1c/apache-iotdb-0.11.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.3 2023-09-27T15:27:54,374 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d2/c7/6709b26341e59788d05a297182aa3f96c692e85421c169f657e92c3b4765/apache_iotdb-0.11.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,375 Found link https://files.pythonhosted.org/packages/00/a1/5b1b8a2754f4b25420d9a4461b5e2b8573bb89b43054f9303ea0558df0de/apache-iotdb-0.11.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.4 2023-09-27T15:27:54,375 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/48/f4/a21fd4495f93c428de788a477665f1815b257568469c38108666125fff4b/apache_iotdb-0.11.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,376 Found link https://files.pythonhosted.org/packages/9e/16/bb2ef45f62e9866f1be97f04e2c581247d3b145e5d8a01b7c143023c6c45/apache-iotdb-0.12.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.0 2023-09-27T15:27:54,377 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/32/e051c3ce387e54b1f036995e92ff352895cf01a51b170752e906a7d42364/apache_iotdb-0.12.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,378 Found link https://files.pythonhosted.org/packages/20/0c/b39e9f362fb0a1a43cb0a05a5b2d9163815f0048575e0c071bbaa50070b8/apache-iotdb-0.12.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.1 2023-09-27T15:27:54,378 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/55/cf/219a0c3cd17537cebf6e67deeaa77b57741c9b40bcddbb7f59ac9b828401/apache_iotdb-0.12.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,379 Found link https://files.pythonhosted.org/packages/fd/64/d83ceaaab941dd78df38cd8c35d27028a27724c2535f0e6f01a48472aa28/apache-iotdb-0.12.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.2 2023-09-27T15:27:54,380 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/0b/33/60af46cbc25d7ecf9722bf311295cb0acbf2841f6eb3e3af7433ac3e199d/apache_iotdb-0.12.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,381 Found link https://files.pythonhosted.org/packages/24/7c/81a9dcfd218d4654b03d9079578659d6201aa4f9e9ccba328c0742e8e9c1/apache-iotdb-0.12.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.3 2023-09-27T15:27:54,382 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/ae/e79cef98fa20cf977ea22b065fcff8d7b976922dd281f4a74a02b1a72b41/apache_iotdb-0.12.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,383 Found link https://files.pythonhosted.org/packages/9e/11/0d12f9b906b3aac1446c09e297bcdf3a0cdfb016aae1ec77effa214999de/apache-iotdb-0.12.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.4 2023-09-27T15:27:54,383 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/cb/34f5d9137086d912e4518d751eca1ac9a8b908706c4b3176ca32911fabd2/apache_iotdb-0.12.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,384 Found link https://files.pythonhosted.org/packages/8a/52/93503eac47c1561edc21431f7154b694afad9d461e2af0fea36966953c24/apache-iotdb-0.12.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.5 2023-09-27T15:27:54,384 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7a/30/1cd9bca76c1f4f9b4cd48d11f23103ade9c5a35410bbf0a8f5997bab51b0/apache_iotdb-0.12.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,385 Found link https://files.pythonhosted.org/packages/00/d9/19746ff8906cc2ac3c9326fbcbd244d2424f4aad5d7201843956d27dcb0b/apache-iotdb-0.12.6.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.6 2023-09-27T15:27:54,386 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/cf/7b/ab3acb96fd057e900f9aca1b030f4fb42caf4104000ab742ce19a1029b6f/apache_iotdb-0.12.6-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,387 Found link https://files.pythonhosted.org/packages/a6/cd/33de301e51132f8d0d79adc346d38685a6b871251846bad95b35ebf74ac9/apache-iotdb-0.13.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0 2023-09-27T15:27:54,387 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/71/c1/3684d3b6e6eddda5fbe994e123c6bc6569409994a44b5d3e4b130554802a/apache_iotdb-0.13.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,388 Found link https://files.pythonhosted.org/packages/7e/3e/40f0d900e04598036cc65ae437a2ee9f4aa149860d434a6f4b291460582c/apache-iotdb-0.13.0.post1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0.post1 2023-09-27T15:27:54,389 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7c/f2/ef6f589910f1b850ad665d4958e2a26b5249bddc81d5f29a711e21a79dc1/apache_iotdb-0.13.0.post1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,389 Found link https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.1 2023-09-27T15:27:54,390 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/b7/1d/3074d8ab58366c99783fe0ed853472a21d69dfd2b80ca001281d170833e2/apache_iotdb-0.13.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,391 Found link https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.2 2023-09-27T15:27:54,392 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/94/0c/3a7d8a238d7c8771453889f8f03f9ebcd418839306e64f4ddea8c0baee81/apache_iotdb-0.13.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,393 Found link https://files.pythonhosted.org/packages/30/a0/0153c56e1af8653bfdcf47423949dd6b23e53882c9009acc25e661a44dbe/apache-iotdb-0.13.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.3 2023-09-27T15:27:54,393 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/a0/51/7e8405405f7f0ef8eabab31b4860cb747a8acfa53e30f56939c115b53db9/apache_iotdb-0.13.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,394 Found link https://files.pythonhosted.org/packages/42/eb/3d7ac8d794238b75997ff3f55db6e02436bfa558a8df4ea21e58bf8db6fd/apache-iotdb-0.13.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5 2023-09-27T15:27:54,394 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/51/a3/9117edfd3d72a1d338b7cff8060e672dd7b39dfeb2ca0d6c22db51bf9b90/apache_iotdb-0.13.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,395 Found link https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5.1 2023-09-27T15:27:54,396 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/89/0a/816b8a85f6be9f8fe3534f79ea12341dad900b59ba0ac126835640a09db0/apache_iotdb-0.13.5.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,396 Found link https://files.pythonhosted.org/packages/bb/7d/24cefdcd57e96d496fd3492fc28b3d53da6ba0fc6ee69f99dddec1cf500c/apache-iotdb-0.14.0rc1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.14.0rc1 2023-09-27T15:27:54,397 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/6d/37/0e5a292ed1a695927cefec20d4ad01d3c7af78e691d5250f1646f318d4ef/apache_iotdb-0.14.0rc1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,398 Found link https://files.pythonhosted.org/packages/49/91/11702001bdc0af0266d5f4dd222b5f937684e8c08e5044735ade6748cd58/apache-iotdb-1.0.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.0 2023-09-27T15:27:54,398 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3d/57/3019d5cf51e6198d5b7ee9e3c07a15efa7487e8b280b4b71cc521a6651e3/apache_iotdb-1.0.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,399 Found link https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.1 2023-09-27T15:27:54,400 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/06/82/b658ff03f52072e1afde6bb9f1f1933427ef776a78e246965943fba552d8/apache_iotdb-1.0.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,401 Found link https://files.pythonhosted.org/packages/15/99/bf0d6eae0c005a4dcc88068be36ea3e5b4dcb26e50b6698b4bd814d052e9/apache-iotdb-1.1.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.0 2023-09-27T15:27:54,401 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3b/cd/72bfb3f3f3684bfe0c054dfd8c34fdb8a85f7572a6ec27b7a6ff99127516/apache_iotdb-1.1.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,402 Found link https://files.pythonhosted.org/packages/51/36/6e73e46e1d6b2d2272a5a1b369da16dd36a3120aa883ea86d2a9a85ce105/apache-iotdb-1.1.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.2 2023-09-27T15:27:54,403 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/74/d6/3ad8c98fc4321ba99120a231634801b6bf1eea9520e5aa5d153b6fab6f61/apache_iotdb-1.1.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,404 Found link https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.0 2023-09-27T15:27:54,405 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/b9/84d2d8e158ef2d5317f4f6ce0f14be616ec2b93c090fbf06a84e41d1cedd/apache_iotdb-1.2.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,405 Found link https://files.pythonhosted.org/packages/86/cd/f88e673287faf21660046a1ec14dc917a5e598f2145ea2f1da0767dae759/apache-iotdb-1.2.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.1 2023-09-27T15:27:54,406 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c6/a6/8f5f10ad95e5a2c2f54c78011ff2848a7b96860a439eeecdf136c3364795/apache_iotdb-1.2.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,406 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2023-09-27T15:27:54,407 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2023-09-27T15:27:54,408 Found index url https://www.piwheels.org/simple/ 2023-09-27T15:27:54,564 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2023-09-27T15:27:54,573 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.2-py3-none-any.whl#sha256=47e1ea2a866155bd45db05471a074cd1b4bede6e798d2b6a63e218767c92ae12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,574 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.0-py3-none-any.whl#sha256=17b0261e5e0602df730baf1bdd055750c850a2fd0163d2ce09d0083dfcf169f4 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,574 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.1-py3-none-any.whl#sha256=9fc3d243ca97c88bd3ca1f5092686e3ab5c99a6e5206fd6a6c6fdaab15c796b6 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,575 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.0-py3-none-any.whl#sha256=85d0bb3ddb1c79359fec18e85c6d515dc3639752d77dea32c09c8afe0fefc906 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,576 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.14.0rc1-py3-none-any.whl#sha256=2f71e6b3443c4748717889729380082daa7bd8f9950d4c17909134372367bccc (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,576 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5.1-py3-none-any.whl#sha256=43316f1302a0f1a08a1842964fb611e34f317e908b76d1872954c09f2c5f5919 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,577 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5-py3-none-any.whl#sha256=e25dac25664b9ff8313cbb697f634269ef857ec9217d3256b893c43c8b0c151f (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,577 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.3-py3-none-any.whl#sha256=c3be87cabc4d19ad9fd999f524ac8547b971adb4a304bf8874fdb56a6ecca371 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,578 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.2-py3-none-any.whl#sha256=136811be5cdfe045bc349a8f6c0b07117600185c0c7ada8353610179adde27ae (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,578 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.1-py3-none-any.whl#sha256=22668867268f1ea89b8205cbda30d0578aaa5ccfff0b552396e7059a95d3781a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,579 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0.post1-py3-none-any.whl#sha256=d53cf02df2cc507d9caf48167c52d69e24abab9800430de3ff8abf8159bff63b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,579 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0-py3-none-any.whl#sha256=67b7429e60cdd5e1e3a808592a87a591c028af62de8e2fec2535b4a3105f21b7 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,579 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.6-py3-none-any.whl#sha256=a4f679df0053b74f83de861277de12e030eb8601063b172ec44789118ba11400 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,580 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.5-py3-none-any.whl#sha256=06bb080be5b0469037e68db56a7feb10da911a396a47d598598d8d8c50d07419 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,581 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.4-py3-none-any.whl#sha256=af5fa8000dd449fb6d98420287b2049b5e68d268fa1529fa96955b5fe7637c13 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,581 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.3-py3-none-any.whl#sha256=eb77b047b61a087b286e01afea6ee9761c9e687479a4e551be085d82612ed220 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,582 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.2-py3-none-any.whl#sha256=bb7605db211272947ba451cdad35a2b4f554167361f0c08acedbfb0723ac7ab8 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,582 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.1-py3-none-any.whl#sha256=bc5ddc6b683bf26a0b9a8c47ada13d29918503664e9e1c3fdefae73121f3a327 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,583 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.0-py3-none-any.whl#sha256=061d9407266b9d100113fa2d11890a8d5d56f8b496305c5864f08a9af35fcc12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,583 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.4-py3-none-any.whl#sha256=cf1ee85db62d31642b32742aba0a026a941b85cf4bb49ec48ef09b9e241f3bf5 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,584 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.3-py3-none-any.whl#sha256=55e9a0042694ba7fa482f733a1d548c0180bccf0e35e090b85d7b9050c95162b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,585 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.2-py3-none-any.whl#sha256=762d5b0c5f82869237d5375d2a8774f99654c3b693d6f77bf6e9decc78b7fd5d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,585 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.1-py3-none-any.whl#sha256=317a24e4870d587820f8d5be294e2e9a6ad09f70566ce4380506085c47b2fc0a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,586 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.0-py3-none-any.whl#sha256=4771e87dd8d933815206c063014beff8eff4c8025353723ac67603f49a119224 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,586 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.1-py3-none-any.whl#sha256=b4b13fa0d6ed86fbcc1231cad3d220ee81b38452e87fea655641720f803d4c1d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,586 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.0-py3-none-any.whl#sha256=388ade65f63cb37eef343e4f294cf3488b79894ff8061a7d9b2bf42277ded9de (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,587 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.3-py3-none-any.whl#sha256=b535b53a5182dc94116e67edb4a34c1efb007574273e2ff4ad72ebc3b4634326 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,587 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.2-py3-none-any.whl#sha256=b7fad95c7f041f18a621439aa3cd19fc79d76caa85a93967163566c10b7c6348 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,588 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.0-py3-none-any.whl#sha256=1feb6b731a9af26aac7a1e6fab74e85dd960562a1dca6e4c5c9d10234a570e82 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-09-27T15:27:54,589 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2023-09-27T15:27:54,589 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2023-09-27T15:27:54,611 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2023-09-27T15:27:54,629 Collecting apache-iotdb==1.2.0 2023-09-27T15:27:54,631 Created temporary directory: /tmp/pip-unpack-a2hn1qn_ 2023-09-27T15:27:54,845 Downloading apache-iotdb-1.2.0.tar.gz (85 kB) 2023-09-27T15:27:55,066 Added apache-iotdb==1.2.0 from https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz to build tracker '/tmp/pip-build-tracker-0nywb_ay' 2023-09-27T15:27:55,070 Created temporary directory: /tmp/pip-build-env-4do20bsk 2023-09-27T15:27:55,078 Installing build dependencies: started 2023-09-27T15:27:55,079 Running command pip subprocess to install build dependencies 2023-09-27T15:27:56,222 Using pip 23.2.1 from /usr/local/lib/python3.11/dist-packages/pip (python 3.11) 2023-09-27T15:27:56,738 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-09-27T15:27:58,322 Collecting setuptools>=40.8.0 2023-09-27T15:27:58,323 Obtaining dependency information for setuptools>=40.8.0 from https://files.pythonhosted.org/packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl.metadata 2023-09-27T15:27:58,329 Using cached setuptools-68.2.2-py3-none-any.whl.metadata (6.3 kB) 2023-09-27T15:27:58,545 Collecting wheel 2023-09-27T15:27:58,560 Using cached https://www.piwheels.org/simple/wheel/wheel-0.41.2-py3-none-any.whl (64 kB) 2023-09-27T15:27:58,735 Using cached setuptools-68.2.2-py3-none-any.whl (807 kB) 2023-09-27T15:28:01,181 Installing collected packages: wheel, setuptools 2023-09-27T15:28:01,403 Creating /tmp/pip-build-env-4do20bsk/overlay/local/bin 2023-09-27T15:28:01,405 changing mode of /tmp/pip-build-env-4do20bsk/overlay/local/bin/wheel to 755 2023-09-27T15:28:03,590 Successfully installed setuptools-68.2.2 wheel-0.41.2 2023-09-27T15:28:04,170 Installing build dependencies: finished with status 'done' 2023-09-27T15:28:04,174 Getting requirements to build wheel: started 2023-09-27T15:28:04,175 Running command Getting requirements to build wheel 2023-09-27T15:28:04,615 2023-09-27T15:28:04,625 # Apache IoTDB 2023-09-27T15:28:04,626 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-09-27T15:28:04,626 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-09-27T15:28:04,627 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-09-27T15:28:04,627 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-09-27T15:28:04,628 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-09-27T15:28:04,628 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-09-27T15:28:04,629 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-09-27T15:28:04,630 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-09-27T15:28:04,631 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-09-27T15:28:04,631 architecture, high performance and rich feature set together with its deep integration with 2023-09-27T15:28:04,632 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-09-27T15:28:04,632 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-09-27T15:28:04,634 ## Python Native API 2023-09-27T15:28:04,634 ### Requirements 2023-09-27T15:28:04,635 You have to install thrift (>=0.13) before using the package. 2023-09-27T15:28:04,637 ### How to use (Example) 2023-09-27T15:28:04,638 First, download the latest package: `pip3 install apache-iotdb` 2023-09-27T15:28:04,638 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-09-27T15:28:04,639 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-09-27T15:28:04,640 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-09-27T15:28:04,641 (you need to add `import iotdb` in the head of the file) 2023-09-27T15:28:04,642 Or: 2023-09-27T15:28:04,643 ```python 2023-09-27T15:28:04,643 from iotdb.Session import Session 2023-09-27T15:28:04,644 ip = "127.0.0.1" 2023-09-27T15:28:04,644 port_ = "6667" 2023-09-27T15:28:04,645 username_ = "root" 2023-09-27T15:28:04,645 password_ = "root" 2023-09-27T15:28:04,646 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:04,646 session.open(False) 2023-09-27T15:28:04,647 zone = session.get_time_zone() 2023-09-27T15:28:04,647 session.close() 2023-09-27T15:28:04,648 ``` 2023-09-27T15:28:04,648 ### Initialization 2023-09-27T15:28:04,649 * Initialize a Session 2023-09-27T15:28:04,650 ```python 2023-09-27T15:28:04,651 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-09-27T15:28:04,652 ``` 2023-09-27T15:28:04,653 * Open a session, with a parameter to specify whether to enable RPC compression 2023-09-27T15:28:04,654 ```python 2023-09-27T15:28:04,655 session.open(enable_rpc_compression=False) 2023-09-27T15:28:04,655 ``` 2023-09-27T15:28:04,656 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-09-27T15:28:04,657 * Close a Session 2023-09-27T15:28:04,658 ```python 2023-09-27T15:28:04,659 session.close() 2023-09-27T15:28:04,660 ``` 2023-09-27T15:28:04,661 ### Data Definition Interface (DDL Interface) 2023-09-27T15:28:04,662 #### DATABASE Management 2023-09-27T15:28:04,663 * CREATE DATABASE 2023-09-27T15:28:04,664 ```python 2023-09-27T15:28:04,665 session.set_storage_group(group_name) 2023-09-27T15:28:04,665 ``` 2023-09-27T15:28:04,666 * Delete one or several databases 2023-09-27T15:28:04,667 ```python 2023-09-27T15:28:04,668 session.delete_storage_group(group_name) 2023-09-27T15:28:04,669 session.delete_storage_groups(group_name_lst) 2023-09-27T15:28:04,669 ``` 2023-09-27T15:28:04,670 #### Timeseries Management 2023-09-27T15:28:04,671 * Create one or multiple timeseries 2023-09-27T15:28:04,672 ```python 2023-09-27T15:28:04,672 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-09-27T15:28:04,673 props=None, tags=None, attributes=None, alias=None) 2023-09-27T15:28:04,674 session.create_multi_time_series( 2023-09-27T15:28:04,675 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-09-27T15:28:04,675 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-09-27T15:28:04,676 ) 2023-09-27T15:28:04,676 ``` 2023-09-27T15:28:04,678 * Create aligned timeseries 2023-09-27T15:28:04,679 ```python 2023-09-27T15:28:04,679 session.create_aligned_time_series( 2023-09-27T15:28:04,680 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-09-27T15:28:04,681 ) 2023-09-27T15:28:04,681 ``` 2023-09-27T15:28:04,683 Attention: Alias of measurements are **not supported** currently. 2023-09-27T15:28:04,684 * Delete one or several timeseries 2023-09-27T15:28:04,685 ```python 2023-09-27T15:28:04,686 session.delete_time_series(paths_list) 2023-09-27T15:28:04,686 ``` 2023-09-27T15:28:04,687 * Check whether the specific timeseries exists 2023-09-27T15:28:04,688 ```python 2023-09-27T15:28:04,688 session.check_time_series_exists(path) 2023-09-27T15:28:04,689 ``` 2023-09-27T15:28:04,689 ### Data Manipulation Interface (DML Interface) 2023-09-27T15:28:04,690 #### Insert 2023-09-27T15:28:04,691 It is recommended to use insertTablet to help improve write efficiency. 2023-09-27T15:28:04,692 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-09-27T15:28:04,692 * **Better Write Performance** 2023-09-27T15:28:04,693 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-09-27T15:28:04,694 We have two implementations of Tablet in Python API. 2023-09-27T15:28:04,695 * Normal Tablet 2023-09-27T15:28:04,696 ```python 2023-09-27T15:28:04,696 values_ = [ 2023-09-27T15:28:04,697 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:04,697 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:04,698 [False, 100, 1, 188.1, 688.25, "test03"], 2023-09-27T15:28:04,698 [True, 0, 0, 0, 6.25, "test04"], 2023-09-27T15:28:04,699 ] 2023-09-27T15:28:04,699 timestamps_ = [1, 2, 3, 4] 2023-09-27T15:28:04,700 tablet_ = Tablet( 2023-09-27T15:28:04,700 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:04,701 ) 2023-09-27T15:28:04,701 session.insert_tablet(tablet_) 2023-09-27T15:28:04,702 values_ = [ 2023-09-27T15:28:04,702 [None, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:04,703 [True, None, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:04,703 [False, 100, None, 188.1, 688.25, "test03"], 2023-09-27T15:28:04,704 [True, 0, 0, 0, None, None], 2023-09-27T15:28:04,704 ] 2023-09-27T15:28:04,705 timestamps_ = [16, 17, 18, 19] 2023-09-27T15:28:04,705 tablet_ = Tablet( 2023-09-27T15:28:04,706 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:04,707 ) 2023-09-27T15:28:04,707 session.insert_tablet(tablet_) 2023-09-27T15:28:04,708 ``` 2023-09-27T15:28:04,708 * Numpy Tablet 2023-09-27T15:28:04,709 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-09-27T15:28:04,709 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-09-27T15:28:04,711 **Notice** 2023-09-27T15:28:04,711 1. time and value columns in Tablet are ndarray. 2023-09-27T15:28:04,712 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-09-27T15:28:04,712 (if not, the default dtypes are also ok). 2023-09-27T15:28:04,713 ```python 2023-09-27T15:28:04,714 import numpy as np 2023-09-27T15:28:04,715 data_types_ = [ 2023-09-27T15:28:04,715 TSDataType.BOOLEAN, 2023-09-27T15:28:04,716 TSDataType.INT32, 2023-09-27T15:28:04,716 TSDataType.INT64, 2023-09-27T15:28:04,717 TSDataType.FLOAT, 2023-09-27T15:28:04,717 TSDataType.DOUBLE, 2023-09-27T15:28:04,718 TSDataType.TEXT, 2023-09-27T15:28:04,718 ] 2023-09-27T15:28:04,719 np_values_ = [ 2023-09-27T15:28:04,719 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:04,720 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:04,720 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:04,721 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:04,721 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:04,722 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:04,723 ] 2023-09-27T15:28:04,723 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:04,724 np_tablet_ = NumpyTablet( 2023-09-27T15:28:04,725 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2023-09-27T15:28:04,725 ) 2023-09-27T15:28:04,726 session.insert_tablet(np_tablet_) 2023-09-27T15:28:04,727 # insert one numpy tablet with none into the database. 2023-09-27T15:28:04,727 np_values_ = [ 2023-09-27T15:28:04,728 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:04,728 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:04,729 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:04,729 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:04,730 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:04,730 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:04,731 ] 2023-09-27T15:28:04,731 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:04,732 np_bitmaps_ = [] 2023-09-27T15:28:04,732 for i in range(len(measurements_)): 2023-09-27T15:28:04,733 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2023-09-27T15:28:04,733 np_bitmaps_[0].mark(0) 2023-09-27T15:28:04,734 np_bitmaps_[1].mark(1) 2023-09-27T15:28:04,734 np_bitmaps_[2].mark(2) 2023-09-27T15:28:04,735 np_bitmaps_[4].mark(3) 2023-09-27T15:28:04,735 np_bitmaps_[5].mark(3) 2023-09-27T15:28:04,736 np_tablet_with_none = NumpyTablet( 2023-09-27T15:28:04,736 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2023-09-27T15:28:04,737 ) 2023-09-27T15:28:04,737 session.insert_tablet(np_tablet_with_none) 2023-09-27T15:28:04,738 ``` 2023-09-27T15:28:04,739 * Insert multiple Tablets 2023-09-27T15:28:04,740 ```python 2023-09-27T15:28:04,740 session.insert_tablets(tablet_lst) 2023-09-27T15:28:04,740 ``` 2023-09-27T15:28:04,741 * Insert a Record 2023-09-27T15:28:04,742 ```python 2023-09-27T15:28:04,743 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-09-27T15:28:04,743 ``` 2023-09-27T15:28:04,744 * Insert multiple Records 2023-09-27T15:28:04,745 ```python 2023-09-27T15:28:04,746 session.insert_records( 2023-09-27T15:28:04,746 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-09-27T15:28:04,747 ) 2023-09-27T15:28:04,747 ``` 2023-09-27T15:28:04,748 * Insert multiple Records that belong to the same device. 2023-09-27T15:28:04,749 With type info the server has no need to do type inference, which leads a better performance 2023-09-27T15:28:04,751 ```python 2023-09-27T15:28:04,751 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-09-27T15:28:04,752 ``` 2023-09-27T15:28:04,753 #### Insert with type inference 2023-09-27T15:28:04,754 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-09-27T15:28:04,755 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-09-27T15:28:04,756 ```python 2023-09-27T15:28:04,757 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-09-27T15:28:04,758 ``` 2023-09-27T15:28:04,759 #### Insert of Aligned Timeseries 2023-09-27T15:28:04,760 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-09-27T15:28:04,761 * insert_aligned_record 2023-09-27T15:28:04,761 * insert_aligned_records 2023-09-27T15:28:04,762 * insert_aligned_records_of_one_device 2023-09-27T15:28:04,762 * insert_aligned_tablet 2023-09-27T15:28:04,763 * insert_aligned_tablets 2023-09-27T15:28:04,764 ### IoTDB-SQL Interface 2023-09-27T15:28:04,765 * Execute query statement 2023-09-27T15:28:04,766 ```python 2023-09-27T15:28:04,767 session.execute_query_statement(sql) 2023-09-27T15:28:04,767 ``` 2023-09-27T15:28:04,768 * Execute non query statement 2023-09-27T15:28:04,769 ```python 2023-09-27T15:28:04,769 session.execute_non_query_statement(sql) 2023-09-27T15:28:04,770 ``` 2023-09-27T15:28:04,770 * Execute statement 2023-09-27T15:28:04,771 ```python 2023-09-27T15:28:04,771 session.execute_statement(sql) 2023-09-27T15:28:04,772 ``` 2023-09-27T15:28:04,773 ### Schema Template 2023-09-27T15:28:04,773 #### Create Schema Template 2023-09-27T15:28:04,774 The step for creating a metadata template is as follows 2023-09-27T15:28:04,774 1. Create the template class 2023-09-27T15:28:04,775 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-09-27T15:28:04,775 3. Execute create schema template function 2023-09-27T15:28:04,776 ```python 2023-09-27T15:28:04,776 template = Template(name=template_name, share_time=True) 2023-09-27T15:28:04,777 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-09-27T15:28:04,777 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-09-27T15:28:04,778 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-09-27T15:28:04,779 i_node_gps.add_child(m_node_x) 2023-09-27T15:28:04,779 i_node_v.add_child(m_node_x) 2023-09-27T15:28:04,780 template.add_template(i_node_gps) 2023-09-27T15:28:04,780 template.add_template(i_node_v) 2023-09-27T15:28:04,781 template.add_template(m_node_x) 2023-09-27T15:28:04,782 session.create_schema_template(template) 2023-09-27T15:28:04,782 ``` 2023-09-27T15:28:04,783 #### Modify Schema Template nodes 2023-09-27T15:28:04,783 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-09-27T15:28:04,783 * add node in template 2023-09-27T15:28:04,784 ```python 2023-09-27T15:28:04,784 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-09-27T15:28:04,785 ``` 2023-09-27T15:28:04,786 * delete node in template 2023-09-27T15:28:04,787 ```python 2023-09-27T15:28:04,788 session.delete_node_in_template(template_name, path) 2023-09-27T15:28:04,789 ``` 2023-09-27T15:28:04,790 #### Set Schema Template 2023-09-27T15:28:04,791 ```python 2023-09-27T15:28:04,792 session.set_schema_template(template_name, prefix_path) 2023-09-27T15:28:04,793 ``` 2023-09-27T15:28:04,795 #### Uset Schema Template 2023-09-27T15:28:04,795 ```python 2023-09-27T15:28:04,796 session.unset_schema_template(template_name, prefix_path) 2023-09-27T15:28:04,797 ``` 2023-09-27T15:28:04,798 #### Show Schema Template 2023-09-27T15:28:04,799 * Show all schema templates 2023-09-27T15:28:04,800 ```python 2023-09-27T15:28:04,800 session.show_all_templates() 2023-09-27T15:28:04,801 ``` 2023-09-27T15:28:04,802 * Count all nodes in templates 2023-09-27T15:28:04,803 ```python 2023-09-27T15:28:04,803 session.count_measurements_in_template(template_name) 2023-09-27T15:28:04,804 ``` 2023-09-27T15:28:04,806 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-09-27T15:28:04,806 ```python 2023-09-27T15:28:04,807 session.count_measurements_in_template(template_name, path) 2023-09-27T15:28:04,808 ``` 2023-09-27T15:28:04,809 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-09-27T15:28:04,810 ```python 2023-09-27T15:28:04,811 session.is_path_exist_in_template(template_name, path) 2023-09-27T15:28:04,811 ``` 2023-09-27T15:28:04,813 * Show nodes under in schema template 2023-09-27T15:28:04,814 ```python 2023-09-27T15:28:04,815 session.show_measurements_in_template(template_name) 2023-09-27T15:28:04,816 ``` 2023-09-27T15:28:04,817 * Show the path prefix where a schema template is set 2023-09-27T15:28:04,818 ```python 2023-09-27T15:28:04,819 session.show_paths_template_set_on(template_name) 2023-09-27T15:28:04,819 ``` 2023-09-27T15:28:04,821 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-09-27T15:28:04,821 ```python 2023-09-27T15:28:04,822 session.show_paths_template_using_on(template_name) 2023-09-27T15:28:04,823 ``` 2023-09-27T15:28:04,824 #### Drop Schema Template 2023-09-27T15:28:04,825 Delete an existing metadata template,dropping an already set template is not supported 2023-09-27T15:28:04,825 ```python 2023-09-27T15:28:04,826 session.drop_schema_template("template_python") 2023-09-27T15:28:04,826 ``` 2023-09-27T15:28:04,828 ### Pandas Support 2023-09-27T15:28:04,829 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-09-27T15:28:04,830 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-09-27T15:28:04,831 Example: 2023-09-27T15:28:04,832 ```python 2023-09-27T15:28:04,832 from iotdb.Session import Session 2023-09-27T15:28:04,833 ip = "127.0.0.1" 2023-09-27T15:28:04,834 port_ = "6667" 2023-09-27T15:28:04,835 username_ = "root" 2023-09-27T15:28:04,835 password_ = "root" 2023-09-27T15:28:04,836 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:04,837 session.open(False) 2023-09-27T15:28:04,837 result = session.execute_query_statement("SELECT * FROM root.*") 2023-09-27T15:28:04,839 # Transform to Pandas Dataset 2023-09-27T15:28:04,839 df = result.todf() 2023-09-27T15:28:04,841 session.close() 2023-09-27T15:28:04,842 # Now you can work with the dataframe 2023-09-27T15:28:04,843 df = ... 2023-09-27T15:28:04,844 ``` 2023-09-27T15:28:04,846 ### IoTDB Testcontainer 2023-09-27T15:28:04,847 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-09-27T15:28:04,849 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-09-27T15:28:04,849 ```python 2023-09-27T15:28:04,850 class MyTestCase(unittest.TestCase): 2023-09-27T15:28:04,851 def test_something(self): 2023-09-27T15:28:04,852 with IoTDBContainer() as c: 2023-09-27T15:28:04,853 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-09-27T15:28:04,854 session.open(False) 2023-09-27T15:28:04,854 result = session.execute_query_statement("SHOW TIMESERIES") 2023-09-27T15:28:04,855 print(result) 2023-09-27T15:28:04,856 session.close() 2023-09-27T15:28:04,857 ``` 2023-09-27T15:28:04,858 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-09-27T15:28:04,860 ### IoTDB DBAPI 2023-09-27T15:28:04,862 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-09-27T15:28:04,862 interface for accessing databases in Python. 2023-09-27T15:28:04,864 #### Examples 2023-09-27T15:28:04,864 + Initialization 2023-09-27T15:28:04,865 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-09-27T15:28:04,866 ```python 2023-09-27T15:28:04,867 from iotdb.dbapi import connect 2023-09-27T15:28:04,868 ip = "127.0.0.1" 2023-09-27T15:28:04,869 port_ = "6667" 2023-09-27T15:28:04,869 username_ = "root" 2023-09-27T15:28:04,870 password_ = "root" 2023-09-27T15:28:04,870 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-09-27T15:28:04,871 cursor = conn.cursor() 2023-09-27T15:28:04,872 ``` 2023-09-27T15:28:04,872 + simple SQL statement execution 2023-09-27T15:28:04,873 ```python 2023-09-27T15:28:04,874 cursor.execute("SELECT * FROM root.*") 2023-09-27T15:28:04,874 for row in cursor.fetchall(): 2023-09-27T15:28:04,875 print(row) 2023-09-27T15:28:04,875 ``` 2023-09-27T15:28:04,876 + execute SQL with parameter 2023-09-27T15:28:04,877 IoTDB DBAPI supports pyformat style parameters 2023-09-27T15:28:04,878 ```python 2023-09-27T15:28:04,879 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-09-27T15:28:04,880 for row in cursor.fetchall(): 2023-09-27T15:28:04,880 print(row) 2023-09-27T15:28:04,881 ``` 2023-09-27T15:28:04,882 + execute SQL with parameter sequences 2023-09-27T15:28:04,883 ```python 2023-09-27T15:28:04,883 seq_of_parameters = [ 2023-09-27T15:28:04,884 {"timestamp": 1, "temperature": 1}, 2023-09-27T15:28:04,884 {"timestamp": 2, "temperature": 2}, 2023-09-27T15:28:04,885 {"timestamp": 3, "temperature": 3}, 2023-09-27T15:28:04,886 {"timestamp": 4, "temperature": 4}, 2023-09-27T15:28:04,886 {"timestamp": 5, "temperature": 5}, 2023-09-27T15:28:04,887 ] 2023-09-27T15:28:04,887 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-09-27T15:28:04,888 cursor.executemany(sql,seq_of_parameters) 2023-09-27T15:28:04,889 ``` 2023-09-27T15:28:04,889 + close the connection and cursor 2023-09-27T15:28:04,890 ```python 2023-09-27T15:28:04,890 cursor.close() 2023-09-27T15:28:04,890 conn.close() 2023-09-27T15:28:04,891 ``` 2023-09-27T15:28:04,891 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-09-27T15:28:04,892 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-09-27T15:28:04,892 This part is still being improved. 2023-09-27T15:28:04,893 Please do not use it in the production environment! 2023-09-27T15:28:04,893 #### Mapping of the metadata 2023-09-27T15:28:04,893 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-09-27T15:28:04,894 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-09-27T15:28:04,894 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-09-27T15:28:04,895 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-09-27T15:28:04,896 The metadata in the IoTDB are: 2023-09-27T15:28:04,896 1. Database 2023-09-27T15:28:04,897 2. Path 2023-09-27T15:28:04,897 3. Entity 2023-09-27T15:28:04,898 4. Measurement 2023-09-27T15:28:04,899 The metadata in the SQLAlchemy are: 2023-09-27T15:28:04,899 1. Schema 2023-09-27T15:28:04,900 2. Table 2023-09-27T15:28:04,900 3. Column 2023-09-27T15:28:04,901 The mapping relationship between them is: 2023-09-27T15:28:04,902 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-09-27T15:28:04,902 | -------------------- | ---------------------------------------------- | 2023-09-27T15:28:04,903 | Schema | Database | 2023-09-27T15:28:04,903 | Table | Path ( from database to entity ) + Entity | 2023-09-27T15:28:04,904 | Column | Measurement | 2023-09-27T15:28:04,904 The following figure shows the relationship between the two more intuitively: 2023-09-27T15:28:04,905 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-09-27T15:28:04,906 #### Data type mapping 2023-09-27T15:28:04,907 | data type in IoTDB | data type in SQLAlchemy | 2023-09-27T15:28:04,907 |--------------------|-------------------------| 2023-09-27T15:28:04,908 | BOOLEAN | Boolean | 2023-09-27T15:28:04,908 | INT32 | Integer | 2023-09-27T15:28:04,909 | INT64 | BigInteger | 2023-09-27T15:28:04,910 | FLOAT | Float | 2023-09-27T15:28:04,910 | DOUBLE | Float | 2023-09-27T15:28:04,910 | TEXT | Text | 2023-09-27T15:28:04,911 | LONG | BigInteger | 2023-09-27T15:28:04,911 #### Example 2023-09-27T15:28:04,912 + execute statement 2023-09-27T15:28:04,912 ```python 2023-09-27T15:28:04,913 from sqlalchemy import create_engine 2023-09-27T15:28:04,913 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:04,914 connect = engine.connect() 2023-09-27T15:28:04,914 result = connect.execute("SELECT ** FROM root") 2023-09-27T15:28:04,915 for row in result.fetchall(): 2023-09-27T15:28:04,915 print(row) 2023-09-27T15:28:04,915 ``` 2023-09-27T15:28:04,916 + ORM (now only simple queries are supported) 2023-09-27T15:28:04,917 ```python 2023-09-27T15:28:04,917 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-09-27T15:28:04,917 from sqlalchemy.ext.declarative import declarative_base 2023-09-27T15:28:04,918 from sqlalchemy.orm import sessionmaker 2023-09-27T15:28:04,919 metadata = MetaData( 2023-09-27T15:28:04,919 schema='root.factory' 2023-09-27T15:28:04,920 ) 2023-09-27T15:28:04,920 Base = declarative_base(metadata=metadata) 2023-09-27T15:28:04,921 class Device(Base): 2023-09-27T15:28:04,922 __tablename__ = "room2.device1" 2023-09-27T15:28:04,922 Time = Column(BigInteger, primary_key=True) 2023-09-27T15:28:04,922 temperature = Column(Float) 2023-09-27T15:28:04,923 status = Column(Float) 2023-09-27T15:28:04,924 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:04,925 DbSession = sessionmaker(bind=engine) 2023-09-27T15:28:04,925 session = DbSession() 2023-09-27T15:28:04,926 res = session.query(Device.status).filter(Device.temperature > 1) 2023-09-27T15:28:04,927 for row in res: 2023-09-27T15:28:04,928 print(row) 2023-09-27T15:28:04,928 ``` 2023-09-27T15:28:04,930 ## Developers 2023-09-27T15:28:04,930 ### Introduction 2023-09-27T15:28:04,931 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-09-27T15:28:04,933 ### Prerequisites 2023-09-27T15:28:04,934 Python3.7 or later is preferred. 2023-09-27T15:28:04,935 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-09-27T15:28:04,936 ``` 2023-09-27T15:28:04,937 http://thrift.apache.org/docs/install/ 2023-09-27T15:28:04,937 ``` 2023-09-27T15:28:04,938 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-09-27T15:28:04,938 ```shell 2023-09-27T15:28:04,939 pip install -r requirements_dev.txt 2023-09-27T15:28:04,939 ``` 2023-09-27T15:28:04,941 ### Compile the thrift library and Debug 2023-09-27T15:28:04,942 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-09-27T15:28:04,943 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-09-27T15:28:04,943 This folder is ignored from git and should **never be pushed to git!** 2023-09-27T15:28:04,944 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-09-27T15:28:04,947 ### Session Client & Example 2023-09-27T15:28:04,948 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-09-27T15:28:04,949 Or, another simple example: 2023-09-27T15:28:04,950 ```python 2023-09-27T15:28:04,950 from iotdb.Session import Session 2023-09-27T15:28:04,951 ip = "127.0.0.1" 2023-09-27T15:28:04,951 port_ = "6667" 2023-09-27T15:28:04,952 username_ = "root" 2023-09-27T15:28:04,952 password_ = "root" 2023-09-27T15:28:04,952 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:04,953 session.open(False) 2023-09-27T15:28:04,953 zone = session.get_time_zone() 2023-09-27T15:28:04,953 session.close() 2023-09-27T15:28:04,954 ``` 2023-09-27T15:28:04,955 ### Tests 2023-09-27T15:28:04,956 Please add your custom tests in `tests` folder. 2023-09-27T15:28:04,956 To run all defined tests just type `pytest .` in the root folder. 2023-09-27T15:28:04,957 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-09-27T15:28:04,958 ### Futher Tools 2023-09-27T15:28:04,959 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-09-27T15:28:04,959 Both can be run by `black .` or `flake8 .` respectively. 2023-09-27T15:28:04,961 ## Releasing 2023-09-27T15:28:04,961 To do a release just ensure that you have the right set of generated thrift files. 2023-09-27T15:28:04,962 Then run linting and auto-formatting. 2023-09-27T15:28:04,962 Then, ensure that all tests work (via `pytest .`). 2023-09-27T15:28:04,963 Then you are good to go to do a release! 2023-09-27T15:28:04,964 ### Preparing your environment 2023-09-27T15:28:04,965 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-09-27T15:28:04,966 ### Doing the Release 2023-09-27T15:28:04,967 There is a convenient script `release.sh` to do all steps for a release. 2023-09-27T15:28:04,968 Namely, these are 2023-09-27T15:28:04,969 * Remove all transient directories from last release (if exists) 2023-09-27T15:28:04,969 * (Re-)generate all generated sources via mvn 2023-09-27T15:28:04,969 * Run Linting (flake8) 2023-09-27T15:28:04,970 * Run Tests via pytest 2023-09-27T15:28:04,970 * Build 2023-09-27T15:28:04,971 * Release to pypi 2023-09-27T15:28:04,972 /tmp/pip-build-env-4do20bsk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-09-27T15:28:04,973 warnings.warn(msg) 2023-09-27T15:28:04,974 running egg_info 2023-09-27T15:28:04,974 writing apache_iotdb.egg-info/PKG-INFO 2023-09-27T15:28:04,975 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-09-27T15:28:04,975 writing entry points to apache_iotdb.egg-info/entry_points.txt 2023-09-27T15:28:04,976 writing requirements to apache_iotdb.egg-info/requires.txt 2023-09-27T15:28:04,976 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-09-27T15:28:04,977 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:04,977 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:04,978 Getting requirements to build wheel: finished with status 'done' 2023-09-27T15:28:04,986 Created temporary directory: /tmp/pip-modern-metadata-nq021w6j 2023-09-27T15:28:04,988 Preparing metadata (pyproject.toml): started 2023-09-27T15:28:04,990 Running command Preparing metadata (pyproject.toml) 2023-09-27T15:28:05,415 2023-09-27T15:28:05,426 # Apache IoTDB 2023-09-27T15:28:05,427 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-09-27T15:28:05,428 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-09-27T15:28:05,428 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-09-27T15:28:05,429 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-09-27T15:28:05,429 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-09-27T15:28:05,429 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-09-27T15:28:05,430 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-09-27T15:28:05,431 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-09-27T15:28:05,432 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-09-27T15:28:05,432 architecture, high performance and rich feature set together with its deep integration with 2023-09-27T15:28:05,433 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-09-27T15:28:05,433 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-09-27T15:28:05,434 ## Python Native API 2023-09-27T15:28:05,435 ### Requirements 2023-09-27T15:28:05,436 You have to install thrift (>=0.13) before using the package. 2023-09-27T15:28:05,439 ### How to use (Example) 2023-09-27T15:28:05,440 First, download the latest package: `pip3 install apache-iotdb` 2023-09-27T15:28:05,442 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-09-27T15:28:05,443 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-09-27T15:28:05,444 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-09-27T15:28:05,445 (you need to add `import iotdb` in the head of the file) 2023-09-27T15:28:05,446 Or: 2023-09-27T15:28:05,448 ```python 2023-09-27T15:28:05,448 from iotdb.Session import Session 2023-09-27T15:28:05,449 ip = "127.0.0.1" 2023-09-27T15:28:05,450 port_ = "6667" 2023-09-27T15:28:05,450 username_ = "root" 2023-09-27T15:28:05,451 password_ = "root" 2023-09-27T15:28:05,451 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:05,452 session.open(False) 2023-09-27T15:28:05,452 zone = session.get_time_zone() 2023-09-27T15:28:05,453 session.close() 2023-09-27T15:28:05,454 ``` 2023-09-27T15:28:05,455 ### Initialization 2023-09-27T15:28:05,456 * Initialize a Session 2023-09-27T15:28:05,457 ```python 2023-09-27T15:28:05,458 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-09-27T15:28:05,458 ``` 2023-09-27T15:28:05,459 * Open a session, with a parameter to specify whether to enable RPC compression 2023-09-27T15:28:05,461 ```python 2023-09-27T15:28:05,461 session.open(enable_rpc_compression=False) 2023-09-27T15:28:05,462 ``` 2023-09-27T15:28:05,463 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-09-27T15:28:05,464 * Close a Session 2023-09-27T15:28:05,465 ```python 2023-09-27T15:28:05,465 session.close() 2023-09-27T15:28:05,465 ``` 2023-09-27T15:28:05,466 ### Data Definition Interface (DDL Interface) 2023-09-27T15:28:05,467 #### DATABASE Management 2023-09-27T15:28:05,468 * CREATE DATABASE 2023-09-27T15:28:05,469 ```python 2023-09-27T15:28:05,469 session.set_storage_group(group_name) 2023-09-27T15:28:05,470 ``` 2023-09-27T15:28:05,471 * Delete one or several databases 2023-09-27T15:28:05,471 ```python 2023-09-27T15:28:05,472 session.delete_storage_group(group_name) 2023-09-27T15:28:05,472 session.delete_storage_groups(group_name_lst) 2023-09-27T15:28:05,473 ``` 2023-09-27T15:28:05,473 #### Timeseries Management 2023-09-27T15:28:05,474 * Create one or multiple timeseries 2023-09-27T15:28:05,475 ```python 2023-09-27T15:28:05,476 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-09-27T15:28:05,476 props=None, tags=None, attributes=None, alias=None) 2023-09-27T15:28:05,477 session.create_multi_time_series( 2023-09-27T15:28:05,477 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-09-27T15:28:05,478 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-09-27T15:28:05,478 ) 2023-09-27T15:28:05,479 ``` 2023-09-27T15:28:05,480 * Create aligned timeseries 2023-09-27T15:28:05,480 ```python 2023-09-27T15:28:05,481 session.create_aligned_time_series( 2023-09-27T15:28:05,481 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-09-27T15:28:05,482 ) 2023-09-27T15:28:05,483 ``` 2023-09-27T15:28:05,484 Attention: Alias of measurements are **not supported** currently. 2023-09-27T15:28:05,485 * Delete one or several timeseries 2023-09-27T15:28:05,486 ```python 2023-09-27T15:28:05,486 session.delete_time_series(paths_list) 2023-09-27T15:28:05,487 ``` 2023-09-27T15:28:05,488 * Check whether the specific timeseries exists 2023-09-27T15:28:05,489 ```python 2023-09-27T15:28:05,490 session.check_time_series_exists(path) 2023-09-27T15:28:05,490 ``` 2023-09-27T15:28:05,491 ### Data Manipulation Interface (DML Interface) 2023-09-27T15:28:05,492 #### Insert 2023-09-27T15:28:05,493 It is recommended to use insertTablet to help improve write efficiency. 2023-09-27T15:28:05,495 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-09-27T15:28:05,495 * **Better Write Performance** 2023-09-27T15:28:05,496 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-09-27T15:28:05,497 We have two implementations of Tablet in Python API. 2023-09-27T15:28:05,498 * Normal Tablet 2023-09-27T15:28:05,499 ```python 2023-09-27T15:28:05,500 values_ = [ 2023-09-27T15:28:05,500 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:05,501 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:05,502 [False, 100, 1, 188.1, 688.25, "test03"], 2023-09-27T15:28:05,502 [True, 0, 0, 0, 6.25, "test04"], 2023-09-27T15:28:05,503 ] 2023-09-27T15:28:05,504 timestamps_ = [1, 2, 3, 4] 2023-09-27T15:28:05,504 tablet_ = Tablet( 2023-09-27T15:28:05,505 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:05,505 ) 2023-09-27T15:28:05,506 session.insert_tablet(tablet_) 2023-09-27T15:28:05,507 values_ = [ 2023-09-27T15:28:05,508 [None, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:05,508 [True, None, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:05,509 [False, 100, None, 188.1, 688.25, "test03"], 2023-09-27T15:28:05,510 [True, 0, 0, 0, None, None], 2023-09-27T15:28:05,510 ] 2023-09-27T15:28:05,511 timestamps_ = [16, 17, 18, 19] 2023-09-27T15:28:05,511 tablet_ = Tablet( 2023-09-27T15:28:05,512 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:05,512 ) 2023-09-27T15:28:05,513 session.insert_tablet(tablet_) 2023-09-27T15:28:05,513 ``` 2023-09-27T15:28:05,513 * Numpy Tablet 2023-09-27T15:28:05,514 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-09-27T15:28:05,515 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-09-27T15:28:05,516 **Notice** 2023-09-27T15:28:05,516 1. time and value columns in Tablet are ndarray. 2023-09-27T15:28:05,517 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-09-27T15:28:05,517 (if not, the default dtypes are also ok). 2023-09-27T15:28:05,518 ```python 2023-09-27T15:28:05,519 import numpy as np 2023-09-27T15:28:05,519 data_types_ = [ 2023-09-27T15:28:05,520 TSDataType.BOOLEAN, 2023-09-27T15:28:05,520 TSDataType.INT32, 2023-09-27T15:28:05,521 TSDataType.INT64, 2023-09-27T15:28:05,521 TSDataType.FLOAT, 2023-09-27T15:28:05,522 TSDataType.DOUBLE, 2023-09-27T15:28:05,522 TSDataType.TEXT, 2023-09-27T15:28:05,523 ] 2023-09-27T15:28:05,523 np_values_ = [ 2023-09-27T15:28:05,523 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:05,524 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:05,524 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:05,525 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:05,526 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:05,526 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:05,527 ] 2023-09-27T15:28:05,527 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:05,528 np_tablet_ = NumpyTablet( 2023-09-27T15:28:05,528 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2023-09-27T15:28:05,529 ) 2023-09-27T15:28:05,529 session.insert_tablet(np_tablet_) 2023-09-27T15:28:05,530 # insert one numpy tablet with none into the database. 2023-09-27T15:28:05,531 np_values_ = [ 2023-09-27T15:28:05,531 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:05,532 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:05,532 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:05,533 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:05,533 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:05,534 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:05,534 ] 2023-09-27T15:28:05,535 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:05,536 np_bitmaps_ = [] 2023-09-27T15:28:05,536 for i in range(len(measurements_)): 2023-09-27T15:28:05,537 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2023-09-27T15:28:05,537 np_bitmaps_[0].mark(0) 2023-09-27T15:28:05,538 np_bitmaps_[1].mark(1) 2023-09-27T15:28:05,538 np_bitmaps_[2].mark(2) 2023-09-27T15:28:05,539 np_bitmaps_[4].mark(3) 2023-09-27T15:28:05,540 np_bitmaps_[5].mark(3) 2023-09-27T15:28:05,540 np_tablet_with_none = NumpyTablet( 2023-09-27T15:28:05,541 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2023-09-27T15:28:05,541 ) 2023-09-27T15:28:05,542 session.insert_tablet(np_tablet_with_none) 2023-09-27T15:28:05,543 ``` 2023-09-27T15:28:05,544 * Insert multiple Tablets 2023-09-27T15:28:05,545 ```python 2023-09-27T15:28:05,546 session.insert_tablets(tablet_lst) 2023-09-27T15:28:05,546 ``` 2023-09-27T15:28:05,548 * Insert a Record 2023-09-27T15:28:05,548 ```python 2023-09-27T15:28:05,549 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-09-27T15:28:05,549 ``` 2023-09-27T15:28:05,550 * Insert multiple Records 2023-09-27T15:28:05,551 ```python 2023-09-27T15:28:05,551 session.insert_records( 2023-09-27T15:28:05,552 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-09-27T15:28:05,552 ) 2023-09-27T15:28:05,553 ``` 2023-09-27T15:28:05,554 * Insert multiple Records that belong to the same device. 2023-09-27T15:28:05,554 With type info the server has no need to do type inference, which leads a better performance 2023-09-27T15:28:05,555 ```python 2023-09-27T15:28:05,556 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-09-27T15:28:05,556 ``` 2023-09-27T15:28:05,557 #### Insert with type inference 2023-09-27T15:28:05,558 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-09-27T15:28:05,559 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-09-27T15:28:05,560 ```python 2023-09-27T15:28:05,561 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-09-27T15:28:05,562 ``` 2023-09-27T15:28:05,563 #### Insert of Aligned Timeseries 2023-09-27T15:28:05,564 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-09-27T15:28:05,565 * insert_aligned_record 2023-09-27T15:28:05,566 * insert_aligned_records 2023-09-27T15:28:05,566 * insert_aligned_records_of_one_device 2023-09-27T15:28:05,567 * insert_aligned_tablet 2023-09-27T15:28:05,568 * insert_aligned_tablets 2023-09-27T15:28:05,569 ### IoTDB-SQL Interface 2023-09-27T15:28:05,570 * Execute query statement 2023-09-27T15:28:05,571 ```python 2023-09-27T15:28:05,572 session.execute_query_statement(sql) 2023-09-27T15:28:05,572 ``` 2023-09-27T15:28:05,573 * Execute non query statement 2023-09-27T15:28:05,575 ```python 2023-09-27T15:28:05,575 session.execute_non_query_statement(sql) 2023-09-27T15:28:05,576 ``` 2023-09-27T15:28:05,577 * Execute statement 2023-09-27T15:28:05,578 ```python 2023-09-27T15:28:05,579 session.execute_statement(sql) 2023-09-27T15:28:05,580 ``` 2023-09-27T15:28:05,582 ### Schema Template 2023-09-27T15:28:05,582 #### Create Schema Template 2023-09-27T15:28:05,583 The step for creating a metadata template is as follows 2023-09-27T15:28:05,583 1. Create the template class 2023-09-27T15:28:05,584 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-09-27T15:28:05,584 3. Execute create schema template function 2023-09-27T15:28:05,586 ```python 2023-09-27T15:28:05,586 template = Template(name=template_name, share_time=True) 2023-09-27T15:28:05,587 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-09-27T15:28:05,588 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-09-27T15:28:05,588 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-09-27T15:28:05,589 i_node_gps.add_child(m_node_x) 2023-09-27T15:28:05,590 i_node_v.add_child(m_node_x) 2023-09-27T15:28:05,591 template.add_template(i_node_gps) 2023-09-27T15:28:05,592 template.add_template(i_node_v) 2023-09-27T15:28:05,592 template.add_template(m_node_x) 2023-09-27T15:28:05,594 session.create_schema_template(template) 2023-09-27T15:28:05,594 ``` 2023-09-27T15:28:05,595 #### Modify Schema Template nodes 2023-09-27T15:28:05,596 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-09-27T15:28:05,596 * add node in template 2023-09-27T15:28:05,597 ```python 2023-09-27T15:28:05,597 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-09-27T15:28:05,598 ``` 2023-09-27T15:28:05,599 * delete node in template 2023-09-27T15:28:05,599 ```python 2023-09-27T15:28:05,600 session.delete_node_in_template(template_name, path) 2023-09-27T15:28:05,600 ``` 2023-09-27T15:28:05,601 #### Set Schema Template 2023-09-27T15:28:05,602 ```python 2023-09-27T15:28:05,602 session.set_schema_template(template_name, prefix_path) 2023-09-27T15:28:05,603 ``` 2023-09-27T15:28:05,604 #### Uset Schema Template 2023-09-27T15:28:05,604 ```python 2023-09-27T15:28:05,605 session.unset_schema_template(template_name, prefix_path) 2023-09-27T15:28:05,605 ``` 2023-09-27T15:28:05,606 #### Show Schema Template 2023-09-27T15:28:05,607 * Show all schema templates 2023-09-27T15:28:05,607 ```python 2023-09-27T15:28:05,608 session.show_all_templates() 2023-09-27T15:28:05,608 ``` 2023-09-27T15:28:05,608 * Count all nodes in templates 2023-09-27T15:28:05,609 ```python 2023-09-27T15:28:05,609 session.count_measurements_in_template(template_name) 2023-09-27T15:28:05,610 ``` 2023-09-27T15:28:05,611 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-09-27T15:28:05,611 ```python 2023-09-27T15:28:05,612 session.count_measurements_in_template(template_name, path) 2023-09-27T15:28:05,612 ``` 2023-09-27T15:28:05,614 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-09-27T15:28:05,614 ```python 2023-09-27T15:28:05,615 session.is_path_exist_in_template(template_name, path) 2023-09-27T15:28:05,615 ``` 2023-09-27T15:28:05,616 * Show nodes under in schema template 2023-09-27T15:28:05,617 ```python 2023-09-27T15:28:05,617 session.show_measurements_in_template(template_name) 2023-09-27T15:28:05,618 ``` 2023-09-27T15:28:05,619 * Show the path prefix where a schema template is set 2023-09-27T15:28:05,620 ```python 2023-09-27T15:28:05,620 session.show_paths_template_set_on(template_name) 2023-09-27T15:28:05,621 ``` 2023-09-27T15:28:05,622 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-09-27T15:28:05,622 ```python 2023-09-27T15:28:05,623 session.show_paths_template_using_on(template_name) 2023-09-27T15:28:05,624 ``` 2023-09-27T15:28:05,625 #### Drop Schema Template 2023-09-27T15:28:05,626 Delete an existing metadata template,dropping an already set template is not supported 2023-09-27T15:28:05,627 ```python 2023-09-27T15:28:05,627 session.drop_schema_template("template_python") 2023-09-27T15:28:05,628 ``` 2023-09-27T15:28:05,630 ### Pandas Support 2023-09-27T15:28:05,631 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-09-27T15:28:05,631 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-09-27T15:28:05,632 Example: 2023-09-27T15:28:05,633 ```python 2023-09-27T15:28:05,634 from iotdb.Session import Session 2023-09-27T15:28:05,635 ip = "127.0.0.1" 2023-09-27T15:28:05,636 port_ = "6667" 2023-09-27T15:28:05,636 username_ = "root" 2023-09-27T15:28:05,637 password_ = "root" 2023-09-27T15:28:05,637 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:05,638 session.open(False) 2023-09-27T15:28:05,638 result = session.execute_query_statement("SELECT * FROM root.*") 2023-09-27T15:28:05,639 # Transform to Pandas Dataset 2023-09-27T15:28:05,640 df = result.todf() 2023-09-27T15:28:05,641 session.close() 2023-09-27T15:28:05,642 # Now you can work with the dataframe 2023-09-27T15:28:05,642 df = ... 2023-09-27T15:28:05,643 ``` 2023-09-27T15:28:05,644 ### IoTDB Testcontainer 2023-09-27T15:28:05,645 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-09-27T15:28:05,646 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-09-27T15:28:05,646 ```python 2023-09-27T15:28:05,647 class MyTestCase(unittest.TestCase): 2023-09-27T15:28:05,648 def test_something(self): 2023-09-27T15:28:05,649 with IoTDBContainer() as c: 2023-09-27T15:28:05,650 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-09-27T15:28:05,650 session.open(False) 2023-09-27T15:28:05,651 result = session.execute_query_statement("SHOW TIMESERIES") 2023-09-27T15:28:05,651 print(result) 2023-09-27T15:28:05,651 session.close() 2023-09-27T15:28:05,652 ``` 2023-09-27T15:28:05,653 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-09-27T15:28:05,654 ### IoTDB DBAPI 2023-09-27T15:28:05,655 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-09-27T15:28:05,656 interface for accessing databases in Python. 2023-09-27T15:28:05,656 #### Examples 2023-09-27T15:28:05,657 + Initialization 2023-09-27T15:28:05,657 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-09-27T15:28:05,658 ```python 2023-09-27T15:28:05,658 from iotdb.dbapi import connect 2023-09-27T15:28:05,659 ip = "127.0.0.1" 2023-09-27T15:28:05,660 port_ = "6667" 2023-09-27T15:28:05,661 username_ = "root" 2023-09-27T15:28:05,661 password_ = "root" 2023-09-27T15:28:05,661 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-09-27T15:28:05,662 cursor = conn.cursor() 2023-09-27T15:28:05,662 ``` 2023-09-27T15:28:05,663 + simple SQL statement execution 2023-09-27T15:28:05,664 ```python 2023-09-27T15:28:05,664 cursor.execute("SELECT * FROM root.*") 2023-09-27T15:28:05,665 for row in cursor.fetchall(): 2023-09-27T15:28:05,665 print(row) 2023-09-27T15:28:05,666 ``` 2023-09-27T15:28:05,667 + execute SQL with parameter 2023-09-27T15:28:05,668 IoTDB DBAPI supports pyformat style parameters 2023-09-27T15:28:05,668 ```python 2023-09-27T15:28:05,669 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-09-27T15:28:05,669 for row in cursor.fetchall(): 2023-09-27T15:28:05,670 print(row) 2023-09-27T15:28:05,671 ``` 2023-09-27T15:28:05,672 + execute SQL with parameter sequences 2023-09-27T15:28:05,673 ```python 2023-09-27T15:28:05,674 seq_of_parameters = [ 2023-09-27T15:28:05,675 {"timestamp": 1, "temperature": 1}, 2023-09-27T15:28:05,676 {"timestamp": 2, "temperature": 2}, 2023-09-27T15:28:05,676 {"timestamp": 3, "temperature": 3}, 2023-09-27T15:28:05,677 {"timestamp": 4, "temperature": 4}, 2023-09-27T15:28:05,678 {"timestamp": 5, "temperature": 5}, 2023-09-27T15:28:05,679 ] 2023-09-27T15:28:05,679 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-09-27T15:28:05,680 cursor.executemany(sql,seq_of_parameters) 2023-09-27T15:28:05,681 ``` 2023-09-27T15:28:05,682 + close the connection and cursor 2023-09-27T15:28:05,683 ```python 2023-09-27T15:28:05,684 cursor.close() 2023-09-27T15:28:05,685 conn.close() 2023-09-27T15:28:05,686 ``` 2023-09-27T15:28:05,688 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-09-27T15:28:05,688 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-09-27T15:28:05,689 This part is still being improved. 2023-09-27T15:28:05,691 Please do not use it in the production environment! 2023-09-27T15:28:05,691 #### Mapping of the metadata 2023-09-27T15:28:05,692 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-09-27T15:28:05,693 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-09-27T15:28:05,694 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-09-27T15:28:05,694 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-09-27T15:28:05,695 The metadata in the IoTDB are: 2023-09-27T15:28:05,697 1. Database 2023-09-27T15:28:05,697 2. Path 2023-09-27T15:28:05,698 3. Entity 2023-09-27T15:28:05,699 4. Measurement 2023-09-27T15:28:05,700 The metadata in the SQLAlchemy are: 2023-09-27T15:28:05,701 1. Schema 2023-09-27T15:28:05,701 2. Table 2023-09-27T15:28:05,702 3. Column 2023-09-27T15:28:05,704 The mapping relationship between them is: 2023-09-27T15:28:05,705 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-09-27T15:28:05,706 | -------------------- | ---------------------------------------------- | 2023-09-27T15:28:05,706 | Schema | Database | 2023-09-27T15:28:05,707 | Table | Path ( from database to entity ) + Entity | 2023-09-27T15:28:05,708 | Column | Measurement | 2023-09-27T15:28:05,709 The following figure shows the relationship between the two more intuitively: 2023-09-27T15:28:05,710 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-09-27T15:28:05,711 #### Data type mapping 2023-09-27T15:28:05,712 | data type in IoTDB | data type in SQLAlchemy | 2023-09-27T15:28:05,713 |--------------------|-------------------------| 2023-09-27T15:28:05,714 | BOOLEAN | Boolean | 2023-09-27T15:28:05,714 | INT32 | Integer | 2023-09-27T15:28:05,715 | INT64 | BigInteger | 2023-09-27T15:28:05,716 | FLOAT | Float | 2023-09-27T15:28:05,716 | DOUBLE | Float | 2023-09-27T15:28:05,717 | TEXT | Text | 2023-09-27T15:28:05,718 | LONG | BigInteger | 2023-09-27T15:28:05,718 #### Example 2023-09-27T15:28:05,720 + execute statement 2023-09-27T15:28:05,721 ```python 2023-09-27T15:28:05,722 from sqlalchemy import create_engine 2023-09-27T15:28:05,723 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:05,724 connect = engine.connect() 2023-09-27T15:28:05,725 result = connect.execute("SELECT ** FROM root") 2023-09-27T15:28:05,725 for row in result.fetchall(): 2023-09-27T15:28:05,726 print(row) 2023-09-27T15:28:05,727 ``` 2023-09-27T15:28:05,729 + ORM (now only simple queries are supported) 2023-09-27T15:28:05,730 ```python 2023-09-27T15:28:05,731 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-09-27T15:28:05,732 from sqlalchemy.ext.declarative import declarative_base 2023-09-27T15:28:05,733 from sqlalchemy.orm import sessionmaker 2023-09-27T15:28:05,734 metadata = MetaData( 2023-09-27T15:28:05,735 schema='root.factory' 2023-09-27T15:28:05,736 ) 2023-09-27T15:28:05,737 Base = declarative_base(metadata=metadata) 2023-09-27T15:28:05,739 class Device(Base): 2023-09-27T15:28:05,740 __tablename__ = "room2.device1" 2023-09-27T15:28:05,741 Time = Column(BigInteger, primary_key=True) 2023-09-27T15:28:05,742 temperature = Column(Float) 2023-09-27T15:28:05,743 status = Column(Float) 2023-09-27T15:28:05,745 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:05,747 DbSession = sessionmaker(bind=engine) 2023-09-27T15:28:05,748 session = DbSession() 2023-09-27T15:28:05,750 res = session.query(Device.status).filter(Device.temperature > 1) 2023-09-27T15:28:05,751 for row in res: 2023-09-27T15:28:05,752 print(row) 2023-09-27T15:28:05,753 ``` 2023-09-27T15:28:05,754 ## Developers 2023-09-27T15:28:05,755 ### Introduction 2023-09-27T15:28:05,757 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-09-27T15:28:05,759 ### Prerequisites 2023-09-27T15:28:05,760 Python3.7 or later is preferred. 2023-09-27T15:28:05,761 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-09-27T15:28:05,762 ``` 2023-09-27T15:28:05,763 http://thrift.apache.org/docs/install/ 2023-09-27T15:28:05,763 ``` 2023-09-27T15:28:05,764 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-09-27T15:28:05,765 ```shell 2023-09-27T15:28:05,765 pip install -r requirements_dev.txt 2023-09-27T15:28:05,766 ``` 2023-09-27T15:28:05,768 ### Compile the thrift library and Debug 2023-09-27T15:28:05,769 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-09-27T15:28:05,771 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-09-27T15:28:05,771 This folder is ignored from git and should **never be pushed to git!** 2023-09-27T15:28:05,773 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-09-27T15:28:05,776 ### Session Client & Example 2023-09-27T15:28:05,778 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-09-27T15:28:05,780 Or, another simple example: 2023-09-27T15:28:05,781 ```python 2023-09-27T15:28:05,782 from iotdb.Session import Session 2023-09-27T15:28:05,783 ip = "127.0.0.1" 2023-09-27T15:28:05,783 port_ = "6667" 2023-09-27T15:28:05,784 username_ = "root" 2023-09-27T15:28:05,784 password_ = "root" 2023-09-27T15:28:05,785 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:05,785 session.open(False) 2023-09-27T15:28:05,786 zone = session.get_time_zone() 2023-09-27T15:28:05,787 session.close() 2023-09-27T15:28:05,787 ``` 2023-09-27T15:28:05,789 ### Tests 2023-09-27T15:28:05,790 Please add your custom tests in `tests` folder. 2023-09-27T15:28:05,791 To run all defined tests just type `pytest .` in the root folder. 2023-09-27T15:28:05,792 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-09-27T15:28:05,794 ### Futher Tools 2023-09-27T15:28:05,795 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-09-27T15:28:05,795 Both can be run by `black .` or `flake8 .` respectively. 2023-09-27T15:28:05,797 ## Releasing 2023-09-27T15:28:05,798 To do a release just ensure that you have the right set of generated thrift files. 2023-09-27T15:28:05,798 Then run linting and auto-formatting. 2023-09-27T15:28:05,799 Then, ensure that all tests work (via `pytest .`). 2023-09-27T15:28:05,799 Then you are good to go to do a release! 2023-09-27T15:28:05,802 ### Preparing your environment 2023-09-27T15:28:05,803 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-09-27T15:28:05,805 ### Doing the Release 2023-09-27T15:28:05,806 There is a convenient script `release.sh` to do all steps for a release. 2023-09-27T15:28:05,806 Namely, these are 2023-09-27T15:28:05,807 * Remove all transient directories from last release (if exists) 2023-09-27T15:28:05,808 * (Re-)generate all generated sources via mvn 2023-09-27T15:28:05,808 * Run Linting (flake8) 2023-09-27T15:28:05,808 * Run Tests via pytest 2023-09-27T15:28:05,809 * Build 2023-09-27T15:28:05,809 * Release to pypi 2023-09-27T15:28:05,810 /tmp/pip-build-env-4do20bsk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-09-27T15:28:05,810 warnings.warn(msg) 2023-09-27T15:28:05,811 running dist_info 2023-09-27T15:28:05,811 creating /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info 2023-09-27T15:28:05,812 writing /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/PKG-INFO 2023-09-27T15:28:05,812 writing dependency_links to /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/dependency_links.txt 2023-09-27T15:28:05,812 writing entry points to /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/entry_points.txt 2023-09-27T15:28:05,813 writing requirements to /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/requires.txt 2023-09-27T15:28:05,813 writing top-level names to /tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/top_level.txt 2023-09-27T15:28:05,813 writing manifest file '/tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:05,814 reading manifest file '/tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:05,814 writing manifest file '/tmp/pip-modern-metadata-nq021w6j/apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:05,814 creating '/tmp/pip-modern-metadata-nq021w6j/apache_iotdb-1.2.0.dist-info' 2023-09-27T15:28:05,815 Preparing metadata (pyproject.toml): finished with status 'done' 2023-09-27T15:28:05,821 Source in /tmp/pip-wheel-mujlt_mr/apache-iotdb_74f5d797bbe840d0a6115575591616d2 has version 1.2.0, which satisfies requirement apache-iotdb==1.2.0 from https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz 2023-09-27T15:28:05,822 Removed apache-iotdb==1.2.0 from https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz from build tracker '/tmp/pip-build-tracker-0nywb_ay' 2023-09-27T15:28:05,830 Created temporary directory: /tmp/pip-unpack-gggd23uh 2023-09-27T15:28:05,831 Created temporary directory: /tmp/pip-unpack-nj2zq06b 2023-09-27T15:28:05,843 Building wheels for collected packages: apache-iotdb 2023-09-27T15:28:05,847 Created temporary directory: /tmp/pip-wheel-3ybi_6c9 2023-09-27T15:28:05,848 Destination directory: /tmp/pip-wheel-3ybi_6c9 2023-09-27T15:28:05,850 Building wheel for apache-iotdb (pyproject.toml): started 2023-09-27T15:28:05,851 Running command Building wheel for apache-iotdb (pyproject.toml) 2023-09-27T15:28:06,269 2023-09-27T15:28:06,280 # Apache IoTDB 2023-09-27T15:28:06,281 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-09-27T15:28:06,281 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-09-27T15:28:06,282 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-09-27T15:28:06,282 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-09-27T15:28:06,283 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-09-27T15:28:06,283 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-09-27T15:28:06,284 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-09-27T15:28:06,285 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-09-27T15:28:06,286 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-09-27T15:28:06,286 architecture, high performance and rich feature set together with its deep integration with 2023-09-27T15:28:06,287 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-09-27T15:28:06,287 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-09-27T15:28:06,288 ## Python Native API 2023-09-27T15:28:06,289 ### Requirements 2023-09-27T15:28:06,290 You have to install thrift (>=0.13) before using the package. 2023-09-27T15:28:06,292 ### How to use (Example) 2023-09-27T15:28:06,293 First, download the latest package: `pip3 install apache-iotdb` 2023-09-27T15:28:06,295 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-09-27T15:28:06,296 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-09-27T15:28:06,297 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-09-27T15:28:06,299 (you need to add `import iotdb` in the head of the file) 2023-09-27T15:28:06,300 Or: 2023-09-27T15:28:06,301 ```python 2023-09-27T15:28:06,302 from iotdb.Session import Session 2023-09-27T15:28:06,303 ip = "127.0.0.1" 2023-09-27T15:28:06,303 port_ = "6667" 2023-09-27T15:28:06,304 username_ = "root" 2023-09-27T15:28:06,305 password_ = "root" 2023-09-27T15:28:06,305 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:06,306 session.open(False) 2023-09-27T15:28:06,306 zone = session.get_time_zone() 2023-09-27T15:28:06,307 session.close() 2023-09-27T15:28:06,307 ``` 2023-09-27T15:28:06,308 ### Initialization 2023-09-27T15:28:06,309 * Initialize a Session 2023-09-27T15:28:06,311 ```python 2023-09-27T15:28:06,311 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-09-27T15:28:06,312 ``` 2023-09-27T15:28:06,313 * Open a session, with a parameter to specify whether to enable RPC compression 2023-09-27T15:28:06,314 ```python 2023-09-27T15:28:06,314 session.open(enable_rpc_compression=False) 2023-09-27T15:28:06,315 ``` 2023-09-27T15:28:06,316 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-09-27T15:28:06,317 * Close a Session 2023-09-27T15:28:06,318 ```python 2023-09-27T15:28:06,319 session.close() 2023-09-27T15:28:06,320 ``` 2023-09-27T15:28:06,321 ### Data Definition Interface (DDL Interface) 2023-09-27T15:28:06,322 #### DATABASE Management 2023-09-27T15:28:06,323 * CREATE DATABASE 2023-09-27T15:28:06,324 ```python 2023-09-27T15:28:06,324 session.set_storage_group(group_name) 2023-09-27T15:28:06,325 ``` 2023-09-27T15:28:06,325 * Delete one or several databases 2023-09-27T15:28:06,326 ```python 2023-09-27T15:28:06,327 session.delete_storage_group(group_name) 2023-09-27T15:28:06,327 session.delete_storage_groups(group_name_lst) 2023-09-27T15:28:06,328 ``` 2023-09-27T15:28:06,328 #### Timeseries Management 2023-09-27T15:28:06,329 * Create one or multiple timeseries 2023-09-27T15:28:06,330 ```python 2023-09-27T15:28:06,330 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-09-27T15:28:06,331 props=None, tags=None, attributes=None, alias=None) 2023-09-27T15:28:06,332 session.create_multi_time_series( 2023-09-27T15:28:06,332 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-09-27T15:28:06,333 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-09-27T15:28:06,333 ) 2023-09-27T15:28:06,334 ``` 2023-09-27T15:28:06,335 * Create aligned timeseries 2023-09-27T15:28:06,336 ```python 2023-09-27T15:28:06,336 session.create_aligned_time_series( 2023-09-27T15:28:06,337 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-09-27T15:28:06,337 ) 2023-09-27T15:28:06,338 ``` 2023-09-27T15:28:06,338 Attention: Alias of measurements are **not supported** currently. 2023-09-27T15:28:06,339 * Delete one or several timeseries 2023-09-27T15:28:06,340 ```python 2023-09-27T15:28:06,341 session.delete_time_series(paths_list) 2023-09-27T15:28:06,341 ``` 2023-09-27T15:28:06,343 * Check whether the specific timeseries exists 2023-09-27T15:28:06,344 ```python 2023-09-27T15:28:06,344 session.check_time_series_exists(path) 2023-09-27T15:28:06,345 ``` 2023-09-27T15:28:06,346 ### Data Manipulation Interface (DML Interface) 2023-09-27T15:28:06,347 #### Insert 2023-09-27T15:28:06,348 It is recommended to use insertTablet to help improve write efficiency. 2023-09-27T15:28:06,349 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-09-27T15:28:06,349 * **Better Write Performance** 2023-09-27T15:28:06,350 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-09-27T15:28:06,351 We have two implementations of Tablet in Python API. 2023-09-27T15:28:06,353 * Normal Tablet 2023-09-27T15:28:06,354 ```python 2023-09-27T15:28:06,354 values_ = [ 2023-09-27T15:28:06,355 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:06,355 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:06,356 [False, 100, 1, 188.1, 688.25, "test03"], 2023-09-27T15:28:06,357 [True, 0, 0, 0, 6.25, "test04"], 2023-09-27T15:28:06,357 ] 2023-09-27T15:28:06,358 timestamps_ = [1, 2, 3, 4] 2023-09-27T15:28:06,358 tablet_ = Tablet( 2023-09-27T15:28:06,359 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:06,359 ) 2023-09-27T15:28:06,360 session.insert_tablet(tablet_) 2023-09-27T15:28:06,361 values_ = [ 2023-09-27T15:28:06,362 [None, 10, 11, 1.1, 10011.1, "test01"], 2023-09-27T15:28:06,362 [True, None, 11111, 1.25, 101.0, "test02"], 2023-09-27T15:28:06,363 [False, 100, None, 188.1, 688.25, "test03"], 2023-09-27T15:28:06,363 [True, 0, 0, 0, None, None], 2023-09-27T15:28:06,364 ] 2023-09-27T15:28:06,365 timestamps_ = [16, 17, 18, 19] 2023-09-27T15:28:06,365 tablet_ = Tablet( 2023-09-27T15:28:06,366 device_id, measurements_, data_types_, values_, timestamps_ 2023-09-27T15:28:06,366 ) 2023-09-27T15:28:06,367 session.insert_tablet(tablet_) 2023-09-27T15:28:06,368 ``` 2023-09-27T15:28:06,368 * Numpy Tablet 2023-09-27T15:28:06,369 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-09-27T15:28:06,370 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-09-27T15:28:06,371 **Notice** 2023-09-27T15:28:06,372 1. time and value columns in Tablet are ndarray. 2023-09-27T15:28:06,372 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-09-27T15:28:06,372 (if not, the default dtypes are also ok). 2023-09-27T15:28:06,373 ```python 2023-09-27T15:28:06,374 import numpy as np 2023-09-27T15:28:06,374 data_types_ = [ 2023-09-27T15:28:06,375 TSDataType.BOOLEAN, 2023-09-27T15:28:06,375 TSDataType.INT32, 2023-09-27T15:28:06,376 TSDataType.INT64, 2023-09-27T15:28:06,376 TSDataType.FLOAT, 2023-09-27T15:28:06,376 TSDataType.DOUBLE, 2023-09-27T15:28:06,377 TSDataType.TEXT, 2023-09-27T15:28:06,377 ] 2023-09-27T15:28:06,378 np_values_ = [ 2023-09-27T15:28:06,378 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:06,379 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:06,379 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:06,379 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:06,380 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:06,380 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:06,381 ] 2023-09-27T15:28:06,381 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:06,382 np_tablet_ = NumpyTablet( 2023-09-27T15:28:06,382 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2023-09-27T15:28:06,383 ) 2023-09-27T15:28:06,383 session.insert_tablet(np_tablet_) 2023-09-27T15:28:06,384 # insert one numpy tablet with none into the database. 2023-09-27T15:28:06,385 np_values_ = [ 2023-09-27T15:28:06,385 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-09-27T15:28:06,386 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-09-27T15:28:06,387 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-09-27T15:28:06,388 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-09-27T15:28:06,388 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-09-27T15:28:06,389 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-09-27T15:28:06,389 ] 2023-09-27T15:28:06,390 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2023-09-27T15:28:06,391 np_bitmaps_ = [] 2023-09-27T15:28:06,392 for i in range(len(measurements_)): 2023-09-27T15:28:06,392 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2023-09-27T15:28:06,393 np_bitmaps_[0].mark(0) 2023-09-27T15:28:06,394 np_bitmaps_[1].mark(1) 2023-09-27T15:28:06,394 np_bitmaps_[2].mark(2) 2023-09-27T15:28:06,395 np_bitmaps_[4].mark(3) 2023-09-27T15:28:06,395 np_bitmaps_[5].mark(3) 2023-09-27T15:28:06,396 np_tablet_with_none = NumpyTablet( 2023-09-27T15:28:06,396 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2023-09-27T15:28:06,397 ) 2023-09-27T15:28:06,398 session.insert_tablet(np_tablet_with_none) 2023-09-27T15:28:06,398 ``` 2023-09-27T15:28:06,399 * Insert multiple Tablets 2023-09-27T15:28:06,400 ```python 2023-09-27T15:28:06,401 session.insert_tablets(tablet_lst) 2023-09-27T15:28:06,401 ``` 2023-09-27T15:28:06,402 * Insert a Record 2023-09-27T15:28:06,403 ```python 2023-09-27T15:28:06,404 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-09-27T15:28:06,405 ``` 2023-09-27T15:28:06,406 * Insert multiple Records 2023-09-27T15:28:06,407 ```python 2023-09-27T15:28:06,407 session.insert_records( 2023-09-27T15:28:06,408 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-09-27T15:28:06,409 ) 2023-09-27T15:28:06,409 ``` 2023-09-27T15:28:06,411 * Insert multiple Records that belong to the same device. 2023-09-27T15:28:06,411 With type info the server has no need to do type inference, which leads a better performance 2023-09-27T15:28:06,413 ```python 2023-09-27T15:28:06,413 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-09-27T15:28:06,413 ``` 2023-09-27T15:28:06,414 #### Insert with type inference 2023-09-27T15:28:06,415 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-09-27T15:28:06,416 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-09-27T15:28:06,417 ```python 2023-09-27T15:28:06,417 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-09-27T15:28:06,418 ``` 2023-09-27T15:28:06,419 #### Insert of Aligned Timeseries 2023-09-27T15:28:06,420 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-09-27T15:28:06,421 * insert_aligned_record 2023-09-27T15:28:06,422 * insert_aligned_records 2023-09-27T15:28:06,422 * insert_aligned_records_of_one_device 2023-09-27T15:28:06,423 * insert_aligned_tablet 2023-09-27T15:28:06,423 * insert_aligned_tablets 2023-09-27T15:28:06,425 ### IoTDB-SQL Interface 2023-09-27T15:28:06,426 * Execute query statement 2023-09-27T15:28:06,427 ```python 2023-09-27T15:28:06,427 session.execute_query_statement(sql) 2023-09-27T15:28:06,428 ``` 2023-09-27T15:28:06,429 * Execute non query statement 2023-09-27T15:28:06,430 ```python 2023-09-27T15:28:06,430 session.execute_non_query_statement(sql) 2023-09-27T15:28:06,431 ``` 2023-09-27T15:28:06,432 * Execute statement 2023-09-27T15:28:06,433 ```python 2023-09-27T15:28:06,434 session.execute_statement(sql) 2023-09-27T15:28:06,434 ``` 2023-09-27T15:28:06,435 ### Schema Template 2023-09-27T15:28:06,436 #### Create Schema Template 2023-09-27T15:28:06,436 The step for creating a metadata template is as follows 2023-09-27T15:28:06,437 1. Create the template class 2023-09-27T15:28:06,437 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-09-27T15:28:06,438 3. Execute create schema template function 2023-09-27T15:28:06,439 ```python 2023-09-27T15:28:06,440 template = Template(name=template_name, share_time=True) 2023-09-27T15:28:06,441 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-09-27T15:28:06,441 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-09-27T15:28:06,442 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-09-27T15:28:06,443 i_node_gps.add_child(m_node_x) 2023-09-27T15:28:06,444 i_node_v.add_child(m_node_x) 2023-09-27T15:28:06,445 template.add_template(i_node_gps) 2023-09-27T15:28:06,445 template.add_template(i_node_v) 2023-09-27T15:28:06,446 template.add_template(m_node_x) 2023-09-27T15:28:06,447 session.create_schema_template(template) 2023-09-27T15:28:06,447 ``` 2023-09-27T15:28:06,448 #### Modify Schema Template nodes 2023-09-27T15:28:06,448 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-09-27T15:28:06,449 * add node in template 2023-09-27T15:28:06,450 ```python 2023-09-27T15:28:06,450 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-09-27T15:28:06,451 ``` 2023-09-27T15:28:06,452 * delete node in template 2023-09-27T15:28:06,453 ```python 2023-09-27T15:28:06,453 session.delete_node_in_template(template_name, path) 2023-09-27T15:28:06,454 ``` 2023-09-27T15:28:06,455 #### Set Schema Template 2023-09-27T15:28:06,455 ```python 2023-09-27T15:28:06,456 session.set_schema_template(template_name, prefix_path) 2023-09-27T15:28:06,456 ``` 2023-09-27T15:28:06,457 #### Uset Schema Template 2023-09-27T15:28:06,457 ```python 2023-09-27T15:28:06,458 session.unset_schema_template(template_name, prefix_path) 2023-09-27T15:28:06,458 ``` 2023-09-27T15:28:06,459 #### Show Schema Template 2023-09-27T15:28:06,460 * Show all schema templates 2023-09-27T15:28:06,460 ```python 2023-09-27T15:28:06,461 session.show_all_templates() 2023-09-27T15:28:06,461 ``` 2023-09-27T15:28:06,462 * Count all nodes in templates 2023-09-27T15:28:06,462 ```python 2023-09-27T15:28:06,463 session.count_measurements_in_template(template_name) 2023-09-27T15:28:06,463 ``` 2023-09-27T15:28:06,465 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-09-27T15:28:06,465 ```python 2023-09-27T15:28:06,466 session.count_measurements_in_template(template_name, path) 2023-09-27T15:28:06,466 ``` 2023-09-27T15:28:06,467 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-09-27T15:28:06,467 ```python 2023-09-27T15:28:06,468 session.is_path_exist_in_template(template_name, path) 2023-09-27T15:28:06,468 ``` 2023-09-27T15:28:06,469 * Show nodes under in schema template 2023-09-27T15:28:06,470 ```python 2023-09-27T15:28:06,470 session.show_measurements_in_template(template_name) 2023-09-27T15:28:06,471 ``` 2023-09-27T15:28:06,472 * Show the path prefix where a schema template is set 2023-09-27T15:28:06,472 ```python 2023-09-27T15:28:06,473 session.show_paths_template_set_on(template_name) 2023-09-27T15:28:06,473 ``` 2023-09-27T15:28:06,474 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-09-27T15:28:06,475 ```python 2023-09-27T15:28:06,475 session.show_paths_template_using_on(template_name) 2023-09-27T15:28:06,476 ``` 2023-09-27T15:28:06,477 #### Drop Schema Template 2023-09-27T15:28:06,477 Delete an existing metadata template,dropping an already set template is not supported 2023-09-27T15:28:06,478 ```python 2023-09-27T15:28:06,478 session.drop_schema_template("template_python") 2023-09-27T15:28:06,479 ``` 2023-09-27T15:28:06,480 ### Pandas Support 2023-09-27T15:28:06,481 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-09-27T15:28:06,482 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-09-27T15:28:06,483 Example: 2023-09-27T15:28:06,485 ```python 2023-09-27T15:28:06,486 from iotdb.Session import Session 2023-09-27T15:28:06,487 ip = "127.0.0.1" 2023-09-27T15:28:06,487 port_ = "6667" 2023-09-27T15:28:06,488 username_ = "root" 2023-09-27T15:28:06,489 password_ = "root" 2023-09-27T15:28:06,489 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:06,490 session.open(False) 2023-09-27T15:28:06,490 result = session.execute_query_statement("SELECT * FROM root.*") 2023-09-27T15:28:06,491 # Transform to Pandas Dataset 2023-09-27T15:28:06,492 df = result.todf() 2023-09-27T15:28:06,493 session.close() 2023-09-27T15:28:06,494 # Now you can work with the dataframe 2023-09-27T15:28:06,494 df = ... 2023-09-27T15:28:06,495 ``` 2023-09-27T15:28:06,496 ### IoTDB Testcontainer 2023-09-27T15:28:06,497 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-09-27T15:28:06,498 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-09-27T15:28:06,499 ```python 2023-09-27T15:28:06,500 class MyTestCase(unittest.TestCase): 2023-09-27T15:28:06,501 def test_something(self): 2023-09-27T15:28:06,501 with IoTDBContainer() as c: 2023-09-27T15:28:06,502 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-09-27T15:28:06,503 session.open(False) 2023-09-27T15:28:06,503 result = session.execute_query_statement("SHOW TIMESERIES") 2023-09-27T15:28:06,503 print(result) 2023-09-27T15:28:06,504 session.close() 2023-09-27T15:28:06,504 ``` 2023-09-27T15:28:06,505 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-09-27T15:28:06,506 ### IoTDB DBAPI 2023-09-27T15:28:06,507 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-09-27T15:28:06,507 interface for accessing databases in Python. 2023-09-27T15:28:06,508 #### Examples 2023-09-27T15:28:06,509 + Initialization 2023-09-27T15:28:06,509 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-09-27T15:28:06,510 ```python 2023-09-27T15:28:06,510 from iotdb.dbapi import connect 2023-09-27T15:28:06,511 ip = "127.0.0.1" 2023-09-27T15:28:06,512 port_ = "6667" 2023-09-27T15:28:06,512 username_ = "root" 2023-09-27T15:28:06,513 password_ = "root" 2023-09-27T15:28:06,513 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-09-27T15:28:06,513 cursor = conn.cursor() 2023-09-27T15:28:06,514 ``` 2023-09-27T15:28:06,514 + simple SQL statement execution 2023-09-27T15:28:06,515 ```python 2023-09-27T15:28:06,515 cursor.execute("SELECT * FROM root.*") 2023-09-27T15:28:06,516 for row in cursor.fetchall(): 2023-09-27T15:28:06,516 print(row) 2023-09-27T15:28:06,517 ``` 2023-09-27T15:28:06,518 + execute SQL with parameter 2023-09-27T15:28:06,519 IoTDB DBAPI supports pyformat style parameters 2023-09-27T15:28:06,519 ```python 2023-09-27T15:28:06,520 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-09-27T15:28:06,520 for row in cursor.fetchall(): 2023-09-27T15:28:06,521 print(row) 2023-09-27T15:28:06,521 ``` 2023-09-27T15:28:06,522 + execute SQL with parameter sequences 2023-09-27T15:28:06,523 ```python 2023-09-27T15:28:06,523 seq_of_parameters = [ 2023-09-27T15:28:06,524 {"timestamp": 1, "temperature": 1}, 2023-09-27T15:28:06,524 {"timestamp": 2, "temperature": 2}, 2023-09-27T15:28:06,525 {"timestamp": 3, "temperature": 3}, 2023-09-27T15:28:06,525 {"timestamp": 4, "temperature": 4}, 2023-09-27T15:28:06,526 {"timestamp": 5, "temperature": 5}, 2023-09-27T15:28:06,526 ] 2023-09-27T15:28:06,527 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-09-27T15:28:06,527 cursor.executemany(sql,seq_of_parameters) 2023-09-27T15:28:06,528 ``` 2023-09-27T15:28:06,529 + close the connection and cursor 2023-09-27T15:28:06,529 ```python 2023-09-27T15:28:06,530 cursor.close() 2023-09-27T15:28:06,530 conn.close() 2023-09-27T15:28:06,531 ``` 2023-09-27T15:28:06,532 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-09-27T15:28:06,532 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-09-27T15:28:06,533 This part is still being improved. 2023-09-27T15:28:06,533 Please do not use it in the production environment! 2023-09-27T15:28:06,534 #### Mapping of the metadata 2023-09-27T15:28:06,534 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-09-27T15:28:06,535 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-09-27T15:28:06,536 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-09-27T15:28:06,536 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-09-27T15:28:06,538 The metadata in the IoTDB are: 2023-09-27T15:28:06,539 1. Database 2023-09-27T15:28:06,539 2. Path 2023-09-27T15:28:06,540 3. Entity 2023-09-27T15:28:06,540 4. Measurement 2023-09-27T15:28:06,541 The metadata in the SQLAlchemy are: 2023-09-27T15:28:06,541 1. Schema 2023-09-27T15:28:06,542 2. Table 2023-09-27T15:28:06,542 3. Column 2023-09-27T15:28:06,543 The mapping relationship between them is: 2023-09-27T15:28:06,544 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-09-27T15:28:06,545 | -------------------- | ---------------------------------------------- | 2023-09-27T15:28:06,545 | Schema | Database | 2023-09-27T15:28:06,545 | Table | Path ( from database to entity ) + Entity | 2023-09-27T15:28:06,546 | Column | Measurement | 2023-09-27T15:28:06,547 The following figure shows the relationship between the two more intuitively: 2023-09-27T15:28:06,548 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-09-27T15:28:06,548 #### Data type mapping 2023-09-27T15:28:06,549 | data type in IoTDB | data type in SQLAlchemy | 2023-09-27T15:28:06,549 |--------------------|-------------------------| 2023-09-27T15:28:06,550 | BOOLEAN | Boolean | 2023-09-27T15:28:06,550 | INT32 | Integer | 2023-09-27T15:28:06,551 | INT64 | BigInteger | 2023-09-27T15:28:06,551 | FLOAT | Float | 2023-09-27T15:28:06,552 | DOUBLE | Float | 2023-09-27T15:28:06,552 | TEXT | Text | 2023-09-27T15:28:06,553 | LONG | BigInteger | 2023-09-27T15:28:06,553 #### Example 2023-09-27T15:28:06,554 + execute statement 2023-09-27T15:28:06,555 ```python 2023-09-27T15:28:06,556 from sqlalchemy import create_engine 2023-09-27T15:28:06,557 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:06,558 connect = engine.connect() 2023-09-27T15:28:06,558 result = connect.execute("SELECT ** FROM root") 2023-09-27T15:28:06,559 for row in result.fetchall(): 2023-09-27T15:28:06,559 print(row) 2023-09-27T15:28:06,560 ``` 2023-09-27T15:28:06,561 + ORM (now only simple queries are supported) 2023-09-27T15:28:06,562 ```python 2023-09-27T15:28:06,562 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-09-27T15:28:06,563 from sqlalchemy.ext.declarative import declarative_base 2023-09-27T15:28:06,563 from sqlalchemy.orm import sessionmaker 2023-09-27T15:28:06,564 metadata = MetaData( 2023-09-27T15:28:06,565 schema='root.factory' 2023-09-27T15:28:06,565 ) 2023-09-27T15:28:06,566 Base = declarative_base(metadata=metadata) 2023-09-27T15:28:06,567 class Device(Base): 2023-09-27T15:28:06,568 __tablename__ = "room2.device1" 2023-09-27T15:28:06,568 Time = Column(BigInteger, primary_key=True) 2023-09-27T15:28:06,569 temperature = Column(Float) 2023-09-27T15:28:06,569 status = Column(Float) 2023-09-27T15:28:06,571 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-09-27T15:28:06,572 DbSession = sessionmaker(bind=engine) 2023-09-27T15:28:06,572 session = DbSession() 2023-09-27T15:28:06,573 res = session.query(Device.status).filter(Device.temperature > 1) 2023-09-27T15:28:06,574 for row in res: 2023-09-27T15:28:06,575 print(row) 2023-09-27T15:28:06,576 ``` 2023-09-27T15:28:06,577 ## Developers 2023-09-27T15:28:06,578 ### Introduction 2023-09-27T15:28:06,579 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-09-27T15:28:06,582 ### Prerequisites 2023-09-27T15:28:06,583 Python3.7 or later is preferred. 2023-09-27T15:28:06,583 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-09-27T15:28:06,584 ``` 2023-09-27T15:28:06,585 http://thrift.apache.org/docs/install/ 2023-09-27T15:28:06,585 ``` 2023-09-27T15:28:06,586 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-09-27T15:28:06,586 ```shell 2023-09-27T15:28:06,587 pip install -r requirements_dev.txt 2023-09-27T15:28:06,588 ``` 2023-09-27T15:28:06,590 ### Compile the thrift library and Debug 2023-09-27T15:28:06,591 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-09-27T15:28:06,592 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-09-27T15:28:06,592 This folder is ignored from git and should **never be pushed to git!** 2023-09-27T15:28:06,593 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-09-27T15:28:06,596 ### Session Client & Example 2023-09-27T15:28:06,598 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-09-27T15:28:06,601 Or, another simple example: 2023-09-27T15:28:06,602 ```python 2023-09-27T15:28:06,602 from iotdb.Session import Session 2023-09-27T15:28:06,603 ip = "127.0.0.1" 2023-09-27T15:28:06,604 port_ = "6667" 2023-09-27T15:28:06,604 username_ = "root" 2023-09-27T15:28:06,609 password_ = "root" 2023-09-27T15:28:06,611 session = Session(ip, port_, username_, password_) 2023-09-27T15:28:06,611 session.open(False) 2023-09-27T15:28:06,612 zone = session.get_time_zone() 2023-09-27T15:28:06,612 session.close() 2023-09-27T15:28:06,613 ``` 2023-09-27T15:28:06,615 ### Tests 2023-09-27T15:28:06,616 Please add your custom tests in `tests` folder. 2023-09-27T15:28:06,617 To run all defined tests just type `pytest .` in the root folder. 2023-09-27T15:28:06,618 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-09-27T15:28:06,620 ### Futher Tools 2023-09-27T15:28:06,621 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-09-27T15:28:06,621 Both can be run by `black .` or `flake8 .` respectively. 2023-09-27T15:28:06,623 ## Releasing 2023-09-27T15:28:06,624 To do a release just ensure that you have the right set of generated thrift files. 2023-09-27T15:28:06,625 Then run linting and auto-formatting. 2023-09-27T15:28:06,625 Then, ensure that all tests work (via `pytest .`). 2023-09-27T15:28:06,626 Then you are good to go to do a release! 2023-09-27T15:28:06,628 ### Preparing your environment 2023-09-27T15:28:06,629 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-09-27T15:28:06,631 ### Doing the Release 2023-09-27T15:28:06,632 There is a convenient script `release.sh` to do all steps for a release. 2023-09-27T15:28:06,632 Namely, these are 2023-09-27T15:28:06,634 * Remove all transient directories from last release (if exists) 2023-09-27T15:28:06,634 * (Re-)generate all generated sources via mvn 2023-09-27T15:28:06,635 * Run Linting (flake8) 2023-09-27T15:28:06,635 * Run Tests via pytest 2023-09-27T15:28:06,636 * Build 2023-09-27T15:28:06,637 * Release to pypi 2023-09-27T15:28:06,638 /tmp/pip-build-env-4do20bsk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-09-27T15:28:06,639 warnings.warn(msg) 2023-09-27T15:28:06,640 running bdist_wheel 2023-09-27T15:28:06,641 running build 2023-09-27T15:28:06,641 running build_py 2023-09-27T15:28:06,642 creating build 2023-09-27T15:28:06,642 creating build/lib 2023-09-27T15:28:06,643 creating build/lib/tests 2023-09-27T15:28:06,643 copying tests/test_delete_data.py -> build/lib/tests 2023-09-27T15:28:06,644 copying tests/test_numpy_tablet.py -> build/lib/tests 2023-09-27T15:28:06,644 copying tests/test_one_device.py -> build/lib/tests 2023-09-27T15:28:06,645 copying tests/test_session.py -> build/lib/tests 2023-09-27T15:28:06,645 copying tests/test_tablet.py -> build/lib/tests 2023-09-27T15:28:06,646 copying tests/tablet_performance_comparison.py -> build/lib/tests 2023-09-27T15:28:06,646 copying tests/__init__.py -> build/lib/tests 2023-09-27T15:28:06,646 copying tests/test_dataframe.py -> build/lib/tests 2023-09-27T15:28:06,647 copying tests/test_template.py -> build/lib/tests 2023-09-27T15:28:06,647 copying tests/test_todf.py -> build/lib/tests 2023-09-27T15:28:06,648 copying tests/test_aligned_timeseries.py -> build/lib/tests 2023-09-27T15:28:06,648 creating build/lib/iotdb 2023-09-27T15:28:06,648 copying iotdb/Session.py -> build/lib/iotdb 2023-09-27T15:28:06,649 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2023-09-27T15:28:06,649 copying iotdb/__init__.py -> build/lib/iotdb 2023-09-27T15:28:06,649 creating build/lib/iotdb/dbapi 2023-09-27T15:28:06,650 copying iotdb/dbapi/Cursor.py -> build/lib/iotdb/dbapi 2023-09-27T15:28:06,650 copying iotdb/dbapi/Exceptions.py -> build/lib/iotdb/dbapi 2023-09-27T15:28:06,651 copying iotdb/dbapi/__init__.py -> build/lib/iotdb/dbapi 2023-09-27T15:28:06,651 copying iotdb/dbapi/Connection.py -> build/lib/iotdb/dbapi 2023-09-27T15:28:06,652 creating build/lib/iotdb/tsfile 2023-09-27T15:28:06,652 copying iotdb/tsfile/__init__.py -> build/lib/iotdb/tsfile 2023-09-27T15:28:06,653 creating build/lib/iotdb/template 2023-09-27T15:28:06,653 copying iotdb/template/Template.py -> build/lib/iotdb/template 2023-09-27T15:28:06,653 copying iotdb/template/InternalNode.py -> build/lib/iotdb/template 2023-09-27T15:28:06,654 copying iotdb/template/TemplateQueryType.py -> build/lib/iotdb/template 2023-09-27T15:28:06,654 copying iotdb/template/TemplateNode.py -> build/lib/iotdb/template 2023-09-27T15:28:06,655 copying iotdb/template/__init__.py -> build/lib/iotdb/template 2023-09-27T15:28:06,655 copying iotdb/template/MeasurementNode.py -> build/lib/iotdb/template 2023-09-27T15:28:06,656 creating build/lib/iotdb/thrift 2023-09-27T15:28:06,656 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2023-09-27T15:28:06,657 creating build/lib/iotdb/utils 2023-09-27T15:28:06,658 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,658 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,659 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,659 copying iotdb/utils/IoTDBConnectionException.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,660 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,660 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,660 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,661 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,661 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,662 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2023-09-27T15:28:06,663 creating build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,663 copying iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,664 copying iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,664 copying iotdb/sqlalchemy/IoTDBDialect.py -> build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,665 copying iotdb/sqlalchemy/__init__.py -> build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,666 copying iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/lib/iotdb/sqlalchemy 2023-09-27T15:28:06,666 creating build/lib/iotdb/dbapi/tests 2023-09-27T15:28:06,667 copying iotdb/dbapi/tests/test_connection.py -> build/lib/iotdb/dbapi/tests 2023-09-27T15:28:06,667 copying iotdb/dbapi/tests/__init__.py -> build/lib/iotdb/dbapi/tests 2023-09-27T15:28:06,668 copying iotdb/dbapi/tests/test_cursor.py -> build/lib/iotdb/dbapi/tests 2023-09-27T15:28:06,668 creating build/lib/iotdb/tsfile/common 2023-09-27T15:28:06,668 copying iotdb/tsfile/common/__init__.py -> build/lib/iotdb/tsfile/common 2023-09-27T15:28:06,669 creating build/lib/iotdb/tsfile/utils 2023-09-27T15:28:06,669 copying iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/lib/iotdb/tsfile/utils 2023-09-27T15:28:06,669 copying iotdb/tsfile/utils/Pair.py -> build/lib/iotdb/tsfile/utils 2023-09-27T15:28:06,670 copying iotdb/tsfile/utils/__init__.py -> build/lib/iotdb/tsfile/utils 2023-09-27T15:28:06,670 creating build/lib/iotdb/tsfile/common/constant 2023-09-27T15:28:06,671 copying iotdb/tsfile/common/constant/TsFileConstant.py -> build/lib/iotdb/tsfile/common/constant 2023-09-27T15:28:06,671 copying iotdb/tsfile/common/constant/__init__.py -> build/lib/iotdb/tsfile/common/constant 2023-09-27T15:28:06,672 creating build/lib/iotdb/thrift/common 2023-09-27T15:28:06,672 copying iotdb/thrift/common/ttypes.py -> build/lib/iotdb/thrift/common 2023-09-27T15:28:06,672 copying iotdb/thrift/common/constants.py -> build/lib/iotdb/thrift/common 2023-09-27T15:28:06,673 copying iotdb/thrift/common/__init__.py -> build/lib/iotdb/thrift/common 2023-09-27T15:28:06,673 creating build/lib/iotdb/thrift/rpc 2023-09-27T15:28:06,674 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2023-09-27T15:28:06,674 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2023-09-27T15:28:06,674 copying iotdb/thrift/rpc/IClientRPCService.py -> build/lib/iotdb/thrift/rpc 2023-09-27T15:28:06,675 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2023-09-27T15:28:06,675 creating build/lib/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,676 copying iotdb/sqlalchemy/tests/test_dialect.py -> build/lib/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,677 copying iotdb/sqlalchemy/tests/__init__.py -> build/lib/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,677 installing to build/bdist.linux-armv7l/wheel 2023-09-27T15:28:06,678 running install 2023-09-27T15:28:06,678 running install_lib 2023-09-27T15:28:06,683 creating build/bdist.linux-armv7l 2023-09-27T15:28:06,684 creating build/bdist.linux-armv7l/wheel 2023-09-27T15:28:06,685 creating build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,686 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,688 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,690 copying build/lib/tests/test_one_device.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,693 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,695 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,697 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,699 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,701 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,703 copying build/lib/tests/test_template.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,705 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,708 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2023-09-27T15:28:06,711 creating build/bdist.linux-armv7l/wheel/iotdb 2023-09-27T15:28:06,712 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-09-27T15:28:06,713 copying build/lib/iotdb/dbapi/Cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-09-27T15:28:06,717 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-09-27T15:28:06,717 copying build/lib/iotdb/dbapi/tests/test_connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-09-27T15:28:06,719 copying build/lib/iotdb/dbapi/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-09-27T15:28:06,721 copying build/lib/iotdb/dbapi/tests/test_cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-09-27T15:28:06,724 copying build/lib/iotdb/dbapi/Exceptions.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-09-27T15:28:06,727 copying build/lib/iotdb/dbapi/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-09-27T15:28:06,729 copying build/lib/iotdb/dbapi/Connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-09-27T15:28:06,732 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile 2023-09-27T15:28:06,734 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2023-09-27T15:28:06,735 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-09-27T15:28:06,736 copying build/lib/iotdb/tsfile/common/constant/TsFileConstant.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-09-27T15:28:06,738 copying build/lib/iotdb/tsfile/common/constant/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-09-27T15:28:06,740 copying build/lib/iotdb/tsfile/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2023-09-27T15:28:06,742 copying build/lib/iotdb/tsfile/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile 2023-09-27T15:28:06,744 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-09-27T15:28:06,745 copying build/lib/iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-09-27T15:28:06,747 copying build/lib/iotdb/tsfile/utils/Pair.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-09-27T15:28:06,749 copying build/lib/iotdb/tsfile/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-09-27T15:28:06,751 creating build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,752 copying build/lib/iotdb/template/Template.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,754 copying build/lib/iotdb/template/InternalNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,756 copying build/lib/iotdb/template/TemplateQueryType.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,758 copying build/lib/iotdb/template/TemplateNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,760 copying build/lib/iotdb/template/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,762 copying build/lib/iotdb/template/MeasurementNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-09-27T15:28:06,763 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-09-27T15:28:06,767 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-09-27T15:28:06,769 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-09-27T15:28:06,771 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-09-27T15:28:06,772 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-09-27T15:28:06,774 copying build/lib/iotdb/thrift/common/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-09-27T15:28:06,779 copying build/lib/iotdb/thrift/common/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-09-27T15:28:06,780 copying build/lib/iotdb/thrift/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-09-27T15:28:06,782 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-09-27T15:28:06,784 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-09-27T15:28:06,785 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-09-27T15:28:06,793 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-09-27T15:28:06,794 copying build/lib/iotdb/thrift/rpc/IClientRPCService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-09-27T15:28:06,803 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-09-27T15:28:06,805 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,806 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,808 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,809 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,811 copying build/lib/iotdb/utils/IoTDBConnectionException.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,813 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,817 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,819 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,821 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,823 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,825 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-09-27T15:28:06,827 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,828 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,829 copying build/lib/iotdb/sqlalchemy/tests/test_dialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,831 copying build/lib/iotdb/sqlalchemy/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-09-27T15:28:06,833 copying build/lib/iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,835 copying build/lib/iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,836 copying build/lib/iotdb/sqlalchemy/IoTDBDialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,838 copying build/lib/iotdb/sqlalchemy/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,840 copying build/lib/iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-09-27T15:28:06,843 running install_egg_info 2023-09-27T15:28:06,853 running egg_info 2023-09-27T15:28:06,858 writing apache_iotdb.egg-info/PKG-INFO 2023-09-27T15:28:06,861 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-09-27T15:28:06,863 writing entry points to apache_iotdb.egg-info/entry_points.txt 2023-09-27T15:28:06,864 writing requirements to apache_iotdb.egg-info/requires.txt 2023-09-27T15:28:06,865 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-09-27T15:28:06,878 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:06,885 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-09-27T15:28:06,886 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-1.2.0-py3.11.egg-info 2023-09-27T15:28:06,898 running install_scripts 2023-09-27T15:28:06,916 creating build/bdist.linux-armv7l/wheel/apache_iotdb-1.2.0.dist-info/WHEEL 2023-09-27T15:28:06,919 creating '/tmp/pip-wheel-3ybi_6c9/.tmp-4tow_9zh/apache_iotdb-1.2.0-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-09-27T15:28:06,922 adding 'iotdb/IoTDBContainer.py' 2023-09-27T15:28:06,929 adding 'iotdb/Session.py' 2023-09-27T15:28:06,931 adding 'iotdb/__init__.py' 2023-09-27T15:28:06,933 adding 'iotdb/dbapi/Connection.py' 2023-09-27T15:28:06,935 adding 'iotdb/dbapi/Cursor.py' 2023-09-27T15:28:06,936 adding 'iotdb/dbapi/Exceptions.py' 2023-09-27T15:28:06,937 adding 'iotdb/dbapi/__init__.py' 2023-09-27T15:28:06,939 adding 'iotdb/dbapi/tests/__init__.py' 2023-09-27T15:28:06,941 adding 'iotdb/dbapi/tests/test_connection.py' 2023-09-27T15:28:06,942 adding 'iotdb/dbapi/tests/test_cursor.py' 2023-09-27T15:28:06,944 adding 'iotdb/sqlalchemy/IoTDBDialect.py' 2023-09-27T15:28:06,945 adding 'iotdb/sqlalchemy/IoTDBIdentifierPreparer.py' 2023-09-27T15:28:06,947 adding 'iotdb/sqlalchemy/IoTDBSQLCompiler.py' 2023-09-27T15:28:06,948 adding 'iotdb/sqlalchemy/IoTDBTypeCompiler.py' 2023-09-27T15:28:06,950 adding 'iotdb/sqlalchemy/__init__.py' 2023-09-27T15:28:06,951 adding 'iotdb/sqlalchemy/tests/__init__.py' 2023-09-27T15:28:06,953 adding 'iotdb/sqlalchemy/tests/test_dialect.py' 2023-09-27T15:28:06,955 adding 'iotdb/template/InternalNode.py' 2023-09-27T15:28:06,956 adding 'iotdb/template/MeasurementNode.py' 2023-09-27T15:28:06,957 adding 'iotdb/template/Template.py' 2023-09-27T15:28:06,959 adding 'iotdb/template/TemplateNode.py' 2023-09-27T15:28:06,960 adding 'iotdb/template/TemplateQueryType.py' 2023-09-27T15:28:06,961 adding 'iotdb/template/__init__.py' 2023-09-27T15:28:06,963 adding 'iotdb/thrift/__init__.py' 2023-09-27T15:28:06,964 adding 'iotdb/thrift/common/__init__.py' 2023-09-27T15:28:06,966 adding 'iotdb/thrift/common/constants.py' 2023-09-27T15:28:06,970 adding 'iotdb/thrift/common/ttypes.py' 2023-09-27T15:28:06,984 adding 'iotdb/thrift/rpc/IClientRPCService.py' 2023-09-27T15:28:06,989 adding 'iotdb/thrift/rpc/__init__.py' 2023-09-27T15:28:06,990 adding 'iotdb/thrift/rpc/constants.py' 2023-09-27T15:28:07,003 adding 'iotdb/thrift/rpc/ttypes.py' 2023-09-27T15:28:07,007 adding 'iotdb/tsfile/__init__.py' 2023-09-27T15:28:07,008 adding 'iotdb/tsfile/common/__init__.py' 2023-09-27T15:28:07,010 adding 'iotdb/tsfile/common/constant/TsFileConstant.py' 2023-09-27T15:28:07,011 adding 'iotdb/tsfile/common/constant/__init__.py' 2023-09-27T15:28:07,013 adding 'iotdb/tsfile/utils/Pair.py' 2023-09-27T15:28:07,014 adding 'iotdb/tsfile/utils/ReadWriteIOUtils.py' 2023-09-27T15:28:07,015 adding 'iotdb/tsfile/utils/__init__.py' 2023-09-27T15:28:07,017 adding 'iotdb/utils/BitMap.py' 2023-09-27T15:28:07,018 adding 'iotdb/utils/Field.py' 2023-09-27T15:28:07,020 adding 'iotdb/utils/IoTDBConnectionException.py' 2023-09-27T15:28:07,021 adding 'iotdb/utils/IoTDBConstants.py' 2023-09-27T15:28:07,023 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2023-09-27T15:28:07,025 adding 'iotdb/utils/NumpyTablet.py' 2023-09-27T15:28:07,026 adding 'iotdb/utils/RowRecord.py' 2023-09-27T15:28:07,027 adding 'iotdb/utils/SessionDataSet.py' 2023-09-27T15:28:07,029 adding 'iotdb/utils/Tablet.py' 2023-09-27T15:28:07,030 adding 'iotdb/utils/__init__.py' 2023-09-27T15:28:07,032 adding 'tests/__init__.py' 2023-09-27T15:28:07,034 adding 'tests/tablet_performance_comparison.py' 2023-09-27T15:28:07,036 adding 'tests/test_aligned_timeseries.py' 2023-09-27T15:28:07,037 adding 'tests/test_dataframe.py' 2023-09-27T15:28:07,038 adding 'tests/test_delete_data.py' 2023-09-27T15:28:07,040 adding 'tests/test_numpy_tablet.py' 2023-09-27T15:28:07,041 adding 'tests/test_one_device.py' 2023-09-27T15:28:07,043 adding 'tests/test_session.py' 2023-09-27T15:28:07,045 adding 'tests/test_tablet.py' 2023-09-27T15:28:07,046 adding 'tests/test_template.py' 2023-09-27T15:28:07,048 adding 'tests/test_todf.py' 2023-09-27T15:28:07,050 adding 'apache_iotdb-1.2.0.dist-info/METADATA' 2023-09-27T15:28:07,052 adding 'apache_iotdb-1.2.0.dist-info/WHEEL' 2023-09-27T15:28:07,053 adding 'apache_iotdb-1.2.0.dist-info/entry_points.txt' 2023-09-27T15:28:07,053 adding 'apache_iotdb-1.2.0.dist-info/top_level.txt' 2023-09-27T15:28:07,055 adding 'apache_iotdb-1.2.0.dist-info/RECORD' 2023-09-27T15:28:07,058 removing build/bdist.linux-armv7l/wheel 2023-09-27T15:28:07,169 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2023-09-27T15:28:07,175 Created wheel for apache-iotdb: filename=apache_iotdb-1.2.0-py3-none-any.whl size=123637 sha256=e6253fd0619e108f72e54769a1fdec7500f43db062b603e1bed07ebb989698b2 2023-09-27T15:28:07,177 Stored in directory: /tmp/pip-ephem-wheel-cache-vpjwgf1j/wheels/5f/c7/76/745427ced89eadbd48f746c4bc2faaa035f2f2ad6b1e50b362 2023-09-27T15:28:07,193 Successfully built apache-iotdb 2023-09-27T15:28:07,200 Removed build tracker: '/tmp/pip-build-tracker-0nywb_ay'