2024-07-01T03:32:33,013 Created temporary directory: /tmp/pip-build-tracker-693q_2vr 2024-07-01T03:32:33,015 Initialized build tracking at /tmp/pip-build-tracker-693q_2vr 2024-07-01T03:32:33,015 Created build tracker: /tmp/pip-build-tracker-693q_2vr 2024-07-01T03:32:33,015 Entered build tracker: /tmp/pip-build-tracker-693q_2vr 2024-07-01T03:32:33,016 Created temporary directory: /tmp/pip-wheel-xdaknaww 2024-07-01T03:32:33,019 Created temporary directory: /tmp/pip-ephem-wheel-cache-1jauv6go 2024-07-01T03:32:33,041 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-07-01T03:32:33,045 2 location(s) to search for versions of apache-iotdb: 2024-07-01T03:32:33,045 * https://pypi.org/simple/apache-iotdb/ 2024-07-01T03:32:33,045 * https://www.piwheels.org/simple/apache-iotdb/ 2024-07-01T03:32:33,046 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2024-07-01T03:32:33,046 Getting page https://pypi.org/simple/apache-iotdb/ 2024-07-01T03:32:33,048 Found index url https://pypi.org/simple/ 2024-07-01T03:32:33,263 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2024-07-01T03:32:33,277 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 2024-07-01T03:32:33,277 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) 2024-07-01T03:32:33,278 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 2024-07-01T03:32:33,279 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) 2024-07-01T03:32:33,280 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 2024-07-01T03:32:33,281 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) 2024-07-01T03:32:33,282 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 2024-07-01T03:32:33,283 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) 2024-07-01T03:32:33,284 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 2024-07-01T03:32:33,284 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) 2024-07-01T03:32:33,285 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 2024-07-01T03:32:33,286 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) 2024-07-01T03:32:33,287 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 2024-07-01T03:32:33,288 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) 2024-07-01T03:32:33,289 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 2024-07-01T03:32:33,289 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) 2024-07-01T03:32:33,290 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 2024-07-01T03:32:33,291 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) 2024-07-01T03:32:33,292 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 2024-07-01T03:32:33,293 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) 2024-07-01T03:32:33,294 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 2024-07-01T03:32:33,294 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) 2024-07-01T03:32:33,295 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 2024-07-01T03:32:33,296 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) 2024-07-01T03:32:33,297 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 2024-07-01T03:32:33,298 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) 2024-07-01T03:32:33,299 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 2024-07-01T03:32:33,299 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) 2024-07-01T03:32:33,300 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 2024-07-01T03:32:33,301 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) 2024-07-01T03:32:33,302 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 2024-07-01T03:32:33,302 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) 2024-07-01T03:32:33,303 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 2024-07-01T03:32:33,304 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) 2024-07-01T03:32:33,305 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 2024-07-01T03:32:33,305 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) 2024-07-01T03:32:33,306 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 2024-07-01T03:32:33,307 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) 2024-07-01T03:32:33,308 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 2024-07-01T03:32:33,309 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) 2024-07-01T03:32:33,310 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 2024-07-01T03:32:33,310 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) 2024-07-01T03:32:33,312 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 2024-07-01T03:32:33,312 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) 2024-07-01T03:32:33,313 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 2024-07-01T03:32:33,314 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) 2024-07-01T03:32:33,314 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 2024-07-01T03:32:33,315 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) 2024-07-01T03:32:33,316 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 2024-07-01T03:32:33,316 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) 2024-07-01T03:32:33,317 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 2024-07-01T03:32:33,318 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) 2024-07-01T03:32:33,319 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 2024-07-01T03:32:33,320 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) 2024-07-01T03:32:33,321 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 2024-07-01T03:32:33,321 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) 2024-07-01T03:32:33,322 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 2024-07-01T03:32:33,323 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) 2024-07-01T03:32:33,324 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 2024-07-01T03:32:33,325 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) 2024-07-01T03:32:33,325 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 2024-07-01T03:32:33,326 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) 2024-07-01T03:32:33,327 Found link https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.0 2024-07-01T03:32:33,327 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/f3/83/1292d28c772d573c1c2d191a1bcec031c5ee48fc0e0549ab6e0046142519/apache_iotdb-1.3.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-01T03:32:33,328 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/26/90/04aecfda0e2d3c93e53aa00bbb92417391cde2e83f97877a3c9dc5d0d34d/apache_iotdb-1.3.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-01T03:32:33,329 Found link https://files.pythonhosted.org/packages/f1/c0/65f0577b9ac8a25c69937d15666909fe23d5656715feb060270e0c14ee85/apache_iotdb-1.3.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.2 2024-07-01T03:32:33,329 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2024-07-01T03:32:33,330 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2024-07-01T03:32:33,331 Found index url https://www.piwheels.org/simple/ 2024-07-01T03:32:33,497 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2024-07-01T03:32:33,506 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.3.0-py3-none-any.whl#sha256=ca1a253e48a497e1827121b7ceaf6a1bbebfc2add7c7932550384d3c424d4276 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-01T03:32:33,507 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.1-py3-none-any.whl#sha256=23c4b520884e408c124527f709ba7d5c14e606dec0ea24e8a8ff33d2098c849a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-01T03:32:33,508 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.0-py3-none-any.whl#sha256=e6253fd0619e108f72e54769a1fdec7500f43db062b603e1bed07ebb989698b2 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-01T03:32:33,508 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) 2024-07-01T03:32:33,509 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) 2024-07-01T03:32:33,509 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) 2024-07-01T03:32:33,510 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) 2024-07-01T03:32:33,510 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) 2024-07-01T03:32:33,511 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) 2024-07-01T03:32:33,511 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) 2024-07-01T03:32:33,512 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) 2024-07-01T03:32:33,512 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) 2024-07-01T03:32:33,513 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) 2024-07-01T03:32:33,513 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) 2024-07-01T03:32:33,514 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) 2024-07-01T03:32:33,514 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) 2024-07-01T03:32:33,515 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) 2024-07-01T03:32:33,516 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) 2024-07-01T03:32:33,516 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) 2024-07-01T03:32:33,517 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) 2024-07-01T03:32:33,517 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) 2024-07-01T03:32:33,517 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) 2024-07-01T03:32:33,518 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) 2024-07-01T03:32:33,519 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) 2024-07-01T03:32:33,519 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) 2024-07-01T03:32:33,520 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) 2024-07-01T03:32:33,520 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) 2024-07-01T03:32:33,521 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) 2024-07-01T03:32:33,521 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) 2024-07-01T03:32:33,522 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) 2024-07-01T03:32:33,523 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) 2024-07-01T03:32:33,523 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) 2024-07-01T03:32:33,524 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2024-07-01T03:32:33,524 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2024-07-01T03:32:33,548 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2024-07-01T03:32:33,567 Collecting apache-iotdb==1.3.2 2024-07-01T03:32:33,570 Created temporary directory: /tmp/pip-unpack-oi66q71h 2024-07-01T03:32:33,777 Downloading apache_iotdb-1.3.2.tar.gz (89 kB) 2024-07-01T03:32:34,009 Added apache-iotdb==1.3.2 from https://files.pythonhosted.org/packages/f1/c0/65f0577b9ac8a25c69937d15666909fe23d5656715feb060270e0c14ee85/apache_iotdb-1.3.2.tar.gz to build tracker '/tmp/pip-build-tracker-693q_2vr' 2024-07-01T03:32:34,013 Created temporary directory: /tmp/pip-build-env-cw0tz8yk 2024-07-01T03:32:34,019 Installing build dependencies: started 2024-07-01T03:32:34,020 Running command pip subprocess to install build dependencies 2024-07-01T03:32:35,166 Using pip 24.0 from /usr/local/lib/python3.11/dist-packages/pip (python 3.11) 2024-07-01T03:32:35,703 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-07-01T03:32:37,213 Collecting setuptools>=40.8.0 2024-07-01T03:32:37,227 Using cached https://www.piwheels.org/simple/setuptools/setuptools-70.1.1-py3-none-any.whl (883 kB) 2024-07-01T03:32:39,862 Installing collected packages: setuptools 2024-07-01T03:32:42,280 Successfully installed setuptools-70.1.1 2024-07-01T03:32:42,636 [notice] A new release of pip is available: 24.0 -> 24.1 2024-07-01T03:32:42,637 [notice] To update, run: python3 -m pip install --upgrade pip 2024-07-01T03:32:42,904 Installing build dependencies: finished with status 'done' 2024-07-01T03:32:42,907 Getting requirements to build wheel: started 2024-07-01T03:32:42,908 Running command Getting requirements to build wheel 2024-07-01T03:32:43,408 2024-07-01T03:32:43,419 # Apache IoTDB 2024-07-01T03:32:43,420 [![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) 2024-07-01T03:32:43,420 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-01T03:32:43,421 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-01T03:32:43,421 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-01T03:32:43,422 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-01T03:32:43,422 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-01T03:32:43,422 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-01T03:32:43,424 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-01T03:32:43,424 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-01T03:32:43,425 architecture, high performance and rich feature set together with its deep integration with 2024-07-01T03:32:43,425 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-01T03:32:43,426 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-01T03:32:43,427 ## Python Native API 2024-07-01T03:32:43,428 ### Requirements 2024-07-01T03:32:43,429 You have to install thrift (>=0.13) before using the package. 2024-07-01T03:32:43,431 ### How to use (Example) 2024-07-01T03:32:43,432 First, download the latest package: `pip3 install apache-iotdb` 2024-07-01T03:32:43,433 *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!* 2024-07-01T03:32:43,435 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) 2024-07-01T03:32:43,436 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-01T03:32:43,437 (you need to add `import iotdb` in the head of the file) 2024-07-01T03:32:43,438 Or: 2024-07-01T03:32:43,439 ```python 2024-07-01T03:32:43,440 from iotdb.Session import Session 2024-07-01T03:32:43,441 ip = "127.0.0.1" 2024-07-01T03:32:43,441 port_ = "6667" 2024-07-01T03:32:43,442 username_ = "root" 2024-07-01T03:32:43,442 password_ = "root" 2024-07-01T03:32:43,443 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:43,443 session.open(False) 2024-07-01T03:32:43,444 zone = session.get_time_zone() 2024-07-01T03:32:43,445 session.close() 2024-07-01T03:32:43,445 ``` 2024-07-01T03:32:43,446 ### Initialization 2024-07-01T03:32:43,447 * Initialize a Session 2024-07-01T03:32:43,448 ```python 2024-07-01T03:32:43,449 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-01T03:32:43,450 ``` 2024-07-01T03:32:43,451 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-01T03:32:43,453 ```python 2024-07-01T03:32:43,453 session.open(enable_rpc_compression=False) 2024-07-01T03:32:43,454 ``` 2024-07-01T03:32:43,455 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-01T03:32:43,456 * Close a Session 2024-07-01T03:32:43,458 ```python 2024-07-01T03:32:43,458 session.close() 2024-07-01T03:32:43,459 ``` 2024-07-01T03:32:43,460 ### Data Definition Interface (DDL Interface) 2024-07-01T03:32:43,462 #### DATABASE Management 2024-07-01T03:32:43,463 * CREATE DATABASE 2024-07-01T03:32:43,464 ```python 2024-07-01T03:32:43,464 session.set_storage_group(group_name) 2024-07-01T03:32:43,465 ``` 2024-07-01T03:32:43,466 * Delete one or several databases 2024-07-01T03:32:43,467 ```python 2024-07-01T03:32:43,467 session.delete_storage_group(group_name) 2024-07-01T03:32:43,467 session.delete_storage_groups(group_name_lst) 2024-07-01T03:32:43,468 ``` 2024-07-01T03:32:43,468 #### Timeseries Management 2024-07-01T03:32:43,469 * Create one or multiple timeseries 2024-07-01T03:32:43,470 ```python 2024-07-01T03:32:43,470 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-01T03:32:43,471 props=None, tags=None, attributes=None, alias=None) 2024-07-01T03:32:43,472 session.create_multi_time_series( 2024-07-01T03:32:43,472 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-01T03:32:43,473 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-01T03:32:43,473 ) 2024-07-01T03:32:43,474 ``` 2024-07-01T03:32:43,475 * Create aligned timeseries 2024-07-01T03:32:43,476 ```python 2024-07-01T03:32:43,476 session.create_aligned_time_series( 2024-07-01T03:32:43,477 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-01T03:32:43,477 ) 2024-07-01T03:32:43,478 ``` 2024-07-01T03:32:43,478 Attention: Alias of measurements are **not supported** currently. 2024-07-01T03:32:43,479 * Delete one or several timeseries 2024-07-01T03:32:43,480 ```python 2024-07-01T03:32:43,481 session.delete_time_series(paths_list) 2024-07-01T03:32:43,481 ``` 2024-07-01T03:32:43,482 * Check whether the specific timeseries exists 2024-07-01T03:32:43,483 ```python 2024-07-01T03:32:43,484 session.check_time_series_exists(path) 2024-07-01T03:32:43,485 ``` 2024-07-01T03:32:43,486 ### Data Manipulation Interface (DML Interface) 2024-07-01T03:32:43,487 #### Insert 2024-07-01T03:32:43,488 It is recommended to use insertTablet to help improve write efficiency. 2024-07-01T03:32:43,489 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-01T03:32:43,489 * **Better Write Performance** 2024-07-01T03:32:43,490 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-01T03:32:43,492 We have two implementations of Tablet in Python API. 2024-07-01T03:32:43,493 * Normal Tablet 2024-07-01T03:32:43,494 ```python 2024-07-01T03:32:43,495 values_ = [ 2024-07-01T03:32:43,495 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:43,496 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:43,497 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-01T03:32:43,497 [True, 0, 0, 0, 6.25, "test04"], 2024-07-01T03:32:43,498 ] 2024-07-01T03:32:43,498 timestamps_ = [1, 2, 3, 4] 2024-07-01T03:32:43,499 tablet_ = Tablet( 2024-07-01T03:32:43,500 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:43,500 ) 2024-07-01T03:32:43,501 session.insert_tablet(tablet_) 2024-07-01T03:32:43,502 values_ = [ 2024-07-01T03:32:43,502 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:43,503 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:43,504 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-01T03:32:43,504 [True, 0, 0, 0, None, None], 2024-07-01T03:32:43,505 ] 2024-07-01T03:32:43,505 timestamps_ = [16, 17, 18, 19] 2024-07-01T03:32:43,506 tablet_ = Tablet( 2024-07-01T03:32:43,506 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:43,507 ) 2024-07-01T03:32:43,508 session.insert_tablet(tablet_) 2024-07-01T03:32:43,508 ``` 2024-07-01T03:32:43,509 * Numpy Tablet 2024-07-01T03:32:43,510 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-01T03:32:43,511 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-01T03:32:43,512 **Notice** 2024-07-01T03:32:43,513 1. time and value columns in Tablet are ndarray. 2024-07-01T03:32:43,513 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-01T03:32:43,514 (if not, the default dtypes are also ok). 2024-07-01T03:32:43,515 ```python 2024-07-01T03:32:43,515 import numpy as np 2024-07-01T03:32:43,516 data_types_ = [ 2024-07-01T03:32:43,516 TSDataType.BOOLEAN, 2024-07-01T03:32:43,517 TSDataType.INT32, 2024-07-01T03:32:43,517 TSDataType.INT64, 2024-07-01T03:32:43,518 TSDataType.FLOAT, 2024-07-01T03:32:43,518 TSDataType.DOUBLE, 2024-07-01T03:32:43,519 TSDataType.TEXT, 2024-07-01T03:32:43,519 ] 2024-07-01T03:32:43,519 np_values_ = [ 2024-07-01T03:32:43,520 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:43,520 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:43,521 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:43,521 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:43,522 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:43,522 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:43,523 ] 2024-07-01T03:32:43,523 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:43,524 np_tablet_ = NumpyTablet( 2024-07-01T03:32:43,524 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-01T03:32:43,525 ) 2024-07-01T03:32:43,525 session.insert_tablet(np_tablet_) 2024-07-01T03:32:43,526 # insert one numpy tablet with none into the database. 2024-07-01T03:32:43,527 np_values_ = [ 2024-07-01T03:32:43,527 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:43,528 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:43,529 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:43,529 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:43,530 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:43,530 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:43,531 ] 2024-07-01T03:32:43,531 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:43,532 np_bitmaps_ = [] 2024-07-01T03:32:43,532 for i in range(len(measurements_)): 2024-07-01T03:32:43,533 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-01T03:32:43,534 np_bitmaps_[0].mark(0) 2024-07-01T03:32:43,534 np_bitmaps_[1].mark(1) 2024-07-01T03:32:43,535 np_bitmaps_[2].mark(2) 2024-07-01T03:32:43,535 np_bitmaps_[4].mark(3) 2024-07-01T03:32:43,536 np_bitmaps_[5].mark(3) 2024-07-01T03:32:43,536 np_tablet_with_none = NumpyTablet( 2024-07-01T03:32:43,537 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-01T03:32:43,537 ) 2024-07-01T03:32:43,538 session.insert_tablet(np_tablet_with_none) 2024-07-01T03:32:43,538 ``` 2024-07-01T03:32:43,539 * Insert multiple Tablets 2024-07-01T03:32:43,540 ```python 2024-07-01T03:32:43,541 session.insert_tablets(tablet_lst) 2024-07-01T03:32:43,541 ``` 2024-07-01T03:32:43,542 * Insert a Record 2024-07-01T03:32:43,543 ```python 2024-07-01T03:32:43,544 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-01T03:32:43,545 ``` 2024-07-01T03:32:43,546 * Insert multiple Records 2024-07-01T03:32:43,547 ```python 2024-07-01T03:32:43,547 session.insert_records( 2024-07-01T03:32:43,548 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-01T03:32:43,549 ) 2024-07-01T03:32:43,549 ``` 2024-07-01T03:32:43,551 * Insert multiple Records that belong to the same device. 2024-07-01T03:32:43,551 With type info the server has no need to do type inference, which leads a better performance 2024-07-01T03:32:43,553 ```python 2024-07-01T03:32:43,553 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-01T03:32:43,554 ``` 2024-07-01T03:32:43,554 #### Insert with type inference 2024-07-01T03:32:43,555 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. 2024-07-01T03:32:43,556 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-01T03:32:43,557 ```python 2024-07-01T03:32:43,557 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-01T03:32:43,558 ``` 2024-07-01T03:32:43,559 #### Insert of Aligned Timeseries 2024-07-01T03:32:43,559 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-01T03:32:43,560 * insert_aligned_record 2024-07-01T03:32:43,561 * insert_aligned_records 2024-07-01T03:32:43,561 * insert_aligned_records_of_one_device 2024-07-01T03:32:43,562 * insert_aligned_tablet 2024-07-01T03:32:43,562 * insert_aligned_tablets 2024-07-01T03:32:43,564 ### IoTDB-SQL Interface 2024-07-01T03:32:43,565 * Execute query statement 2024-07-01T03:32:43,566 ```python 2024-07-01T03:32:43,566 session.execute_query_statement(sql) 2024-07-01T03:32:43,567 ``` 2024-07-01T03:32:43,568 * Execute non query statement 2024-07-01T03:32:43,569 ```python 2024-07-01T03:32:43,569 session.execute_non_query_statement(sql) 2024-07-01T03:32:43,570 ``` 2024-07-01T03:32:43,571 * Execute statement 2024-07-01T03:32:43,572 ```python 2024-07-01T03:32:43,572 session.execute_statement(sql) 2024-07-01T03:32:43,573 ``` 2024-07-01T03:32:43,574 ### Device Template 2024-07-01T03:32:43,574 #### Create Device Template 2024-07-01T03:32:43,575 The step for creating a metadata template is as follows 2024-07-01T03:32:43,575 1. Create the template class 2024-07-01T03:32:43,576 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-01T03:32:43,576 3. Execute create device template function 2024-07-01T03:32:43,577 ```python 2024-07-01T03:32:43,578 template = Template(name=template_name, share_time=True) 2024-07-01T03:32:43,579 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-01T03:32:43,580 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-01T03:32:43,580 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-01T03:32:43,581 i_node_gps.add_child(m_node_x) 2024-07-01T03:32:43,582 i_node_v.add_child(m_node_x) 2024-07-01T03:32:43,583 template.add_template(i_node_gps) 2024-07-01T03:32:43,583 template.add_template(i_node_v) 2024-07-01T03:32:43,584 template.add_template(m_node_x) 2024-07-01T03:32:43,585 session.create_schema_template(template) 2024-07-01T03:32:43,585 ``` 2024-07-01T03:32:43,586 #### Modify Device Template nodes 2024-07-01T03:32:43,586 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-01T03:32:43,587 * add node in template 2024-07-01T03:32:43,587 ```python 2024-07-01T03:32:43,588 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-01T03:32:43,588 ``` 2024-07-01T03:32:43,589 * delete node in template 2024-07-01T03:32:43,590 ```python 2024-07-01T03:32:43,591 session.delete_node_in_template(template_name, path) 2024-07-01T03:32:43,592 ``` 2024-07-01T03:32:43,594 #### Set Device Template 2024-07-01T03:32:43,595 ```python 2024-07-01T03:32:43,596 session.set_schema_template(template_name, prefix_path) 2024-07-01T03:32:43,597 ``` 2024-07-01T03:32:43,598 #### Uset Device Template 2024-07-01T03:32:43,599 ```python 2024-07-01T03:32:43,599 session.unset_schema_template(template_name, prefix_path) 2024-07-01T03:32:43,600 ``` 2024-07-01T03:32:43,601 #### Show Device Template 2024-07-01T03:32:43,602 * Show all device templates 2024-07-01T03:32:43,603 ```python 2024-07-01T03:32:43,603 session.show_all_templates() 2024-07-01T03:32:43,604 ``` 2024-07-01T03:32:43,605 * Count all nodes in templates 2024-07-01T03:32:43,605 ```python 2024-07-01T03:32:43,606 session.count_measurements_in_template(template_name) 2024-07-01T03:32:43,607 ``` 2024-07-01T03:32:43,608 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-01T03:32:43,609 ```python 2024-07-01T03:32:43,610 session.count_measurements_in_template(template_name, path) 2024-07-01T03:32:43,610 ``` 2024-07-01T03:32:43,612 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-01T03:32:43,613 ```python 2024-07-01T03:32:43,613 session.is_path_exist_in_template(template_name, path) 2024-07-01T03:32:43,614 ``` 2024-07-01T03:32:43,616 * Show nodes under in device template 2024-07-01T03:32:43,617 ```python 2024-07-01T03:32:43,617 session.show_measurements_in_template(template_name) 2024-07-01T03:32:43,618 ``` 2024-07-01T03:32:43,620 * Show the path prefix where a device template is set 2024-07-01T03:32:43,621 ```python 2024-07-01T03:32:43,621 session.show_paths_template_set_on(template_name) 2024-07-01T03:32:43,622 ``` 2024-07-01T03:32:43,624 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-01T03:32:43,625 ```python 2024-07-01T03:32:43,626 session.show_paths_template_using_on(template_name) 2024-07-01T03:32:43,626 ``` 2024-07-01T03:32:43,628 #### Drop Device Template 2024-07-01T03:32:43,629 Delete an existing metadata template,dropping an already set template is not supported 2024-07-01T03:32:43,630 ```python 2024-07-01T03:32:43,631 session.drop_schema_template("template_python") 2024-07-01T03:32:43,632 ``` 2024-07-01T03:32:43,634 ### Pandas Support 2024-07-01T03:32:43,636 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-01T03:32:43,637 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-01T03:32:43,639 Example: 2024-07-01T03:32:43,641 ```python 2024-07-01T03:32:43,642 from iotdb.Session import Session 2024-07-01T03:32:43,644 ip = "127.0.0.1" 2024-07-01T03:32:43,644 port_ = "6667" 2024-07-01T03:32:43,645 username_ = "root" 2024-07-01T03:32:43,646 password_ = "root" 2024-07-01T03:32:43,647 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:43,648 session.open(False) 2024-07-01T03:32:43,649 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-01T03:32:43,650 # Transform to Pandas Dataset 2024-07-01T03:32:43,651 df = result.todf() 2024-07-01T03:32:43,653 session.close() 2024-07-01T03:32:43,655 # Now you can work with the dataframe 2024-07-01T03:32:43,656 df = ... 2024-07-01T03:32:43,657 ``` 2024-07-01T03:32:43,659 ### IoTDB Testcontainer 2024-07-01T03:32:43,661 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. 2024-07-01T03:32:43,663 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-01T03:32:43,663 ```python 2024-07-01T03:32:43,664 class MyTestCase(unittest.TestCase): 2024-07-01T03:32:43,666 def test_something(self): 2024-07-01T03:32:43,667 with IoTDBContainer() as c: 2024-07-01T03:32:43,667 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-01T03:32:43,669 session.open(False) 2024-07-01T03:32:43,669 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-01T03:32:43,670 print(result) 2024-07-01T03:32:43,670 session.close() 2024-07-01T03:32:43,671 ``` 2024-07-01T03:32:43,672 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. 2024-07-01T03:32:43,674 ### IoTDB DBAPI 2024-07-01T03:32:43,675 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-01T03:32:43,676 interface for accessing databases in Python. 2024-07-01T03:32:43,678 #### Examples 2024-07-01T03:32:43,678 + Initialization 2024-07-01T03:32:43,680 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-01T03:32:43,680 ```python 2024-07-01T03:32:43,681 from iotdb.dbapi import connect 2024-07-01T03:32:43,682 ip = "127.0.0.1" 2024-07-01T03:32:43,683 port_ = "6667" 2024-07-01T03:32:43,684 username_ = "root" 2024-07-01T03:32:43,684 password_ = "root" 2024-07-01T03:32:43,685 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-01T03:32:43,686 cursor = conn.cursor() 2024-07-01T03:32:43,687 ``` 2024-07-01T03:32:43,687 + simple SQL statement execution 2024-07-01T03:32:43,688 ```python 2024-07-01T03:32:43,688 cursor.execute("SELECT * FROM root.*") 2024-07-01T03:32:43,689 for row in cursor.fetchall(): 2024-07-01T03:32:43,689 print(row) 2024-07-01T03:32:43,690 ``` 2024-07-01T03:32:43,691 + execute SQL with parameter 2024-07-01T03:32:43,692 IoTDB DBAPI supports pyformat style parameters 2024-07-01T03:32:43,692 ```python 2024-07-01T03:32:43,693 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-01T03:32:43,694 for row in cursor.fetchall(): 2024-07-01T03:32:43,694 print(row) 2024-07-01T03:32:43,694 ``` 2024-07-01T03:32:43,696 + execute SQL with parameter sequences 2024-07-01T03:32:43,696 ```python 2024-07-01T03:32:43,697 seq_of_parameters = [ 2024-07-01T03:32:43,697 {"timestamp": 1, "temperature": 1}, 2024-07-01T03:32:43,698 {"timestamp": 2, "temperature": 2}, 2024-07-01T03:32:43,698 {"timestamp": 3, "temperature": 3}, 2024-07-01T03:32:43,699 {"timestamp": 4, "temperature": 4}, 2024-07-01T03:32:43,700 {"timestamp": 5, "temperature": 5}, 2024-07-01T03:32:43,700 ] 2024-07-01T03:32:43,701 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-01T03:32:43,701 cursor.executemany(sql,seq_of_parameters) 2024-07-01T03:32:43,702 ``` 2024-07-01T03:32:43,703 + close the connection and cursor 2024-07-01T03:32:43,703 ```python 2024-07-01T03:32:43,704 cursor.close() 2024-07-01T03:32:43,704 conn.close() 2024-07-01T03:32:43,705 ``` 2024-07-01T03:32:43,706 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-01T03:32:43,706 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-01T03:32:43,707 This part is still being improved. 2024-07-01T03:32:43,707 Please do not use it in the production environment! 2024-07-01T03:32:43,708 #### Mapping of the metadata 2024-07-01T03:32:43,708 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-01T03:32:43,709 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-01T03:32:43,709 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-01T03:32:43,710 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-01T03:32:43,711 The metadata in the IoTDB are: 2024-07-01T03:32:43,712 1. Database 2024-07-01T03:32:43,713 2. Path 2024-07-01T03:32:43,713 3. Entity 2024-07-01T03:32:43,713 4. Measurement 2024-07-01T03:32:43,714 The metadata in the SQLAlchemy are: 2024-07-01T03:32:43,715 1. Schema 2024-07-01T03:32:43,715 2. Table 2024-07-01T03:32:43,715 3. Column 2024-07-01T03:32:43,716 The mapping relationship between them is: 2024-07-01T03:32:43,717 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-01T03:32:43,717 | -------------------- | ---------------------------------------------- | 2024-07-01T03:32:43,718 | Schema | Database | 2024-07-01T03:32:43,718 | Table | Path ( from database to entity ) + Entity | 2024-07-01T03:32:43,718 | Column | Measurement | 2024-07-01T03:32:43,719 The following figure shows the relationship between the two more intuitively: 2024-07-01T03:32:43,720 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-01T03:32:43,721 #### Data type mapping 2024-07-01T03:32:43,721 | data type in IoTDB | data type in SQLAlchemy | 2024-07-01T03:32:43,722 |--------------------|-------------------------| 2024-07-01T03:32:43,722 | BOOLEAN | Boolean | 2024-07-01T03:32:43,723 | INT32 | Integer | 2024-07-01T03:32:43,723 | INT64 | BigInteger | 2024-07-01T03:32:43,724 | FLOAT | Float | 2024-07-01T03:32:43,724 | DOUBLE | Float | 2024-07-01T03:32:43,725 | TEXT | Text | 2024-07-01T03:32:43,725 | LONG | BigInteger | 2024-07-01T03:32:43,726 #### Example 2024-07-01T03:32:43,727 + execute statement 2024-07-01T03:32:43,728 ```python 2024-07-01T03:32:43,728 from sqlalchemy import create_engine 2024-07-01T03:32:43,729 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:43,729 connect = engine.connect() 2024-07-01T03:32:43,730 result = connect.execute("SELECT ** FROM root") 2024-07-01T03:32:43,730 for row in result.fetchall(): 2024-07-01T03:32:43,731 print(row) 2024-07-01T03:32:43,731 ``` 2024-07-01T03:32:43,732 + ORM (now only simple queries are supported) 2024-07-01T03:32:43,733 ```python 2024-07-01T03:32:43,734 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-01T03:32:43,734 from sqlalchemy.ext.declarative import declarative_base 2024-07-01T03:32:43,735 from sqlalchemy.orm import sessionmaker 2024-07-01T03:32:43,736 metadata = MetaData( 2024-07-01T03:32:43,736 schema='root.factory' 2024-07-01T03:32:43,737 ) 2024-07-01T03:32:43,737 Base = declarative_base(metadata=metadata) 2024-07-01T03:32:43,739 class Device(Base): 2024-07-01T03:32:43,740 __tablename__ = "room2.device1" 2024-07-01T03:32:43,740 Time = Column(BigInteger, primary_key=True) 2024-07-01T03:32:43,741 temperature = Column(Float) 2024-07-01T03:32:43,741 status = Column(Float) 2024-07-01T03:32:43,743 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:43,744 DbSession = sessionmaker(bind=engine) 2024-07-01T03:32:43,744 session = DbSession() 2024-07-01T03:32:43,745 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-01T03:32:43,746 for row in res: 2024-07-01T03:32:43,747 print(row) 2024-07-01T03:32:43,748 ``` 2024-07-01T03:32:43,749 ## Developers 2024-07-01T03:32:43,750 ### Introduction 2024-07-01T03:32:43,752 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. 2024-07-01T03:32:43,754 ### Prerequisites 2024-07-01T03:32:43,756 Python3.7 or later is preferred. 2024-07-01T03:32:43,756 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. 2024-07-01T03:32:43,757 ``` 2024-07-01T03:32:43,757 http://thrift.apache.org/docs/install/ 2024-07-01T03:32:43,758 ``` 2024-07-01T03:32:43,758 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-01T03:32:43,759 ```shell 2024-07-01T03:32:43,759 pip install -r requirements_dev.txt 2024-07-01T03:32:43,760 ``` 2024-07-01T03:32:43,761 ### Compile the thrift library and Debug 2024-07-01T03:32:43,762 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-01T03:32:43,763 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-01T03:32:43,763 This folder is ignored from git and should **never be pushed to git!** 2024-07-01T03:32:43,764 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-01T03:32:43,766 ### Session Client & Example 2024-07-01T03:32:43,767 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. 2024-07-01T03:32:43,768 Or, another simple example: 2024-07-01T03:32:43,769 ```python 2024-07-01T03:32:43,769 from iotdb.Session import Session 2024-07-01T03:32:43,770 ip = "127.0.0.1" 2024-07-01T03:32:43,770 port_ = "6667" 2024-07-01T03:32:43,771 username_ = "root" 2024-07-01T03:32:43,771 password_ = "root" 2024-07-01T03:32:43,772 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:43,772 session.open(False) 2024-07-01T03:32:43,773 zone = session.get_time_zone() 2024-07-01T03:32:43,773 session.close() 2024-07-01T03:32:43,774 ``` 2024-07-01T03:32:43,776 ### Tests 2024-07-01T03:32:43,777 Please add your custom tests in `tests` folder. 2024-07-01T03:32:43,778 To run all defined tests just type `pytest .` in the root folder. 2024-07-01T03:32:43,781 **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). 2024-07-01T03:32:43,783 ### Futher Tools 2024-07-01T03:32:43,784 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-01T03:32:43,785 Both can be run by `black .` or `flake8 .` respectively. 2024-07-01T03:32:43,787 ## Releasing 2024-07-01T03:32:43,788 To do a release just ensure that you have the right set of generated thrift files. 2024-07-01T03:32:43,788 Then run linting and auto-formatting. 2024-07-01T03:32:43,789 Then, ensure that all tests work (via `pytest .`). 2024-07-01T03:32:43,789 Then you are good to go to do a release! 2024-07-01T03:32:43,791 ### Preparing your environment 2024-07-01T03:32:43,792 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-01T03:32:43,794 ### Doing the Release 2024-07-01T03:32:43,795 There is a convenient script `release.sh` to do all steps for a release. 2024-07-01T03:32:43,796 Namely, these are 2024-07-01T03:32:43,797 * Remove all transient directories from last release (if exists) 2024-07-01T03:32:43,797 * (Re-)generate all generated sources via mvn 2024-07-01T03:32:43,798 * Run Linting (flake8) 2024-07-01T03:32:43,798 * Run Tests via pytest 2024-07-01T03:32:43,799 * Build 2024-07-01T03:32:43,800 * Release to pypi 2024-07-01T03:32:43,801 /tmp/pip-build-env-cw0tz8yk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:266: UserWarning: Unknown distribution option: 'website' 2024-07-01T03:32:43,802 warnings.warn(msg) 2024-07-01T03:32:43,803 running egg_info 2024-07-01T03:32:43,804 writing apache_iotdb.egg-info/PKG-INFO 2024-07-01T03:32:43,804 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-07-01T03:32:43,804 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-07-01T03:32:43,805 writing requirements to apache_iotdb.egg-info/requires.txt 2024-07-01T03:32:43,805 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-07-01T03:32:43,805 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:43,806 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:43,806 Getting requirements to build wheel: finished with status 'done' 2024-07-01T03:32:43,810 Created temporary directory: /tmp/pip-modern-metadata-db9ywlt6 2024-07-01T03:32:43,813 Preparing metadata (pyproject.toml): started 2024-07-01T03:32:43,814 Running command Preparing metadata (pyproject.toml) 2024-07-01T03:32:44,297 2024-07-01T03:32:44,308 # Apache IoTDB 2024-07-01T03:32:44,309 [![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) 2024-07-01T03:32:44,310 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-01T03:32:44,311 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-01T03:32:44,311 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-01T03:32:44,312 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-01T03:32:44,313 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-01T03:32:44,313 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-01T03:32:44,315 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-01T03:32:44,315 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-01T03:32:44,316 architecture, high performance and rich feature set together with its deep integration with 2024-07-01T03:32:44,317 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-01T03:32:44,317 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-01T03:32:44,318 ## Python Native API 2024-07-01T03:32:44,320 ### Requirements 2024-07-01T03:32:44,321 You have to install thrift (>=0.13) before using the package. 2024-07-01T03:32:44,324 ### How to use (Example) 2024-07-01T03:32:44,325 First, download the latest package: `pip3 install apache-iotdb` 2024-07-01T03:32:44,327 *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!* 2024-07-01T03:32:44,328 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) 2024-07-01T03:32:44,329 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-01T03:32:44,330 (you need to add `import iotdb` in the head of the file) 2024-07-01T03:32:44,330 Or: 2024-07-01T03:32:44,331 ```python 2024-07-01T03:32:44,332 from iotdb.Session import Session 2024-07-01T03:32:44,333 ip = "127.0.0.1" 2024-07-01T03:32:44,333 port_ = "6667" 2024-07-01T03:32:44,334 username_ = "root" 2024-07-01T03:32:44,334 password_ = "root" 2024-07-01T03:32:44,335 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:44,335 session.open(False) 2024-07-01T03:32:44,336 zone = session.get_time_zone() 2024-07-01T03:32:44,336 session.close() 2024-07-01T03:32:44,337 ``` 2024-07-01T03:32:44,338 ### Initialization 2024-07-01T03:32:44,339 * Initialize a Session 2024-07-01T03:32:44,340 ```python 2024-07-01T03:32:44,340 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-01T03:32:44,341 ``` 2024-07-01T03:32:44,342 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-01T03:32:44,343 ```python 2024-07-01T03:32:44,343 session.open(enable_rpc_compression=False) 2024-07-01T03:32:44,344 ``` 2024-07-01T03:32:44,345 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-01T03:32:44,346 * Close a Session 2024-07-01T03:32:44,348 ```python 2024-07-01T03:32:44,350 session.close() 2024-07-01T03:32:44,351 ``` 2024-07-01T03:32:44,354 ### Data Definition Interface (DDL Interface) 2024-07-01T03:32:44,355 #### DATABASE Management 2024-07-01T03:32:44,357 * CREATE DATABASE 2024-07-01T03:32:44,358 ```python 2024-07-01T03:32:44,358 session.set_storage_group(group_name) 2024-07-01T03:32:44,359 ``` 2024-07-01T03:32:44,360 * Delete one or several databases 2024-07-01T03:32:44,362 ```python 2024-07-01T03:32:44,362 session.delete_storage_group(group_name) 2024-07-01T03:32:44,363 session.delete_storage_groups(group_name_lst) 2024-07-01T03:32:44,363 ``` 2024-07-01T03:32:44,364 #### Timeseries Management 2024-07-01T03:32:44,365 * Create one or multiple timeseries 2024-07-01T03:32:44,366 ```python 2024-07-01T03:32:44,367 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-01T03:32:44,368 props=None, tags=None, attributes=None, alias=None) 2024-07-01T03:32:44,369 session.create_multi_time_series( 2024-07-01T03:32:44,369 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-01T03:32:44,370 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-01T03:32:44,371 ) 2024-07-01T03:32:44,371 ``` 2024-07-01T03:32:44,372 * Create aligned timeseries 2024-07-01T03:32:44,374 ```python 2024-07-01T03:32:44,374 session.create_aligned_time_series( 2024-07-01T03:32:44,375 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-01T03:32:44,375 ) 2024-07-01T03:32:44,376 ``` 2024-07-01T03:32:44,377 Attention: Alias of measurements are **not supported** currently. 2024-07-01T03:32:44,379 * Delete one or several timeseries 2024-07-01T03:32:44,380 ```python 2024-07-01T03:32:44,380 session.delete_time_series(paths_list) 2024-07-01T03:32:44,381 ``` 2024-07-01T03:32:44,383 * Check whether the specific timeseries exists 2024-07-01T03:32:44,384 ```python 2024-07-01T03:32:44,384 session.check_time_series_exists(path) 2024-07-01T03:32:44,385 ``` 2024-07-01T03:32:44,386 ### Data Manipulation Interface (DML Interface) 2024-07-01T03:32:44,388 #### Insert 2024-07-01T03:32:44,389 It is recommended to use insertTablet to help improve write efficiency. 2024-07-01T03:32:44,390 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-01T03:32:44,390 * **Better Write Performance** 2024-07-01T03:32:44,391 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-01T03:32:44,392 We have two implementations of Tablet in Python API. 2024-07-01T03:32:44,393 * Normal Tablet 2024-07-01T03:32:44,394 ```python 2024-07-01T03:32:44,394 values_ = [ 2024-07-01T03:32:44,395 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:44,395 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:44,396 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-01T03:32:44,396 [True, 0, 0, 0, 6.25, "test04"], 2024-07-01T03:32:44,397 ] 2024-07-01T03:32:44,397 timestamps_ = [1, 2, 3, 4] 2024-07-01T03:32:44,397 tablet_ = Tablet( 2024-07-01T03:32:44,398 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:44,398 ) 2024-07-01T03:32:44,399 session.insert_tablet(tablet_) 2024-07-01T03:32:44,400 values_ = [ 2024-07-01T03:32:44,401 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:44,401 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:44,402 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-01T03:32:44,402 [True, 0, 0, 0, None, None], 2024-07-01T03:32:44,402 ] 2024-07-01T03:32:44,403 timestamps_ = [16, 17, 18, 19] 2024-07-01T03:32:44,403 tablet_ = Tablet( 2024-07-01T03:32:44,404 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:44,404 ) 2024-07-01T03:32:44,405 session.insert_tablet(tablet_) 2024-07-01T03:32:44,405 ``` 2024-07-01T03:32:44,406 * Numpy Tablet 2024-07-01T03:32:44,407 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-01T03:32:44,407 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-01T03:32:44,408 **Notice** 2024-07-01T03:32:44,409 1. time and value columns in Tablet are ndarray. 2024-07-01T03:32:44,410 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-01T03:32:44,410 (if not, the default dtypes are also ok). 2024-07-01T03:32:44,411 ```python 2024-07-01T03:32:44,412 import numpy as np 2024-07-01T03:32:44,412 data_types_ = [ 2024-07-01T03:32:44,413 TSDataType.BOOLEAN, 2024-07-01T03:32:44,414 TSDataType.INT32, 2024-07-01T03:32:44,414 TSDataType.INT64, 2024-07-01T03:32:44,415 TSDataType.FLOAT, 2024-07-01T03:32:44,416 TSDataType.DOUBLE, 2024-07-01T03:32:44,416 TSDataType.TEXT, 2024-07-01T03:32:44,417 ] 2024-07-01T03:32:44,417 np_values_ = [ 2024-07-01T03:32:44,418 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:44,419 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:44,419 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:44,420 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:44,420 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:44,421 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:44,421 ] 2024-07-01T03:32:44,422 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:44,423 np_tablet_ = NumpyTablet( 2024-07-01T03:32:44,423 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-01T03:32:44,424 ) 2024-07-01T03:32:44,424 session.insert_tablet(np_tablet_) 2024-07-01T03:32:44,425 # insert one numpy tablet with none into the database. 2024-07-01T03:32:44,426 np_values_ = [ 2024-07-01T03:32:44,426 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:44,427 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:44,428 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:44,429 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:44,429 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:44,429 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:44,430 ] 2024-07-01T03:32:44,430 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:44,431 np_bitmaps_ = [] 2024-07-01T03:32:44,431 for i in range(len(measurements_)): 2024-07-01T03:32:44,432 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-01T03:32:44,432 np_bitmaps_[0].mark(0) 2024-07-01T03:32:44,432 np_bitmaps_[1].mark(1) 2024-07-01T03:32:44,433 np_bitmaps_[2].mark(2) 2024-07-01T03:32:44,433 np_bitmaps_[4].mark(3) 2024-07-01T03:32:44,434 np_bitmaps_[5].mark(3) 2024-07-01T03:32:44,434 np_tablet_with_none = NumpyTablet( 2024-07-01T03:32:44,435 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-01T03:32:44,435 ) 2024-07-01T03:32:44,436 session.insert_tablet(np_tablet_with_none) 2024-07-01T03:32:44,436 ``` 2024-07-01T03:32:44,437 * Insert multiple Tablets 2024-07-01T03:32:44,438 ```python 2024-07-01T03:32:44,439 session.insert_tablets(tablet_lst) 2024-07-01T03:32:44,439 ``` 2024-07-01T03:32:44,440 * Insert a Record 2024-07-01T03:32:44,441 ```python 2024-07-01T03:32:44,442 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-01T03:32:44,442 ``` 2024-07-01T03:32:44,443 * Insert multiple Records 2024-07-01T03:32:44,444 ```python 2024-07-01T03:32:44,445 session.insert_records( 2024-07-01T03:32:44,445 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-01T03:32:44,446 ) 2024-07-01T03:32:44,446 ``` 2024-07-01T03:32:44,447 * Insert multiple Records that belong to the same device. 2024-07-01T03:32:44,448 With type info the server has no need to do type inference, which leads a better performance 2024-07-01T03:32:44,450 ```python 2024-07-01T03:32:44,451 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-01T03:32:44,451 ``` 2024-07-01T03:32:44,452 #### Insert with type inference 2024-07-01T03:32:44,453 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. 2024-07-01T03:32:44,454 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-01T03:32:44,456 ```python 2024-07-01T03:32:44,456 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-01T03:32:44,457 ``` 2024-07-01T03:32:44,458 #### Insert of Aligned Timeseries 2024-07-01T03:32:44,459 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-01T03:32:44,460 * insert_aligned_record 2024-07-01T03:32:44,461 * insert_aligned_records 2024-07-01T03:32:44,461 * insert_aligned_records_of_one_device 2024-07-01T03:32:44,462 * insert_aligned_tablet 2024-07-01T03:32:44,462 * insert_aligned_tablets 2024-07-01T03:32:44,464 ### IoTDB-SQL Interface 2024-07-01T03:32:44,466 * Execute query statement 2024-07-01T03:32:44,467 ```python 2024-07-01T03:32:44,468 session.execute_query_statement(sql) 2024-07-01T03:32:44,468 ``` 2024-07-01T03:32:44,470 * Execute non query statement 2024-07-01T03:32:44,471 ```python 2024-07-01T03:32:44,472 session.execute_non_query_statement(sql) 2024-07-01T03:32:44,473 ``` 2024-07-01T03:32:44,474 * Execute statement 2024-07-01T03:32:44,475 ```python 2024-07-01T03:32:44,475 session.execute_statement(sql) 2024-07-01T03:32:44,475 ``` 2024-07-01T03:32:44,476 ### Device Template 2024-07-01T03:32:44,477 #### Create Device Template 2024-07-01T03:32:44,477 The step for creating a metadata template is as follows 2024-07-01T03:32:44,478 1. Create the template class 2024-07-01T03:32:44,478 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-01T03:32:44,478 3. Execute create device template function 2024-07-01T03:32:44,479 ```python 2024-07-01T03:32:44,480 template = Template(name=template_name, share_time=True) 2024-07-01T03:32:44,481 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-01T03:32:44,481 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-01T03:32:44,482 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-01T03:32:44,483 i_node_gps.add_child(m_node_x) 2024-07-01T03:32:44,483 i_node_v.add_child(m_node_x) 2024-07-01T03:32:44,484 template.add_template(i_node_gps) 2024-07-01T03:32:44,485 template.add_template(i_node_v) 2024-07-01T03:32:44,485 template.add_template(m_node_x) 2024-07-01T03:32:44,486 session.create_schema_template(template) 2024-07-01T03:32:44,486 ``` 2024-07-01T03:32:44,487 #### Modify Device Template nodes 2024-07-01T03:32:44,487 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-01T03:32:44,488 * add node in template 2024-07-01T03:32:44,489 ```python 2024-07-01T03:32:44,489 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-01T03:32:44,490 ``` 2024-07-01T03:32:44,491 * delete node in template 2024-07-01T03:32:44,491 ```python 2024-07-01T03:32:44,492 session.delete_node_in_template(template_name, path) 2024-07-01T03:32:44,493 ``` 2024-07-01T03:32:44,494 #### Set Device Template 2024-07-01T03:32:44,495 ```python 2024-07-01T03:32:44,495 session.set_schema_template(template_name, prefix_path) 2024-07-01T03:32:44,496 ``` 2024-07-01T03:32:44,497 #### Uset Device Template 2024-07-01T03:32:44,497 ```python 2024-07-01T03:32:44,498 session.unset_schema_template(template_name, prefix_path) 2024-07-01T03:32:44,498 ``` 2024-07-01T03:32:44,499 #### Show Device Template 2024-07-01T03:32:44,500 * Show all device templates 2024-07-01T03:32:44,500 ```python 2024-07-01T03:32:44,501 session.show_all_templates() 2024-07-01T03:32:44,501 ``` 2024-07-01T03:32:44,502 * Count all nodes in templates 2024-07-01T03:32:44,502 ```python 2024-07-01T03:32:44,503 session.count_measurements_in_template(template_name) 2024-07-01T03:32:44,503 ``` 2024-07-01T03:32:44,504 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-01T03:32:44,505 ```python 2024-07-01T03:32:44,505 session.count_measurements_in_template(template_name, path) 2024-07-01T03:32:44,506 ``` 2024-07-01T03:32:44,507 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-01T03:32:44,507 ```python 2024-07-01T03:32:44,508 session.is_path_exist_in_template(template_name, path) 2024-07-01T03:32:44,509 ``` 2024-07-01T03:32:44,510 * Show nodes under in device template 2024-07-01T03:32:44,510 ```python 2024-07-01T03:32:44,510 session.show_measurements_in_template(template_name) 2024-07-01T03:32:44,511 ``` 2024-07-01T03:32:44,512 * Show the path prefix where a device template is set 2024-07-01T03:32:44,513 ```python 2024-07-01T03:32:44,513 session.show_paths_template_set_on(template_name) 2024-07-01T03:32:44,514 ``` 2024-07-01T03:32:44,515 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-01T03:32:44,516 ```python 2024-07-01T03:32:44,517 session.show_paths_template_using_on(template_name) 2024-07-01T03:32:44,518 ``` 2024-07-01T03:32:44,520 #### Drop Device Template 2024-07-01T03:32:44,521 Delete an existing metadata template,dropping an already set template is not supported 2024-07-01T03:32:44,522 ```python 2024-07-01T03:32:44,523 session.drop_schema_template("template_python") 2024-07-01T03:32:44,523 ``` 2024-07-01T03:32:44,525 ### Pandas Support 2024-07-01T03:32:44,526 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-01T03:32:44,527 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-01T03:32:44,529 Example: 2024-07-01T03:32:44,530 ```python 2024-07-01T03:32:44,531 from iotdb.Session import Session 2024-07-01T03:32:44,532 ip = "127.0.0.1" 2024-07-01T03:32:44,533 port_ = "6667" 2024-07-01T03:32:44,534 username_ = "root" 2024-07-01T03:32:44,534 password_ = "root" 2024-07-01T03:32:44,535 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:44,536 session.open(False) 2024-07-01T03:32:44,537 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-01T03:32:44,538 # Transform to Pandas Dataset 2024-07-01T03:32:44,539 df = result.todf() 2024-07-01T03:32:44,541 session.close() 2024-07-01T03:32:44,542 # Now you can work with the dataframe 2024-07-01T03:32:44,543 df = ... 2024-07-01T03:32:44,544 ``` 2024-07-01T03:32:44,546 ### IoTDB Testcontainer 2024-07-01T03:32:44,547 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. 2024-07-01T03:32:44,549 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-01T03:32:44,550 ```python 2024-07-01T03:32:44,551 class MyTestCase(unittest.TestCase): 2024-07-01T03:32:44,553 def test_something(self): 2024-07-01T03:32:44,553 with IoTDBContainer() as c: 2024-07-01T03:32:44,554 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-01T03:32:44,555 session.open(False) 2024-07-01T03:32:44,556 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-01T03:32:44,557 print(result) 2024-07-01T03:32:44,558 session.close() 2024-07-01T03:32:44,558 ``` 2024-07-01T03:32:44,560 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. 2024-07-01T03:32:44,562 ### IoTDB DBAPI 2024-07-01T03:32:44,564 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-01T03:32:44,565 interface for accessing databases in Python. 2024-07-01T03:32:44,567 #### Examples 2024-07-01T03:32:44,568 + Initialization 2024-07-01T03:32:44,570 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-01T03:32:44,571 ```python 2024-07-01T03:32:44,572 from iotdb.dbapi import connect 2024-07-01T03:32:44,573 ip = "127.0.0.1" 2024-07-01T03:32:44,574 port_ = "6667" 2024-07-01T03:32:44,575 username_ = "root" 2024-07-01T03:32:44,576 password_ = "root" 2024-07-01T03:32:44,577 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-01T03:32:44,578 cursor = conn.cursor() 2024-07-01T03:32:44,579 ``` 2024-07-01T03:32:44,580 + simple SQL statement execution 2024-07-01T03:32:44,580 ```python 2024-07-01T03:32:44,581 cursor.execute("SELECT * FROM root.*") 2024-07-01T03:32:44,582 for row in cursor.fetchall(): 2024-07-01T03:32:44,583 print(row) 2024-07-01T03:32:44,584 ``` 2024-07-01T03:32:44,586 + execute SQL with parameter 2024-07-01T03:32:44,588 IoTDB DBAPI supports pyformat style parameters 2024-07-01T03:32:44,589 ```python 2024-07-01T03:32:44,590 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-01T03:32:44,590 for row in cursor.fetchall(): 2024-07-01T03:32:44,591 print(row) 2024-07-01T03:32:44,591 ``` 2024-07-01T03:32:44,593 + execute SQL with parameter sequences 2024-07-01T03:32:44,593 ```python 2024-07-01T03:32:44,594 seq_of_parameters = [ 2024-07-01T03:32:44,594 {"timestamp": 1, "temperature": 1}, 2024-07-01T03:32:44,594 {"timestamp": 2, "temperature": 2}, 2024-07-01T03:32:44,595 {"timestamp": 3, "temperature": 3}, 2024-07-01T03:32:44,595 {"timestamp": 4, "temperature": 4}, 2024-07-01T03:32:44,596 {"timestamp": 5, "temperature": 5}, 2024-07-01T03:32:44,597 ] 2024-07-01T03:32:44,597 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-01T03:32:44,598 cursor.executemany(sql,seq_of_parameters) 2024-07-01T03:32:44,598 ``` 2024-07-01T03:32:44,599 + close the connection and cursor 2024-07-01T03:32:44,600 ```python 2024-07-01T03:32:44,600 cursor.close() 2024-07-01T03:32:44,601 conn.close() 2024-07-01T03:32:44,601 ``` 2024-07-01T03:32:44,602 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-01T03:32:44,603 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-01T03:32:44,603 This part is still being improved. 2024-07-01T03:32:44,604 Please do not use it in the production environment! 2024-07-01T03:32:44,605 #### Mapping of the metadata 2024-07-01T03:32:44,605 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-01T03:32:44,606 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-01T03:32:44,606 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-01T03:32:44,607 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-01T03:32:44,608 The metadata in the IoTDB are: 2024-07-01T03:32:44,610 1. Database 2024-07-01T03:32:44,611 2. Path 2024-07-01T03:32:44,612 3. Entity 2024-07-01T03:32:44,613 4. Measurement 2024-07-01T03:32:44,614 The metadata in the SQLAlchemy are: 2024-07-01T03:32:44,615 1. Schema 2024-07-01T03:32:44,616 2. Table 2024-07-01T03:32:44,617 3. Column 2024-07-01T03:32:44,618 The mapping relationship between them is: 2024-07-01T03:32:44,620 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-01T03:32:44,620 | -------------------- | ---------------------------------------------- | 2024-07-01T03:32:44,621 | Schema | Database | 2024-07-01T03:32:44,622 | Table | Path ( from database to entity ) + Entity | 2024-07-01T03:32:44,623 | Column | Measurement | 2024-07-01T03:32:44,625 The following figure shows the relationship between the two more intuitively: 2024-07-01T03:32:44,626 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-01T03:32:44,627 #### Data type mapping 2024-07-01T03:32:44,627 | data type in IoTDB | data type in SQLAlchemy | 2024-07-01T03:32:44,628 |--------------------|-------------------------| 2024-07-01T03:32:44,628 | BOOLEAN | Boolean | 2024-07-01T03:32:44,629 | INT32 | Integer | 2024-07-01T03:32:44,629 | INT64 | BigInteger | 2024-07-01T03:32:44,630 | FLOAT | Float | 2024-07-01T03:32:44,630 | DOUBLE | Float | 2024-07-01T03:32:44,631 | TEXT | Text | 2024-07-01T03:32:44,631 | LONG | BigInteger | 2024-07-01T03:32:44,632 #### Example 2024-07-01T03:32:44,633 + execute statement 2024-07-01T03:32:44,634 ```python 2024-07-01T03:32:44,634 from sqlalchemy import create_engine 2024-07-01T03:32:44,635 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:44,635 connect = engine.connect() 2024-07-01T03:32:44,635 result = connect.execute("SELECT ** FROM root") 2024-07-01T03:32:44,636 for row in result.fetchall(): 2024-07-01T03:32:44,636 print(row) 2024-07-01T03:32:44,636 ``` 2024-07-01T03:32:44,637 + ORM (now only simple queries are supported) 2024-07-01T03:32:44,638 ```python 2024-07-01T03:32:44,638 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-01T03:32:44,639 from sqlalchemy.ext.declarative import declarative_base 2024-07-01T03:32:44,639 from sqlalchemy.orm import sessionmaker 2024-07-01T03:32:44,640 metadata = MetaData( 2024-07-01T03:32:44,640 schema='root.factory' 2024-07-01T03:32:44,640 ) 2024-07-01T03:32:44,641 Base = declarative_base(metadata=metadata) 2024-07-01T03:32:44,642 class Device(Base): 2024-07-01T03:32:44,642 __tablename__ = "room2.device1" 2024-07-01T03:32:44,642 Time = Column(BigInteger, primary_key=True) 2024-07-01T03:32:44,643 temperature = Column(Float) 2024-07-01T03:32:44,643 status = Column(Float) 2024-07-01T03:32:44,644 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:44,645 DbSession = sessionmaker(bind=engine) 2024-07-01T03:32:44,646 session = DbSession() 2024-07-01T03:32:44,646 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-01T03:32:44,647 for row in res: 2024-07-01T03:32:44,647 print(row) 2024-07-01T03:32:44,648 ``` 2024-07-01T03:32:44,649 ## Developers 2024-07-01T03:32:44,650 ### Introduction 2024-07-01T03:32:44,651 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. 2024-07-01T03:32:44,653 ### Prerequisites 2024-07-01T03:32:44,654 Python3.7 or later is preferred. 2024-07-01T03:32:44,655 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. 2024-07-01T03:32:44,656 ``` 2024-07-01T03:32:44,657 http://thrift.apache.org/docs/install/ 2024-07-01T03:32:44,657 ``` 2024-07-01T03:32:44,658 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-01T03:32:44,659 ```shell 2024-07-01T03:32:44,660 pip install -r requirements_dev.txt 2024-07-01T03:32:44,660 ``` 2024-07-01T03:32:44,662 ### Compile the thrift library and Debug 2024-07-01T03:32:44,663 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-01T03:32:44,664 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-01T03:32:44,665 This folder is ignored from git and should **never be pushed to git!** 2024-07-01T03:32:44,666 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-01T03:32:44,668 ### Session Client & Example 2024-07-01T03:32:44,669 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. 2024-07-01T03:32:44,670 Or, another simple example: 2024-07-01T03:32:44,671 ```python 2024-07-01T03:32:44,672 from iotdb.Session import Session 2024-07-01T03:32:44,673 ip = "127.0.0.1" 2024-07-01T03:32:44,674 port_ = "6667" 2024-07-01T03:32:44,674 username_ = "root" 2024-07-01T03:32:44,675 password_ = "root" 2024-07-01T03:32:44,675 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:44,676 session.open(False) 2024-07-01T03:32:44,676 zone = session.get_time_zone() 2024-07-01T03:32:44,677 session.close() 2024-07-01T03:32:44,678 ``` 2024-07-01T03:32:44,679 ### Tests 2024-07-01T03:32:44,680 Please add your custom tests in `tests` folder. 2024-07-01T03:32:44,681 To run all defined tests just type `pytest .` in the root folder. 2024-07-01T03:32:44,681 **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). 2024-07-01T03:32:44,683 ### Futher Tools 2024-07-01T03:32:44,683 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-01T03:32:44,684 Both can be run by `black .` or `flake8 .` respectively. 2024-07-01T03:32:44,685 ## Releasing 2024-07-01T03:32:44,686 To do a release just ensure that you have the right set of generated thrift files. 2024-07-01T03:32:44,686 Then run linting and auto-formatting. 2024-07-01T03:32:44,687 Then, ensure that all tests work (via `pytest .`). 2024-07-01T03:32:44,687 Then you are good to go to do a release! 2024-07-01T03:32:44,689 ### Preparing your environment 2024-07-01T03:32:44,690 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-01T03:32:44,691 ### Doing the Release 2024-07-01T03:32:44,692 There is a convenient script `release.sh` to do all steps for a release. 2024-07-01T03:32:44,692 Namely, these are 2024-07-01T03:32:44,693 * Remove all transient directories from last release (if exists) 2024-07-01T03:32:44,693 * (Re-)generate all generated sources via mvn 2024-07-01T03:32:44,694 * Run Linting (flake8) 2024-07-01T03:32:44,694 * Run Tests via pytest 2024-07-01T03:32:44,695 * Build 2024-07-01T03:32:44,695 * Release to pypi 2024-07-01T03:32:44,696 /tmp/pip-build-env-cw0tz8yk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:266: UserWarning: Unknown distribution option: 'website' 2024-07-01T03:32:44,697 warnings.warn(msg) 2024-07-01T03:32:44,698 running dist_info 2024-07-01T03:32:44,698 creating /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info 2024-07-01T03:32:44,699 writing /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/PKG-INFO 2024-07-01T03:32:44,699 writing dependency_links to /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/dependency_links.txt 2024-07-01T03:32:44,700 writing entry points to /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/entry_points.txt 2024-07-01T03:32:44,700 writing requirements to /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/requires.txt 2024-07-01T03:32:44,701 writing top-level names to /tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/top_level.txt 2024-07-01T03:32:44,701 writing manifest file '/tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:44,702 reading manifest file '/tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:44,702 writing manifest file '/tmp/pip-modern-metadata-db9ywlt6/apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:44,703 creating '/tmp/pip-modern-metadata-db9ywlt6/apache_iotdb-1.3.2.dist-info' 2024-07-01T03:32:44,704 Preparing metadata (pyproject.toml): finished with status 'done' 2024-07-01T03:32:44,710 Source in /tmp/pip-wheel-xdaknaww/apache-iotdb_5f600e5c4bd040558d8db889bb08c287 has version 1.3.2, which satisfies requirement apache-iotdb==1.3.2 from https://files.pythonhosted.org/packages/f1/c0/65f0577b9ac8a25c69937d15666909fe23d5656715feb060270e0c14ee85/apache_iotdb-1.3.2.tar.gz 2024-07-01T03:32:44,712 Removed apache-iotdb==1.3.2 from https://files.pythonhosted.org/packages/f1/c0/65f0577b9ac8a25c69937d15666909fe23d5656715feb060270e0c14ee85/apache_iotdb-1.3.2.tar.gz from build tracker '/tmp/pip-build-tracker-693q_2vr' 2024-07-01T03:32:44,720 Created temporary directory: /tmp/pip-unpack-fmkulp3t 2024-07-01T03:32:44,721 Created temporary directory: /tmp/pip-unpack-fcghy_yz 2024-07-01T03:32:44,732 Building wheels for collected packages: apache-iotdb 2024-07-01T03:32:44,737 Created temporary directory: /tmp/pip-wheel-4omul4lc 2024-07-01T03:32:44,737 Destination directory: /tmp/pip-wheel-4omul4lc 2024-07-01T03:32:44,740 Building wheel for apache-iotdb (pyproject.toml): started 2024-07-01T03:32:44,741 Running command Building wheel for apache-iotdb (pyproject.toml) 2024-07-01T03:32:45,244 2024-07-01T03:32:45,253 # Apache IoTDB 2024-07-01T03:32:45,254 [![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) 2024-07-01T03:32:45,255 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-01T03:32:45,255 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-01T03:32:45,256 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-01T03:32:45,257 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-01T03:32:45,257 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-01T03:32:45,258 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-01T03:32:45,260 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-01T03:32:45,261 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-01T03:32:45,262 architecture, high performance and rich feature set together with its deep integration with 2024-07-01T03:32:45,262 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-01T03:32:45,263 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-01T03:32:45,264 ## Python Native API 2024-07-01T03:32:45,265 ### Requirements 2024-07-01T03:32:45,266 You have to install thrift (>=0.13) before using the package. 2024-07-01T03:32:45,269 ### How to use (Example) 2024-07-01T03:32:45,270 First, download the latest package: `pip3 install apache-iotdb` 2024-07-01T03:32:45,271 *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!* 2024-07-01T03:32:45,272 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) 2024-07-01T03:32:45,274 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-01T03:32:45,275 (you need to add `import iotdb` in the head of the file) 2024-07-01T03:32:45,276 Or: 2024-07-01T03:32:45,277 ```python 2024-07-01T03:32:45,277 from iotdb.Session import Session 2024-07-01T03:32:45,278 ip = "127.0.0.1" 2024-07-01T03:32:45,279 port_ = "6667" 2024-07-01T03:32:45,279 username_ = "root" 2024-07-01T03:32:45,280 password_ = "root" 2024-07-01T03:32:45,280 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:45,281 session.open(False) 2024-07-01T03:32:45,281 zone = session.get_time_zone() 2024-07-01T03:32:45,281 session.close() 2024-07-01T03:32:45,282 ``` 2024-07-01T03:32:45,283 ### Initialization 2024-07-01T03:32:45,284 * Initialize a Session 2024-07-01T03:32:45,285 ```python 2024-07-01T03:32:45,286 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-01T03:32:45,286 ``` 2024-07-01T03:32:45,287 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-01T03:32:45,288 ```python 2024-07-01T03:32:45,288 session.open(enable_rpc_compression=False) 2024-07-01T03:32:45,289 ``` 2024-07-01T03:32:45,290 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-01T03:32:45,291 * Close a Session 2024-07-01T03:32:45,292 ```python 2024-07-01T03:32:45,292 session.close() 2024-07-01T03:32:45,293 ``` 2024-07-01T03:32:45,294 ### Data Definition Interface (DDL Interface) 2024-07-01T03:32:45,295 #### DATABASE Management 2024-07-01T03:32:45,296 * CREATE DATABASE 2024-07-01T03:32:45,297 ```python 2024-07-01T03:32:45,297 session.set_storage_group(group_name) 2024-07-01T03:32:45,298 ``` 2024-07-01T03:32:45,299 * Delete one or several databases 2024-07-01T03:32:45,300 ```python 2024-07-01T03:32:45,301 session.delete_storage_group(group_name) 2024-07-01T03:32:45,301 session.delete_storage_groups(group_name_lst) 2024-07-01T03:32:45,302 ``` 2024-07-01T03:32:45,303 #### Timeseries Management 2024-07-01T03:32:45,304 * Create one or multiple timeseries 2024-07-01T03:32:45,305 ```python 2024-07-01T03:32:45,305 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-01T03:32:45,306 props=None, tags=None, attributes=None, alias=None) 2024-07-01T03:32:45,307 session.create_multi_time_series( 2024-07-01T03:32:45,308 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-01T03:32:45,308 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-01T03:32:45,309 ) 2024-07-01T03:32:45,310 ``` 2024-07-01T03:32:45,311 * Create aligned timeseries 2024-07-01T03:32:45,312 ```python 2024-07-01T03:32:45,313 session.create_aligned_time_series( 2024-07-01T03:32:45,313 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-01T03:32:45,314 ) 2024-07-01T03:32:45,315 ``` 2024-07-01T03:32:45,316 Attention: Alias of measurements are **not supported** currently. 2024-07-01T03:32:45,317 * Delete one or several timeseries 2024-07-01T03:32:45,318 ```python 2024-07-01T03:32:45,319 session.delete_time_series(paths_list) 2024-07-01T03:32:45,319 ``` 2024-07-01T03:32:45,320 * Check whether the specific timeseries exists 2024-07-01T03:32:45,322 ```python 2024-07-01T03:32:45,322 session.check_time_series_exists(path) 2024-07-01T03:32:45,323 ``` 2024-07-01T03:32:45,324 ### Data Manipulation Interface (DML Interface) 2024-07-01T03:32:45,326 #### Insert 2024-07-01T03:32:45,327 It is recommended to use insertTablet to help improve write efficiency. 2024-07-01T03:32:45,328 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-01T03:32:45,329 * **Better Write Performance** 2024-07-01T03:32:45,330 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-01T03:32:45,332 We have two implementations of Tablet in Python API. 2024-07-01T03:32:45,333 * Normal Tablet 2024-07-01T03:32:45,334 ```python 2024-07-01T03:32:45,335 values_ = [ 2024-07-01T03:32:45,335 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:45,336 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:45,336 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-01T03:32:45,337 [True, 0, 0, 0, 6.25, "test04"], 2024-07-01T03:32:45,337 ] 2024-07-01T03:32:45,338 timestamps_ = [1, 2, 3, 4] 2024-07-01T03:32:45,338 tablet_ = Tablet( 2024-07-01T03:32:45,339 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:45,339 ) 2024-07-01T03:32:45,340 session.insert_tablet(tablet_) 2024-07-01T03:32:45,341 values_ = [ 2024-07-01T03:32:45,341 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-01T03:32:45,342 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-01T03:32:45,342 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-01T03:32:45,343 [True, 0, 0, 0, None, None], 2024-07-01T03:32:45,343 ] 2024-07-01T03:32:45,344 timestamps_ = [16, 17, 18, 19] 2024-07-01T03:32:45,345 tablet_ = Tablet( 2024-07-01T03:32:45,345 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-01T03:32:45,346 ) 2024-07-01T03:32:45,346 session.insert_tablet(tablet_) 2024-07-01T03:32:45,347 ``` 2024-07-01T03:32:45,347 * Numpy Tablet 2024-07-01T03:32:45,348 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-01T03:32:45,349 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-01T03:32:45,350 **Notice** 2024-07-01T03:32:45,351 1. time and value columns in Tablet are ndarray. 2024-07-01T03:32:45,351 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-01T03:32:45,352 (if not, the default dtypes are also ok). 2024-07-01T03:32:45,353 ```python 2024-07-01T03:32:45,354 import numpy as np 2024-07-01T03:32:45,355 data_types_ = [ 2024-07-01T03:32:45,355 TSDataType.BOOLEAN, 2024-07-01T03:32:45,356 TSDataType.INT32, 2024-07-01T03:32:45,356 TSDataType.INT64, 2024-07-01T03:32:45,357 TSDataType.FLOAT, 2024-07-01T03:32:45,357 TSDataType.DOUBLE, 2024-07-01T03:32:45,358 TSDataType.TEXT, 2024-07-01T03:32:45,359 ] 2024-07-01T03:32:45,359 np_values_ = [ 2024-07-01T03:32:45,360 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:45,360 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:45,361 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:45,362 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:45,362 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:45,363 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:45,364 ] 2024-07-01T03:32:45,364 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:45,365 np_tablet_ = NumpyTablet( 2024-07-01T03:32:45,366 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-01T03:32:45,366 ) 2024-07-01T03:32:45,367 session.insert_tablet(np_tablet_) 2024-07-01T03:32:45,368 # insert one numpy tablet with none into the database. 2024-07-01T03:32:45,368 np_values_ = [ 2024-07-01T03:32:45,369 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-01T03:32:45,369 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-01T03:32:45,370 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-01T03:32:45,371 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-01T03:32:45,371 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-01T03:32:45,372 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-01T03:32:45,372 ] 2024-07-01T03:32:45,373 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-01T03:32:45,374 np_bitmaps_ = [] 2024-07-01T03:32:45,374 for i in range(len(measurements_)): 2024-07-01T03:32:45,375 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-01T03:32:45,375 np_bitmaps_[0].mark(0) 2024-07-01T03:32:45,376 np_bitmaps_[1].mark(1) 2024-07-01T03:32:45,376 np_bitmaps_[2].mark(2) 2024-07-01T03:32:45,377 np_bitmaps_[4].mark(3) 2024-07-01T03:32:45,377 np_bitmaps_[5].mark(3) 2024-07-01T03:32:45,378 np_tablet_with_none = NumpyTablet( 2024-07-01T03:32:45,378 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-01T03:32:45,379 ) 2024-07-01T03:32:45,379 session.insert_tablet(np_tablet_with_none) 2024-07-01T03:32:45,380 ``` 2024-07-01T03:32:45,381 * Insert multiple Tablets 2024-07-01T03:32:45,382 ```python 2024-07-01T03:32:45,382 session.insert_tablets(tablet_lst) 2024-07-01T03:32:45,383 ``` 2024-07-01T03:32:45,383 * Insert a Record 2024-07-01T03:32:45,384 ```python 2024-07-01T03:32:45,385 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-01T03:32:45,385 ``` 2024-07-01T03:32:45,386 * Insert multiple Records 2024-07-01T03:32:45,387 ```python 2024-07-01T03:32:45,388 session.insert_records( 2024-07-01T03:32:45,388 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-01T03:32:45,389 ) 2024-07-01T03:32:45,389 ``` 2024-07-01T03:32:45,390 * Insert multiple Records that belong to the same device. 2024-07-01T03:32:45,391 With type info the server has no need to do type inference, which leads a better performance 2024-07-01T03:32:45,393 ```python 2024-07-01T03:32:45,393 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-01T03:32:45,394 ``` 2024-07-01T03:32:45,395 #### Insert with type inference 2024-07-01T03:32:45,396 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. 2024-07-01T03:32:45,397 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-01T03:32:45,398 ```python 2024-07-01T03:32:45,398 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-01T03:32:45,399 ``` 2024-07-01T03:32:45,400 #### Insert of Aligned Timeseries 2024-07-01T03:32:45,401 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-01T03:32:45,402 * insert_aligned_record 2024-07-01T03:32:45,403 * insert_aligned_records 2024-07-01T03:32:45,403 * insert_aligned_records_of_one_device 2024-07-01T03:32:45,404 * insert_aligned_tablet 2024-07-01T03:32:45,404 * insert_aligned_tablets 2024-07-01T03:32:45,406 ### IoTDB-SQL Interface 2024-07-01T03:32:45,407 * Execute query statement 2024-07-01T03:32:45,409 ```python 2024-07-01T03:32:45,409 session.execute_query_statement(sql) 2024-07-01T03:32:45,410 ``` 2024-07-01T03:32:45,411 * Execute non query statement 2024-07-01T03:32:45,412 ```python 2024-07-01T03:32:45,413 session.execute_non_query_statement(sql) 2024-07-01T03:32:45,414 ``` 2024-07-01T03:32:45,415 * Execute statement 2024-07-01T03:32:45,416 ```python 2024-07-01T03:32:45,417 session.execute_statement(sql) 2024-07-01T03:32:45,417 ``` 2024-07-01T03:32:45,419 ### Device Template 2024-07-01T03:32:45,419 #### Create Device Template 2024-07-01T03:32:45,420 The step for creating a metadata template is as follows 2024-07-01T03:32:45,420 1. Create the template class 2024-07-01T03:32:45,421 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-01T03:32:45,421 3. Execute create device template function 2024-07-01T03:32:45,423 ```python 2024-07-01T03:32:45,423 template = Template(name=template_name, share_time=True) 2024-07-01T03:32:45,424 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-01T03:32:45,425 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-01T03:32:45,425 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-01T03:32:45,426 i_node_gps.add_child(m_node_x) 2024-07-01T03:32:45,426 i_node_v.add_child(m_node_x) 2024-07-01T03:32:45,427 template.add_template(i_node_gps) 2024-07-01T03:32:45,428 template.add_template(i_node_v) 2024-07-01T03:32:45,428 template.add_template(m_node_x) 2024-07-01T03:32:45,429 session.create_schema_template(template) 2024-07-01T03:32:45,430 ``` 2024-07-01T03:32:45,430 #### Modify Device Template nodes 2024-07-01T03:32:45,431 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-01T03:32:45,431 * add node in template 2024-07-01T03:32:45,432 ```python 2024-07-01T03:32:45,432 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-01T03:32:45,433 ``` 2024-07-01T03:32:45,434 * delete node in template 2024-07-01T03:32:45,434 ```python 2024-07-01T03:32:45,434 session.delete_node_in_template(template_name, path) 2024-07-01T03:32:45,435 ``` 2024-07-01T03:32:45,436 #### Set Device Template 2024-07-01T03:32:45,436 ```python 2024-07-01T03:32:45,437 session.set_schema_template(template_name, prefix_path) 2024-07-01T03:32:45,437 ``` 2024-07-01T03:32:45,439 #### Uset Device Template 2024-07-01T03:32:45,439 ```python 2024-07-01T03:32:45,440 session.unset_schema_template(template_name, prefix_path) 2024-07-01T03:32:45,441 ``` 2024-07-01T03:32:45,442 #### Show Device Template 2024-07-01T03:32:45,442 * Show all device templates 2024-07-01T03:32:45,443 ```python 2024-07-01T03:32:45,443 session.show_all_templates() 2024-07-01T03:32:45,444 ``` 2024-07-01T03:32:45,444 * Count all nodes in templates 2024-07-01T03:32:45,445 ```python 2024-07-01T03:32:45,445 session.count_measurements_in_template(template_name) 2024-07-01T03:32:45,446 ``` 2024-07-01T03:32:45,447 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-01T03:32:45,447 ```python 2024-07-01T03:32:45,448 session.count_measurements_in_template(template_name, path) 2024-07-01T03:32:45,448 ``` 2024-07-01T03:32:45,450 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-01T03:32:45,450 ```python 2024-07-01T03:32:45,451 session.is_path_exist_in_template(template_name, path) 2024-07-01T03:32:45,451 ``` 2024-07-01T03:32:45,452 * Show nodes under in device template 2024-07-01T03:32:45,453 ```python 2024-07-01T03:32:45,453 session.show_measurements_in_template(template_name) 2024-07-01T03:32:45,454 ``` 2024-07-01T03:32:45,455 * Show the path prefix where a device template is set 2024-07-01T03:32:45,455 ```python 2024-07-01T03:32:45,456 session.show_paths_template_set_on(template_name) 2024-07-01T03:32:45,456 ``` 2024-07-01T03:32:45,458 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-01T03:32:45,458 ```python 2024-07-01T03:32:45,459 session.show_paths_template_using_on(template_name) 2024-07-01T03:32:45,459 ``` 2024-07-01T03:32:45,460 #### Drop Device Template 2024-07-01T03:32:45,461 Delete an existing metadata template,dropping an already set template is not supported 2024-07-01T03:32:45,462 ```python 2024-07-01T03:32:45,462 session.drop_schema_template("template_python") 2024-07-01T03:32:45,463 ``` 2024-07-01T03:32:45,464 ### Pandas Support 2024-07-01T03:32:45,465 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-01T03:32:45,466 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-01T03:32:45,468 Example: 2024-07-01T03:32:45,469 ```python 2024-07-01T03:32:45,469 from iotdb.Session import Session 2024-07-01T03:32:45,470 ip = "127.0.0.1" 2024-07-01T03:32:45,471 port_ = "6667" 2024-07-01T03:32:45,472 username_ = "root" 2024-07-01T03:32:45,473 password_ = "root" 2024-07-01T03:32:45,473 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:45,473 session.open(False) 2024-07-01T03:32:45,474 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-01T03:32:45,475 # Transform to Pandas Dataset 2024-07-01T03:32:45,475 df = result.todf() 2024-07-01T03:32:45,476 session.close() 2024-07-01T03:32:45,477 # Now you can work with the dataframe 2024-07-01T03:32:45,477 df = ... 2024-07-01T03:32:45,478 ``` 2024-07-01T03:32:45,479 ### IoTDB Testcontainer 2024-07-01T03:32:45,480 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. 2024-07-01T03:32:45,481 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-01T03:32:45,482 ```python 2024-07-01T03:32:45,482 class MyTestCase(unittest.TestCase): 2024-07-01T03:32:45,483 def test_something(self): 2024-07-01T03:32:45,483 with IoTDBContainer() as c: 2024-07-01T03:32:45,484 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-01T03:32:45,484 session.open(False) 2024-07-01T03:32:45,485 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-01T03:32:45,485 print(result) 2024-07-01T03:32:45,486 session.close() 2024-07-01T03:32:45,486 ``` 2024-07-01T03:32:45,487 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. 2024-07-01T03:32:45,489 ### IoTDB DBAPI 2024-07-01T03:32:45,490 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-01T03:32:45,490 interface for accessing databases in Python. 2024-07-01T03:32:45,492 #### Examples 2024-07-01T03:32:45,492 + Initialization 2024-07-01T03:32:45,493 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-01T03:32:45,494 ```python 2024-07-01T03:32:45,494 from iotdb.dbapi import connect 2024-07-01T03:32:45,495 ip = "127.0.0.1" 2024-07-01T03:32:45,496 port_ = "6667" 2024-07-01T03:32:45,496 username_ = "root" 2024-07-01T03:32:45,497 password_ = "root" 2024-07-01T03:32:45,497 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-01T03:32:45,498 cursor = conn.cursor() 2024-07-01T03:32:45,498 ``` 2024-07-01T03:32:45,499 + simple SQL statement execution 2024-07-01T03:32:45,499 ```python 2024-07-01T03:32:45,500 cursor.execute("SELECT * FROM root.*") 2024-07-01T03:32:45,500 for row in cursor.fetchall(): 2024-07-01T03:32:45,501 print(row) 2024-07-01T03:32:45,501 ``` 2024-07-01T03:32:45,502 + execute SQL with parameter 2024-07-01T03:32:45,503 IoTDB DBAPI supports pyformat style parameters 2024-07-01T03:32:45,504 ```python 2024-07-01T03:32:45,504 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-01T03:32:45,505 for row in cursor.fetchall(): 2024-07-01T03:32:45,505 print(row) 2024-07-01T03:32:45,506 ``` 2024-07-01T03:32:45,507 + execute SQL with parameter sequences 2024-07-01T03:32:45,507 ```python 2024-07-01T03:32:45,508 seq_of_parameters = [ 2024-07-01T03:32:45,508 {"timestamp": 1, "temperature": 1}, 2024-07-01T03:32:45,509 {"timestamp": 2, "temperature": 2}, 2024-07-01T03:32:45,510 {"timestamp": 3, "temperature": 3}, 2024-07-01T03:32:45,510 {"timestamp": 4, "temperature": 4}, 2024-07-01T03:32:45,510 {"timestamp": 5, "temperature": 5}, 2024-07-01T03:32:45,511 ] 2024-07-01T03:32:45,511 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-01T03:32:45,512 cursor.executemany(sql,seq_of_parameters) 2024-07-01T03:32:45,512 ``` 2024-07-01T03:32:45,513 + close the connection and cursor 2024-07-01T03:32:45,513 ```python 2024-07-01T03:32:45,514 cursor.close() 2024-07-01T03:32:45,514 conn.close() 2024-07-01T03:32:45,515 ``` 2024-07-01T03:32:45,515 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-01T03:32:45,516 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-01T03:32:45,516 This part is still being improved. 2024-07-01T03:32:45,517 Please do not use it in the production environment! 2024-07-01T03:32:45,517 #### Mapping of the metadata 2024-07-01T03:32:45,517 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-01T03:32:45,518 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-01T03:32:45,518 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-01T03:32:45,519 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-01T03:32:45,519 The metadata in the IoTDB are: 2024-07-01T03:32:45,520 1. Database 2024-07-01T03:32:45,521 2. Path 2024-07-01T03:32:45,521 3. Entity 2024-07-01T03:32:45,522 4. Measurement 2024-07-01T03:32:45,523 The metadata in the SQLAlchemy are: 2024-07-01T03:32:45,523 1. Schema 2024-07-01T03:32:45,524 2. Table 2024-07-01T03:32:45,524 3. Column 2024-07-01T03:32:45,525 The mapping relationship between them is: 2024-07-01T03:32:45,526 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-01T03:32:45,527 | -------------------- | ---------------------------------------------- | 2024-07-01T03:32:45,527 | Schema | Database | 2024-07-01T03:32:45,528 | Table | Path ( from database to entity ) + Entity | 2024-07-01T03:32:45,529 | Column | Measurement | 2024-07-01T03:32:45,530 The following figure shows the relationship between the two more intuitively: 2024-07-01T03:32:45,531 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-01T03:32:45,532 #### Data type mapping 2024-07-01T03:32:45,533 | data type in IoTDB | data type in SQLAlchemy | 2024-07-01T03:32:45,534 |--------------------|-------------------------| 2024-07-01T03:32:45,534 | BOOLEAN | Boolean | 2024-07-01T03:32:45,535 | INT32 | Integer | 2024-07-01T03:32:45,535 | INT64 | BigInteger | 2024-07-01T03:32:45,536 | FLOAT | Float | 2024-07-01T03:32:45,536 | DOUBLE | Float | 2024-07-01T03:32:45,537 | TEXT | Text | 2024-07-01T03:32:45,537 | LONG | BigInteger | 2024-07-01T03:32:45,538 #### Example 2024-07-01T03:32:45,539 + execute statement 2024-07-01T03:32:45,540 ```python 2024-07-01T03:32:45,541 from sqlalchemy import create_engine 2024-07-01T03:32:45,542 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:45,543 connect = engine.connect() 2024-07-01T03:32:45,543 result = connect.execute("SELECT ** FROM root") 2024-07-01T03:32:45,544 for row in result.fetchall(): 2024-07-01T03:32:45,545 print(row) 2024-07-01T03:32:45,545 ``` 2024-07-01T03:32:45,547 + ORM (now only simple queries are supported) 2024-07-01T03:32:45,548 ```python 2024-07-01T03:32:45,548 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-01T03:32:45,549 from sqlalchemy.ext.declarative import declarative_base 2024-07-01T03:32:45,549 from sqlalchemy.orm import sessionmaker 2024-07-01T03:32:45,550 metadata = MetaData( 2024-07-01T03:32:45,550 schema='root.factory' 2024-07-01T03:32:45,551 ) 2024-07-01T03:32:45,551 Base = declarative_base(metadata=metadata) 2024-07-01T03:32:45,552 class Device(Base): 2024-07-01T03:32:45,553 __tablename__ = "room2.device1" 2024-07-01T03:32:45,553 Time = Column(BigInteger, primary_key=True) 2024-07-01T03:32:45,554 temperature = Column(Float) 2024-07-01T03:32:45,554 status = Column(Float) 2024-07-01T03:32:45,555 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-01T03:32:45,556 DbSession = sessionmaker(bind=engine) 2024-07-01T03:32:45,556 session = DbSession() 2024-07-01T03:32:45,557 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-01T03:32:45,558 for row in res: 2024-07-01T03:32:45,559 print(row) 2024-07-01T03:32:45,559 ``` 2024-07-01T03:32:45,561 ## Developers 2024-07-01T03:32:45,561 ### Introduction 2024-07-01T03:32:45,562 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. 2024-07-01T03:32:45,564 ### Prerequisites 2024-07-01T03:32:45,565 Python3.7 or later is preferred. 2024-07-01T03:32:45,566 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. 2024-07-01T03:32:45,567 ``` 2024-07-01T03:32:45,567 http://thrift.apache.org/docs/install/ 2024-07-01T03:32:45,568 ``` 2024-07-01T03:32:45,569 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-01T03:32:45,569 ```shell 2024-07-01T03:32:45,570 pip install -r requirements_dev.txt 2024-07-01T03:32:45,570 ``` 2024-07-01T03:32:45,573 ### Compile the thrift library and Debug 2024-07-01T03:32:45,573 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-01T03:32:45,574 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-01T03:32:45,575 This folder is ignored from git and should **never be pushed to git!** 2024-07-01T03:32:45,576 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-01T03:32:45,579 ### Session Client & Example 2024-07-01T03:32:45,580 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. 2024-07-01T03:32:45,581 Or, another simple example: 2024-07-01T03:32:45,582 ```python 2024-07-01T03:32:45,583 from iotdb.Session import Session 2024-07-01T03:32:45,584 ip = "127.0.0.1" 2024-07-01T03:32:45,584 port_ = "6667" 2024-07-01T03:32:45,585 username_ = "root" 2024-07-01T03:32:45,586 password_ = "root" 2024-07-01T03:32:45,586 session = Session(ip, port_, username_, password_) 2024-07-01T03:32:45,587 session.open(False) 2024-07-01T03:32:45,587 zone = session.get_time_zone() 2024-07-01T03:32:45,588 session.close() 2024-07-01T03:32:45,588 ``` 2024-07-01T03:32:45,590 ### Tests 2024-07-01T03:32:45,592 Please add your custom tests in `tests` folder. 2024-07-01T03:32:45,593 To run all defined tests just type `pytest .` in the root folder. 2024-07-01T03:32:45,594 **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). 2024-07-01T03:32:45,596 ### Futher Tools 2024-07-01T03:32:45,597 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-01T03:32:45,597 Both can be run by `black .` or `flake8 .` respectively. 2024-07-01T03:32:45,599 ## Releasing 2024-07-01T03:32:45,600 To do a release just ensure that you have the right set of generated thrift files. 2024-07-01T03:32:45,600 Then run linting and auto-formatting. 2024-07-01T03:32:45,600 Then, ensure that all tests work (via `pytest .`). 2024-07-01T03:32:45,601 Then you are good to go to do a release! 2024-07-01T03:32:45,602 ### Preparing your environment 2024-07-01T03:32:45,603 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-01T03:32:45,605 ### Doing the Release 2024-07-01T03:32:45,606 There is a convenient script `release.sh` to do all steps for a release. 2024-07-01T03:32:45,606 Namely, these are 2024-07-01T03:32:45,607 * Remove all transient directories from last release (if exists) 2024-07-01T03:32:45,607 * (Re-)generate all generated sources via mvn 2024-07-01T03:32:45,607 * Run Linting (flake8) 2024-07-01T03:32:45,608 * Run Tests via pytest 2024-07-01T03:32:45,608 * Build 2024-07-01T03:32:45,609 * Release to pypi 2024-07-01T03:32:45,610 /tmp/pip-build-env-cw0tz8yk/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:266: UserWarning: Unknown distribution option: 'website' 2024-07-01T03:32:45,610 warnings.warn(msg) 2024-07-01T03:32:45,611 running bdist_wheel 2024-07-01T03:32:45,612 running build 2024-07-01T03:32:45,612 running build_py 2024-07-01T03:32:45,613 creating build 2024-07-01T03:32:45,613 creating build/lib 2024-07-01T03:32:45,614 creating build/lib/tests 2024-07-01T03:32:45,614 copying tests/test_numpy_tablet.py -> build/lib/tests 2024-07-01T03:32:45,615 copying tests/test_delete_data.py -> build/lib/tests 2024-07-01T03:32:45,615 copying tests/test_dataframe.py -> build/lib/tests 2024-07-01T03:32:45,616 copying tests/test_session.py -> build/lib/tests 2024-07-01T03:32:45,616 copying tests/test_aligned_timeseries.py -> build/lib/tests 2024-07-01T03:32:45,617 copying tests/__init__.py -> build/lib/tests 2024-07-01T03:32:45,618 copying tests/test_one_device.py -> build/lib/tests 2024-07-01T03:32:45,618 copying tests/test_tablet.py -> build/lib/tests 2024-07-01T03:32:45,619 copying tests/tablet_performance_comparison.py -> build/lib/tests 2024-07-01T03:32:45,619 copying tests/test_session_pool.py -> build/lib/tests 2024-07-01T03:32:45,620 copying tests/test_template.py -> build/lib/tests 2024-07-01T03:32:45,620 copying tests/test_todf.py -> build/lib/tests 2024-07-01T03:32:45,621 creating build/lib/iotdb 2024-07-01T03:32:45,622 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2024-07-01T03:32:45,622 copying iotdb/__init__.py -> build/lib/iotdb 2024-07-01T03:32:45,623 copying iotdb/Session.py -> build/lib/iotdb 2024-07-01T03:32:45,623 copying iotdb/SessionPool.py -> build/lib/iotdb 2024-07-01T03:32:45,624 creating build/lib/iotdb/utils 2024-07-01T03:32:45,624 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,625 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,626 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,626 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,627 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,627 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,628 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,628 copying iotdb/utils/IoTDBConnectionException.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,629 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,629 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2024-07-01T03:32:45,630 creating build/lib/iotdb/template 2024-07-01T03:32:45,631 copying iotdb/template/MeasurementNode.py -> build/lib/iotdb/template 2024-07-01T03:32:45,631 copying iotdb/template/__init__.py -> build/lib/iotdb/template 2024-07-01T03:32:45,631 copying iotdb/template/TemplateNode.py -> build/lib/iotdb/template 2024-07-01T03:32:45,632 copying iotdb/template/TemplateQueryType.py -> build/lib/iotdb/template 2024-07-01T03:32:45,632 copying iotdb/template/Template.py -> build/lib/iotdb/template 2024-07-01T03:32:45,632 copying iotdb/template/InternalNode.py -> build/lib/iotdb/template 2024-07-01T03:32:45,633 creating build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,633 copying iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,634 copying iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,634 copying iotdb/sqlalchemy/__init__.py -> build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,634 copying iotdb/sqlalchemy/IoTDBDialect.py -> build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,635 copying iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/lib/iotdb/sqlalchemy 2024-07-01T03:32:45,635 creating build/lib/iotdb/tsfile 2024-07-01T03:32:45,636 copying iotdb/tsfile/__init__.py -> build/lib/iotdb/tsfile 2024-07-01T03:32:45,636 creating build/lib/iotdb/dbapi 2024-07-01T03:32:45,637 copying iotdb/dbapi/__init__.py -> build/lib/iotdb/dbapi 2024-07-01T03:32:45,637 copying iotdb/dbapi/Connection.py -> build/lib/iotdb/dbapi 2024-07-01T03:32:45,637 copying iotdb/dbapi/Exceptions.py -> build/lib/iotdb/dbapi 2024-07-01T03:32:45,638 copying iotdb/dbapi/Cursor.py -> build/lib/iotdb/dbapi 2024-07-01T03:32:45,638 creating build/lib/iotdb/thrift 2024-07-01T03:32:45,639 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2024-07-01T03:32:45,639 creating build/lib/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,640 copying iotdb/sqlalchemy/tests/test_dialect.py -> build/lib/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,640 copying iotdb/sqlalchemy/tests/__init__.py -> build/lib/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,641 creating build/lib/iotdb/tsfile/utils 2024-07-01T03:32:45,641 copying iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/lib/iotdb/tsfile/utils 2024-07-01T03:32:45,642 copying iotdb/tsfile/utils/Pair.py -> build/lib/iotdb/tsfile/utils 2024-07-01T03:32:45,642 copying iotdb/tsfile/utils/__init__.py -> build/lib/iotdb/tsfile/utils 2024-07-01T03:32:45,643 creating build/lib/iotdb/tsfile/common 2024-07-01T03:32:45,643 copying iotdb/tsfile/common/__init__.py -> build/lib/iotdb/tsfile/common 2024-07-01T03:32:45,644 creating build/lib/iotdb/tsfile/common/constant 2024-07-01T03:32:45,644 copying iotdb/tsfile/common/constant/TsFileConstant.py -> build/lib/iotdb/tsfile/common/constant 2024-07-01T03:32:45,645 copying iotdb/tsfile/common/constant/__init__.py -> build/lib/iotdb/tsfile/common/constant 2024-07-01T03:32:45,645 creating build/lib/iotdb/dbapi/tests 2024-07-01T03:32:45,646 copying iotdb/dbapi/tests/test_connection.py -> build/lib/iotdb/dbapi/tests 2024-07-01T03:32:45,646 copying iotdb/dbapi/tests/__init__.py -> build/lib/iotdb/dbapi/tests 2024-07-01T03:32:45,647 copying iotdb/dbapi/tests/test_cursor.py -> build/lib/iotdb/dbapi/tests 2024-07-01T03:32:45,647 creating build/lib/iotdb/thrift/rpc 2024-07-01T03:32:45,647 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2024-07-01T03:32:45,648 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2024-07-01T03:32:45,648 copying iotdb/thrift/rpc/IClientRPCService.py -> build/lib/iotdb/thrift/rpc 2024-07-01T03:32:45,649 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2024-07-01T03:32:45,649 creating build/lib/iotdb/thrift/common 2024-07-01T03:32:45,650 copying iotdb/thrift/common/__init__.py -> build/lib/iotdb/thrift/common 2024-07-01T03:32:45,650 copying iotdb/thrift/common/constants.py -> build/lib/iotdb/thrift/common 2024-07-01T03:32:45,651 copying iotdb/thrift/common/ttypes.py -> build/lib/iotdb/thrift/common 2024-07-01T03:32:45,652 installing to build/bdist.linux-armv7l/wheel 2024-07-01T03:32:45,653 running install 2024-07-01T03:32:45,653 running install_lib 2024-07-01T03:32:45,654 creating build/bdist.linux-armv7l 2024-07-01T03:32:45,654 creating build/bdist.linux-armv7l/wheel 2024-07-01T03:32:45,654 creating build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,655 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,655 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,656 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,656 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,657 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,657 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,658 copying build/lib/tests/test_one_device.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,658 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,658 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,659 copying build/lib/tests/test_session_pool.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,660 copying build/lib/tests/test_template.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,660 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-01T03:32:45,661 creating build/bdist.linux-armv7l/wheel/iotdb 2024-07-01T03:32:45,662 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-01T03:32:45,664 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,665 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,667 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,669 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,672 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,674 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,676 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,678 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,681 copying build/lib/iotdb/utils/IoTDBConnectionException.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,682 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,684 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-01T03:32:45,687 creating build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,688 copying build/lib/iotdb/template/MeasurementNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,690 copying build/lib/iotdb/template/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,692 copying build/lib/iotdb/template/TemplateNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,694 copying build/lib/iotdb/template/TemplateQueryType.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,696 copying build/lib/iotdb/template/Template.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,698 copying build/lib/iotdb/template/InternalNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-01T03:32:45,699 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-01T03:32:45,701 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-01T03:32:45,705 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,706 copying build/lib/iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,708 copying build/lib/iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,710 copying build/lib/iotdb/sqlalchemy/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,711 copying build/lib/iotdb/sqlalchemy/IoTDBDialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,714 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,715 copying build/lib/iotdb/sqlalchemy/tests/test_dialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,717 copying build/lib/iotdb/sqlalchemy/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-01T03:32:45,719 copying build/lib/iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-01T03:32:45,721 copying build/lib/iotdb/SessionPool.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-01T03:32:45,724 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-07-01T03:32:45,725 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-01T03:32:45,726 copying build/lib/iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-01T03:32:45,728 copying build/lib/iotdb/tsfile/utils/Pair.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-01T03:32:45,730 copying build/lib/iotdb/tsfile/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-01T03:32:45,732 copying build/lib/iotdb/tsfile/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-07-01T03:32:45,734 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-07-01T03:32:45,735 copying build/lib/iotdb/tsfile/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-07-01T03:32:45,737 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-01T03:32:45,738 copying build/lib/iotdb/tsfile/common/constant/TsFileConstant.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-01T03:32:45,740 copying build/lib/iotdb/tsfile/common/constant/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-01T03:32:45,742 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-01T03:32:45,743 copying build/lib/iotdb/dbapi/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-01T03:32:45,745 copying build/lib/iotdb/dbapi/Connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-01T03:32:45,746 copying build/lib/iotdb/dbapi/Exceptions.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-01T03:32:45,749 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-01T03:32:45,750 copying build/lib/iotdb/dbapi/tests/test_connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-01T03:32:45,752 copying build/lib/iotdb/dbapi/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-01T03:32:45,754 copying build/lib/iotdb/dbapi/tests/test_cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-01T03:32:45,755 copying build/lib/iotdb/dbapi/Cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-01T03:32:45,763 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-07-01T03:32:45,765 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-01T03:32:45,766 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-01T03:32:45,768 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-01T03:32:45,769 copying build/lib/iotdb/thrift/rpc/IClientRPCService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-01T03:32:45,778 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-01T03:32:45,785 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-07-01T03:32:45,787 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-01T03:32:45,787 copying build/lib/iotdb/thrift/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-01T03:32:45,789 copying build/lib/iotdb/thrift/common/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-01T03:32:45,791 copying build/lib/iotdb/thrift/common/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-01T03:32:45,795 running install_egg_info 2024-07-01T03:32:45,805 running egg_info 2024-07-01T03:32:45,809 writing apache_iotdb.egg-info/PKG-INFO 2024-07-01T03:32:45,812 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-07-01T03:32:45,814 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-07-01T03:32:45,815 writing requirements to apache_iotdb.egg-info/requires.txt 2024-07-01T03:32:45,816 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-07-01T03:32:45,834 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:45,841 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-01T03:32:45,842 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.2-py3.11.egg-info 2024-07-01T03:32:45,855 running install_scripts 2024-07-01T03:32:45,873 creating build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.2.dist-info/WHEEL 2024-07-01T03:32:45,875 creating '/tmp/pip-wheel-4omul4lc/.tmp-bq2v1vhj/apache_iotdb-1.3.2-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2024-07-01T03:32:45,878 adding 'iotdb/IoTDBContainer.py' 2024-07-01T03:32:45,885 adding 'iotdb/Session.py' 2024-07-01T03:32:45,888 adding 'iotdb/SessionPool.py' 2024-07-01T03:32:45,890 adding 'iotdb/__init__.py' 2024-07-01T03:32:45,893 adding 'iotdb/dbapi/Connection.py' 2024-07-01T03:32:45,895 adding 'iotdb/dbapi/Cursor.py' 2024-07-01T03:32:45,897 adding 'iotdb/dbapi/Exceptions.py' 2024-07-01T03:32:45,899 adding 'iotdb/dbapi/__init__.py' 2024-07-01T03:32:45,901 adding 'iotdb/dbapi/tests/__init__.py' 2024-07-01T03:32:45,904 adding 'iotdb/dbapi/tests/test_connection.py' 2024-07-01T03:32:45,906 adding 'iotdb/dbapi/tests/test_cursor.py' 2024-07-01T03:32:45,908 adding 'iotdb/sqlalchemy/IoTDBDialect.py' 2024-07-01T03:32:45,910 adding 'iotdb/sqlalchemy/IoTDBIdentifierPreparer.py' 2024-07-01T03:32:45,913 adding 'iotdb/sqlalchemy/IoTDBSQLCompiler.py' 2024-07-01T03:32:45,915 adding 'iotdb/sqlalchemy/IoTDBTypeCompiler.py' 2024-07-01T03:32:45,916 adding 'iotdb/sqlalchemy/__init__.py' 2024-07-01T03:32:45,918 adding 'iotdb/sqlalchemy/tests/__init__.py' 2024-07-01T03:32:45,920 adding 'iotdb/sqlalchemy/tests/test_dialect.py' 2024-07-01T03:32:45,923 adding 'iotdb/template/InternalNode.py' 2024-07-01T03:32:45,924 adding 'iotdb/template/MeasurementNode.py' 2024-07-01T03:32:45,926 adding 'iotdb/template/Template.py' 2024-07-01T03:32:45,928 adding 'iotdb/template/TemplateNode.py' 2024-07-01T03:32:45,929 adding 'iotdb/template/TemplateQueryType.py' 2024-07-01T03:32:45,931 adding 'iotdb/template/__init__.py' 2024-07-01T03:32:45,934 adding 'iotdb/thrift/__init__.py' 2024-07-01T03:32:45,936 adding 'iotdb/thrift/common/__init__.py' 2024-07-01T03:32:45,937 adding 'iotdb/thrift/common/constants.py' 2024-07-01T03:32:45,944 adding 'iotdb/thrift/common/ttypes.py' 2024-07-01T03:32:45,966 adding 'iotdb/thrift/rpc/IClientRPCService.py' 2024-07-01T03:32:45,971 adding 'iotdb/thrift/rpc/__init__.py' 2024-07-01T03:32:45,973 adding 'iotdb/thrift/rpc/constants.py' 2024-07-01T03:32:45,990 adding 'iotdb/thrift/rpc/ttypes.py' 2024-07-01T03:32:45,993 adding 'iotdb/tsfile/__init__.py' 2024-07-01T03:32:45,995 adding 'iotdb/tsfile/common/__init__.py' 2024-07-01T03:32:45,997 adding 'iotdb/tsfile/common/constant/TsFileConstant.py' 2024-07-01T03:32:45,998 adding 'iotdb/tsfile/common/constant/__init__.py' 2024-07-01T03:32:46,000 adding 'iotdb/tsfile/utils/Pair.py' 2024-07-01T03:32:46,001 adding 'iotdb/tsfile/utils/ReadWriteIOUtils.py' 2024-07-01T03:32:46,002 adding 'iotdb/tsfile/utils/__init__.py' 2024-07-01T03:32:46,004 adding 'iotdb/utils/BitMap.py' 2024-07-01T03:32:46,005 adding 'iotdb/utils/Field.py' 2024-07-01T03:32:46,006 adding 'iotdb/utils/IoTDBConnectionException.py' 2024-07-01T03:32:46,008 adding 'iotdb/utils/IoTDBConstants.py' 2024-07-01T03:32:46,010 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2024-07-01T03:32:46,011 adding 'iotdb/utils/NumpyTablet.py' 2024-07-01T03:32:46,013 adding 'iotdb/utils/RowRecord.py' 2024-07-01T03:32:46,014 adding 'iotdb/utils/SessionDataSet.py' 2024-07-01T03:32:46,015 adding 'iotdb/utils/Tablet.py' 2024-07-01T03:32:46,017 adding 'iotdb/utils/__init__.py' 2024-07-01T03:32:46,018 adding 'tests/__init__.py' 2024-07-01T03:32:46,020 adding 'tests/tablet_performance_comparison.py' 2024-07-01T03:32:46,022 adding 'tests/test_aligned_timeseries.py' 2024-07-01T03:32:46,023 adding 'tests/test_dataframe.py' 2024-07-01T03:32:46,024 adding 'tests/test_delete_data.py' 2024-07-01T03:32:46,026 adding 'tests/test_numpy_tablet.py' 2024-07-01T03:32:46,027 adding 'tests/test_one_device.py' 2024-07-01T03:32:46,029 adding 'tests/test_session.py' 2024-07-01T03:32:46,030 adding 'tests/test_session_pool.py' 2024-07-01T03:32:46,032 adding 'tests/test_tablet.py' 2024-07-01T03:32:46,033 adding 'tests/test_template.py' 2024-07-01T03:32:46,035 adding 'tests/test_todf.py' 2024-07-01T03:32:46,037 adding 'apache_iotdb-1.3.2.dist-info/METADATA' 2024-07-01T03:32:46,038 adding 'apache_iotdb-1.3.2.dist-info/WHEEL' 2024-07-01T03:32:46,039 adding 'apache_iotdb-1.3.2.dist-info/entry_points.txt' 2024-07-01T03:32:46,040 adding 'apache_iotdb-1.3.2.dist-info/top_level.txt' 2024-07-01T03:32:46,041 adding 'apache_iotdb-1.3.2.dist-info/RECORD' 2024-07-01T03:32:46,045 removing build/bdist.linux-armv7l/wheel 2024-07-01T03:32:46,157 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2024-07-01T03:32:46,165 Created wheel for apache-iotdb: filename=apache_iotdb-1.3.2-py3-none-any.whl size=129047 sha256=f4e7d294537025b4289e392f2d81ea300ebb94715af85eb1ce9b451d024b6243 2024-07-01T03:32:46,166 Stored in directory: /tmp/pip-ephem-wheel-cache-1jauv6go/wheels/b0/85/05/8a7b9d7b47bc06838a311c7ea83b36b48870461d716ccafcc0 2024-07-01T03:32:46,183 Successfully built apache-iotdb 2024-07-01T03:32:46,190 Removed build tracker: '/tmp/pip-build-tracker-693q_2vr'