2022-09-08T14:45:23,101 Created temporary directory: /tmp/pip-ephem-wheel-cache-pvnhjbro 2022-09-08T14:45:23,107 Created temporary directory: /tmp/pip-build-tracker-54r643a2 2022-09-08T14:45:23,108 Initialized build tracking at /tmp/pip-build-tracker-54r643a2 2022-09-08T14:45:23,108 Created build tracker: /tmp/pip-build-tracker-54r643a2 2022-09-08T14:45:23,108 Entered build tracker: /tmp/pip-build-tracker-54r643a2 2022-09-08T14:45:23,110 Created temporary directory: /tmp/pip-wheel-sfdywcno 2022-09-08T14:45:23,181 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2022-09-08T14:45:23,189 2 location(s) to search for versions of apache-iotdb: 2022-09-08T14:45:23,189 * https://pypi.org/simple/apache-iotdb/ 2022-09-08T14:45:23,189 * https://www.piwheels.org/simple/apache-iotdb/ 2022-09-08T14:45:23,190 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2022-09-08T14:45:23,191 Getting page https://pypi.org/simple/apache-iotdb/ 2022-09-08T14:45:23,195 Found index url https://pypi.org/simple 2022-09-08T14:45:23,415 Found link https://files.pythonhosted.org/packages/76/14/d01b6281df00530c69bc8eae2074b9970bbe865a5e971b5cd2019e8b8250/apache-iotdb-0.9.0.tar.gz#sha256=0f7f2ea82b2bdfd974c1757dd2b93ae96754bf5aeb56c895f08f7302e76977ad (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.0 2022-09-08T14:45:23,416 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#sha256=1feb6b731a9af26aac7a1e6fab74e85dd960562a1dca6e4c5c9d10234a570e82 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,417 Found link https://files.pythonhosted.org/packages/01/fa/e65db378e4d8e07322ec175f37568bceb55ebb3c8397fa7b48e9f087c451/apache-iotdb-0.9.2.tar.gz#sha256=e898a8c1a62493c0c7547f89fe15d39ccb76fc4a6468dbc0f5406e2229c5233d (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.2 2022-09-08T14:45:23,418 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#sha256=29c5ad15a61ef6200bb3cff15abed66acf87abbbdedab496978a4ee8f731f82c (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,419 Found link https://files.pythonhosted.org/packages/34/95/030c2da665358de8ba950099b3b0397dca437fcde60d5d1730d0c451d5e3/apache-iotdb-0.9.3.tar.gz#sha256=5c17a131cc2485c1788a2d8a29ee850dabd9b16ada3f13996c8a07e11ae23df4 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.3 2022-09-08T14:45:23,420 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#sha256=4a589b5bbbdb8fdc9d1c91320a9a3480e41768cb590d82ab317dc62f57302d6c (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,422 Found link https://files.pythonhosted.org/packages/1d/dc/138e08717f8c2e0e238f35d39b34af6cfc1c7a1332b6aa4689750f4fda26/apache-iotdb-0.10.0.tar.gz#sha256=0c95e2ec5bc4e3338a83898a329ec9609681efbee26b000350d4ac08d564b91e (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.0 2022-09-08T14:45:23,422 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#sha256=1607a07d9546fbd1e1239c5faed9a85a3a021e7ad3a389df3eeedcb95708c641 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,424 Found link https://files.pythonhosted.org/packages/f6/4d/b229b9f309431e8164c9cd893431009a57efcaa059f58c1091d222601da3/apache-iotdb-0.10.1.tar.gz#sha256=b3f1651a6b290220222d0eaf66955396e9c3ce17d01be6cd698d31e0e5feb51e (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.1 2022-09-08T14:45:23,424 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#sha256=b4b13fa0d6ed86fbcc1231cad3d220ee81b38452e87fea655641720f803d4c1d (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,426 Found link https://files.pythonhosted.org/packages/16/8b/2ec65fa81d5961bd927c02d6a209490bf325b2a164506cd3b12e846d7061/apache-iotdb-0.11.0.tar.gz#sha256=a89a080bd084ab35e87c08660a1ce604c1857e3ffcf702d39540fb35366eabd8 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.0 2022-09-08T14:45:23,426 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#sha256=4771e87dd8d933815206c063014beff8eff4c8025353723ac67603f49a119224 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,428 Found link https://files.pythonhosted.org/packages/55/a1/ef100f67e0f26fbc1d19b84115b21de942e7b7e01803706d19f841ac06c1/apache-iotdb-0.11.1.tar.gz#sha256=d80bc159ae19e04d11f0a671061a19f640f95415d9c5f3c4073dd0645c365c44 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.1 2022-09-08T14:45:23,429 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#sha256=317a24e4870d587820f8d5be294e2e9a6ad09f70566ce4380506085c47b2fc0a (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,430 Found link https://files.pythonhosted.org/packages/69/d5/f1b9ff293fe02eb1f1cb3cba13b5d9a4b547415ab0045b2a8a3612249e12/apache-iotdb-0.11.2.tar.gz#sha256=d6bf2cf44bf4f7a3c8093da17688ae28c2f2c24eafce6f2f062a01ebc68beae9 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.2 2022-09-08T14:45:23,431 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#sha256=762d5b0c5f82869237d5375d2a8774f99654c3b693d6f77bf6e9decc78b7fd5d (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,433 Found link https://files.pythonhosted.org/packages/7d/cf/0d672a828527f59cdc66c078b0b8e356ca0a3191224a4363ce2256337d1c/apache-iotdb-0.11.3.tar.gz#sha256=db3b395fd7c61e4d42a4d8dea8455f846055ca03eb67ed256d655eab20ce0369 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.3 2022-09-08T14:45:23,433 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#sha256=55e9a0042694ba7fa482f733a1d548c0180bccf0e35e090b85d7b9050c95162b (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,435 Found link https://files.pythonhosted.org/packages/00/a1/5b1b8a2754f4b25420d9a4461b5e2b8573bb89b43054f9303ea0558df0de/apache-iotdb-0.11.4.tar.gz#sha256=83190c258ec5befef3d4efe23825b37855825de6f84ec5b759dd53bf614ae2ff (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.4 2022-09-08T14:45:23,435 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#sha256=cf1ee85db62d31642b32742aba0a026a941b85cf4bb49ec48ef09b9e241f3bf5 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,437 Found link https://files.pythonhosted.org/packages/9e/16/bb2ef45f62e9866f1be97f04e2c581247d3b145e5d8a01b7c143023c6c45/apache-iotdb-0.12.0.tar.gz#sha256=b86ddbcf62a17f7ffdc924933f052d1d1c09b25cb0160d0ab1d0fecf8007b902 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.0 2022-09-08T14:45:23,437 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#sha256=061d9407266b9d100113fa2d11890a8d5d56f8b496305c5864f08a9af35fcc12 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,439 Found link https://files.pythonhosted.org/packages/20/0c/b39e9f362fb0a1a43cb0a05a5b2d9163815f0048575e0c071bbaa50070b8/apache-iotdb-0.12.1.tar.gz#sha256=2ff51551184706b690c91b2f24e4e10694ae486d46b1674b79e58ef2410b9f61 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.1 2022-09-08T14:45:23,439 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#sha256=bc5ddc6b683bf26a0b9a8c47ada13d29918503664e9e1c3fdefae73121f3a327 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,441 Found link https://files.pythonhosted.org/packages/fd/64/d83ceaaab941dd78df38cd8c35d27028a27724c2535f0e6f01a48472aa28/apache-iotdb-0.12.2.tar.gz#sha256=530b328959f7b20d09f73682d68ecde5d6d58d1048b7d10f6a3846ed6ccef954 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.2 2022-09-08T14:45:23,442 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#sha256=4a8cbbf791710bbe1bd83f55b5a6209fed0c28bf1d297dc50df44b9b1662c5a0 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,443 Found link https://files.pythonhosted.org/packages/24/7c/81a9dcfd218d4654b03d9079578659d6201aa4f9e9ccba328c0742e8e9c1/apache-iotdb-0.12.3.tar.gz#sha256=5b73fcce1c33070e14f00d4708129320dbfcd7bd8b80fb82cd74a267457b81e0 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.3 2022-09-08T14:45:23,444 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#sha256=724ff3ecb4762801cbc977ea4257586757943356bfa16fbfb4cc45ddcea06897 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,445 Found link https://files.pythonhosted.org/packages/9e/11/0d12f9b906b3aac1446c09e297bcdf3a0cdfb016aae1ec77effa214999de/apache-iotdb-0.12.4.tar.gz#sha256=01b1370a1816e5934dc6fd34606b9dfe63817c94d626069aff9102e6e6b77751 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.4 2022-09-08T14:45:23,446 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#sha256=b5aa061943bf32b9d289ffcf15e5bad8abc8ef8ee7413e035014ec27b81ad11f (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,447 Found link https://files.pythonhosted.org/packages/8a/52/93503eac47c1561edc21431f7154b694afad9d461e2af0fea36966953c24/apache-iotdb-0.12.5.tar.gz#sha256=38eb0acb7f8f66f2c40dbeeb0bcaac9914442c02d2b2b40f621080ad8532af48 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.5 2022-09-08T14:45:23,448 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#sha256=3255a9b173ef106ff04aa683d2dc59f2c5109c0e197dc39a0d3abcc517c27393 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,449 Found link https://files.pythonhosted.org/packages/00/d9/19746ff8906cc2ac3c9326fbcbd244d2424f4aad5d7201843956d27dcb0b/apache-iotdb-0.12.6.tar.gz#sha256=93df582d4dc16239c4c9f749aff36c5049cb03c64938ac80be7b5e866128c2c5 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.6 2022-09-08T14:45:23,450 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#sha256=171b45e6c74b8ab121e1b926da0efbdc619c8d17db08f0d7cda422793a159fb5 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,451 Found link https://files.pythonhosted.org/packages/a6/cd/33de301e51132f8d0d79adc346d38685a6b871251846bad95b35ebf74ac9/apache-iotdb-0.13.0.tar.gz#sha256=42f0f028d609cd06eef653683cfecc25436d8538d40b2b49b724be921a5fe910 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0 2022-09-08T14:45:23,452 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#sha256=1d1ed3469afbe39ab6159f5e7965579d315828c675480dc620ec6d2bb1687e3b (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,453 Found link https://files.pythonhosted.org/packages/7e/3e/40f0d900e04598036cc65ae437a2ee9f4aa149860d434a6f4b291460582c/apache-iotdb-0.13.0.post1.tar.gz#sha256=1f971f4ef6525a5971794967ba5e9a5ee4858237d17493c0de889cb14f9f76e3 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0.post1 2022-09-08T14:45:23,454 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#sha256=0b6f35e13caaaf2ebd7f3edd24dfe3f5802cc95c4015a3a68e1e6c686c16d4ef (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,455 Found link https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz#sha256=93f9d4d49f688166596691a8d3ec0606332ab2e39dfe174f007a8134246ac415 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.1 2022-09-08T14:45:23,456 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#sha256=3580595a67fb3856f3aac7e8751208f2dff81bdde0a4c638f84fd87a9069e594 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,457 Found link https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz#sha256=1cce6e24f56457bd8195bb82b8e3d7924dfeb66a5458d7e137cbc0a9a0939de1 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.2 2022-09-08T14:45:23,458 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#sha256=0d233b8f31f2a5556f1e4db54691ba2365f15957f6834c5253858b42391ad080 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,459 Found link https://files.pythonhosted.org/packages/bb/7d/24cefdcd57e96d496fd3492fc28b3d53da6ba0fc6ee69f99dddec1cf500c/apache-iotdb-0.14.0rc1.tar.gz#sha256=c769d5fa5ff2ad1c9a0db2a72edead9f6e6c3f6389b7e91eb82508462a8f95a1 (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.14.0rc1 2022-09-08T14:45:23,460 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#sha256=d12bc8fef329bcb5588881ce837bfd71e533177f7b47fcaa69ec66577e7252df (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2022-09-08T14:45:23,461 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2022-09-08T14:45:23,462 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2022-09-08T14:45:23,464 Found index url https://www.piwheels.org/simple 2022-09-08T14:45:23,733 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) 2022-09-08T14:45:23,734 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) 2022-09-08T14:45:23,734 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) 2022-09-08T14:45:23,735 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) 2022-09-08T14:45:23,735 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) 2022-09-08T14:45:23,736 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) 2022-09-08T14:45:23,737 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) 2022-09-08T14:45:23,737 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) 2022-09-08T14:45:23,738 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) 2022-09-08T14:45:23,738 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) 2022-09-08T14:45:23,739 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) 2022-09-08T14:45:23,739 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) 2022-09-08T14:45:23,740 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) 2022-09-08T14:45:23,740 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) 2022-09-08T14:45:23,741 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) 2022-09-08T14:45:23,742 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) 2022-09-08T14:45:23,742 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) 2022-09-08T14:45:23,743 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) 2022-09-08T14:45:23,743 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) 2022-09-08T14:45:23,744 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) 2022-09-08T14:45:23,744 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) 2022-09-08T14:45:23,745 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2022-09-08T14:45:23,745 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2022-09-08T14:45:23,787 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2022-09-08T14:45:23,818 Collecting apache-iotdb==0.13.2 2022-09-08T14:45:23,823 Created temporary directory: /tmp/pip-unpack-lkgz4kkq 2022-09-08T14:45:24,079 Downloading apache-iotdb-0.13.2.tar.gz (58 kB) 2022-09-08T14:45:24,483 Added apache-iotdb==0.13.2 from https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz#sha256=1cce6e24f56457bd8195bb82b8e3d7924dfeb66a5458d7e137cbc0a9a0939de1 to build tracker '/tmp/pip-build-tracker-54r643a2' 2022-09-08T14:45:24,493 Created temporary directory: /tmp/pip-build-env-mu0qc12t 2022-09-08T14:45:24,508 Created temporary directory: /tmp/pip-standalone-pip-6fri2bms 2022-09-08T14:45:27,104 Installing build dependencies: started 2022-09-08T14:45:27,106 Running command pip subprocess to install build dependencies 2022-09-08T14:45:37,424 Using pip 22.1.2 from /tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip (python 3.7) 2022-09-08T14:45:39,725 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2022-09-08T14:45:43,961 Collecting setuptools>=40.8.0 2022-09-08T14:45:44,231 Using cached https://www.piwheels.org/simple/setuptools/setuptools-65.3.0-py3-none-any.whl (1.2 MB) 2022-09-08T14:45:44,903 Collecting wheel 2022-09-08T14:45:44,940 Using cached https://www.piwheels.org/simple/wheel/wheel-0.37.1-py2.py3-none-any.whl (35 kB) 2022-09-08T14:45:57,484 Installing collected packages: wheel, setuptools 2022-09-08T14:45:57,837 Creating /tmp/pip-build-env-mu0qc12t/overlay/bin 2022-09-08T14:45:57,842 changing mode of /tmp/pip-build-env-mu0qc12t/overlay/bin/wheel to 755 2022-09-08T14:46:03,496 Successfully installed setuptools-65.3.0 wheel-0.37.1 2022-09-08T14:46:03,775 --- Logging error --- 2022-09-08T14:46:03,775 Traceback (most recent call last): 2022-09-08T14:46:03,776 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/utils/logging.py", line 177, in emit 2022-09-08T14:46:03,776 self.console.print(renderable, overflow="ignore", crop=False, style=style) 2022-09-08T14:46:03,777 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_vendor/rich/console.py", line 1752, in print 2022-09-08T14:46:03,777 extend(render(renderable, render_options)) 2022-09-08T14:46:03,777 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_vendor/rich/console.py", line 1390, in render 2022-09-08T14:46:03,778 for render_output in iter_render: 2022-09-08T14:46:03,778 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/utils/logging.py", line 134, in __rich_console__ 2022-09-08T14:46:03,778 for line in lines: 2022-09-08T14:46:03,779 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_vendor/rich/segment.py", line 245, in split_lines 2022-09-08T14:46:03,779 for segment in segments: 2022-09-08T14:46:03,779 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_vendor/rich/console.py", line 1368, in render 2022-09-08T14:46:03,780 renderable = rich_cast(renderable) 2022-09-08T14:46:03,780 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_vendor/rich/protocol.py", line 36, in rich_cast 2022-09-08T14:46:03,780 renderable = cast_method() 2022-09-08T14:46:03,780 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/self_outdated_check.py", line 130, in __rich__ 2022-09-08T14:46:03,781 pip_cmd = get_best_invocation_for_this_pip() 2022-09-08T14:46:03,781 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/utils/entrypoints.py", line 60, in get_best_invocation_for_this_pip 2022-09-08T14:46:03,781 os.path.join(binary_prefix, exe_name), 2022-09-08T14:46:03,782 File "/usr/lib/python3.7/genericpath.py", line 97, in samefile 2022-09-08T14:46:03,782 s2 = os.stat(f2) 2022-09-08T14:46:03,782 FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pip3.7' 2022-09-08T14:46:03,783 Call stack: 2022-09-08T14:46:03,783 File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main 2022-09-08T14:46:03,783 "__main__", mod_spec) 2022-09-08T14:46:03,784 File "/usr/lib/python3.7/runpy.py", line 85, in _run_code 2022-09-08T14:46:03,784 exec(code, run_globals) 2022-09-08T14:46:03,784 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/__main__.py", line 31, in 2022-09-08T14:46:03,784 sys.exit(_main()) 2022-09-08T14:46:03,785 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/cli/main.py", line 70, in main 2022-09-08T14:46:03,785 return command.main(cmd_args) 2022-09-08T14:46:03,785 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/cli/base_command.py", line 101, in main 2022-09-08T14:46:03,786 return self._main(args) 2022-09-08T14:46:03,786 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/cli/base_command.py", line 223, in _main 2022-09-08T14:46:03,786 self.handle_pip_version_check(options) 2022-09-08T14:46:03,787 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/cli/req_command.py", line 148, in handle_pip_version_check 2022-09-08T14:46:03,787 pip_self_version_check(session, options) 2022-09-08T14:46:03,787 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/self_outdated_check.py", line 237, in pip_self_version_check 2022-09-08T14:46:03,788 logger.info("[present-rich] %s", upgrade_prompt) 2022-09-08T14:46:03,788 File "/usr/lib/python3.7/logging/__init__.py", line 1383, in info 2022-09-08T14:46:03,788 self._log(INFO, msg, args, **kwargs) 2022-09-08T14:46:03,789 File "/usr/lib/python3.7/logging/__init__.py", line 1519, in _log 2022-09-08T14:46:03,789 self.handle(record) 2022-09-08T14:46:03,789 File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle 2022-09-08T14:46:03,790 self.callHandlers(record) 2022-09-08T14:46:03,790 File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers 2022-09-08T14:46:03,790 hdlr.handle(record) 2022-09-08T14:46:03,791 File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle 2022-09-08T14:46:03,791 self.emit(record) 2022-09-08T14:46:03,791 File "/tmp/pip-standalone-pip-6fri2bms/__env_pip__.zip/pip/_internal/utils/logging.py", line 179, in emit 2022-09-08T14:46:03,792 self.handleError(record) 2022-09-08T14:46:03,792 Message: '[present-rich] %s' 2022-09-08T14:46:03,792 Arguments: (UpgradePrompt(old='22.1.2', new='22.2.2'),) 2022-09-08T14:46:04,264 Installing build dependencies: finished with status 'done' 2022-09-08T14:46:04,290 Getting requirements to build wheel: started 2022-09-08T14:46:04,293 Running command Getting requirements to build wheel 2022-09-08T14:46:06,160 2022-09-08T14:46:06,168 # Apache IoTDB 2022-09-08T14:46:06,169 [![Main Mac and Linux](https://github.com/apache/iotdb/actions/workflows/main-unix.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-unix.yml) 2022-09-08T14:46:06,169 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2022-09-08T14:46:06,170 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-09-08T14:46:06,170 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-09-08T14:46:06,171 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-09-08T14:46:06,171 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-09-08T14:46:06,171 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-09-08T14:46:06,171 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-09-08T14:46:06,172 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-09-08T14:46:06,172 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-09-08T14:46:06,173 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-09-08T14:46:06,173 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-09-08T14:46:06,174 architecture, high performance and rich feature set together with its deep integration with 2022-09-08T14:46:06,174 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-09-08T14:46:06,174 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-09-08T14:46:06,175 ## Python Native API 2022-09-08T14:46:06,176 ### Requirements 2022-09-08T14:46:06,176 You have to install thrift (>=0.13) before using the package. 2022-09-08T14:46:06,178 ### How to use (Example) 2022-09-08T14:46:06,178 First, download the latest package: `pip3 install apache-iotdb` 2022-09-08T14:46:06,179 *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!* 2022-09-08T14:46:06,179 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) 2022-09-08T14:46:06,180 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-09-08T14:46:06,181 (you need to add `import iotdb` in the head of the file) 2022-09-08T14:46:06,181 Or: 2022-09-08T14:46:06,182 ```python 2022-09-08T14:46:06,182 from iotdb.Session import Session 2022-09-08T14:46:06,183 ip = "127.0.0.1" 2022-09-08T14:46:06,183 port_ = "6667" 2022-09-08T14:46:06,183 username_ = "root" 2022-09-08T14:46:06,184 password_ = "root" 2022-09-08T14:46:06,184 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:06,184 session.open(False) 2022-09-08T14:46:06,185 zone = session.get_time_zone() 2022-09-08T14:46:06,185 session.close() 2022-09-08T14:46:06,185 ``` 2022-09-08T14:46:06,186 ### Initialization 2022-09-08T14:46:06,186 * Initialize a Session 2022-09-08T14:46:06,187 ```python 2022-09-08T14:46:06,187 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-09-08T14:46:06,187 ``` 2022-09-08T14:46:06,188 * Open a session, with a parameter to specify whether to enable RPC compression 2022-09-08T14:46:06,189 ```python 2022-09-08T14:46:06,189 session.open(enable_rpc_compression=False) 2022-09-08T14:46:06,189 ``` 2022-09-08T14:46:06,190 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-09-08T14:46:06,190 * Close a Session 2022-09-08T14:46:06,191 ```python 2022-09-08T14:46:06,191 session.close() 2022-09-08T14:46:06,192 ``` 2022-09-08T14:46:06,192 ### Data Definition Interface (DDL Interface) 2022-09-08T14:46:06,193 #### Storage Group Management 2022-09-08T14:46:06,194 * Set storage group 2022-09-08T14:46:06,194 ```python 2022-09-08T14:46:06,194 session.set_storage_group(group_name) 2022-09-08T14:46:06,195 ``` 2022-09-08T14:46:06,195 * Delete one or several storage groups 2022-09-08T14:46:06,196 ```python 2022-09-08T14:46:06,196 session.delete_storage_group(group_name) 2022-09-08T14:46:06,197 session.delete_storage_groups(group_name_lst) 2022-09-08T14:46:06,197 ``` 2022-09-08T14:46:06,197 #### Timeseries Management 2022-09-08T14:46:06,198 * Create one or multiple timeseries 2022-09-08T14:46:06,198 ```python 2022-09-08T14:46:06,199 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-09-08T14:46:06,199 props=None, tags=None, attributes=None, alias=None) 2022-09-08T14:46:06,200 session.create_multi_time_series( 2022-09-08T14:46:06,200 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-09-08T14:46:06,200 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-09-08T14:46:06,201 ) 2022-09-08T14:46:06,201 ``` 2022-09-08T14:46:06,202 * Create aligned timeseries 2022-09-08T14:46:06,202 ```python 2022-09-08T14:46:06,203 session.create_aligned_time_series( 2022-09-08T14:46:06,203 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-09-08T14:46:06,203 ) 2022-09-08T14:46:06,204 ``` 2022-09-08T14:46:06,204 Attention: Alias of measurements are **not supported** currently. 2022-09-08T14:46:06,205 * Delete one or several timeseries 2022-09-08T14:46:06,205 ```python 2022-09-08T14:46:06,206 session.delete_time_series(paths_list) 2022-09-08T14:46:06,206 ``` 2022-09-08T14:46:06,207 * Check whether the specific timeseries exists 2022-09-08T14:46:06,207 ```python 2022-09-08T14:46:06,208 session.check_time_series_exists(path) 2022-09-08T14:46:06,208 ``` 2022-09-08T14:46:06,209 ### Data Manipulation Interface (DML Interface) 2022-09-08T14:46:06,209 #### Insert 2022-09-08T14:46:06,210 It is recommended to use insertTablet to help improve write efficiency. 2022-09-08T14:46:06,210 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-09-08T14:46:06,211 * **Better Write Performance** 2022-09-08T14:46:06,211 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-09-08T14:46:06,212 We have two implementations of Tablet in Python API. 2022-09-08T14:46:06,213 * Normal Tablet 2022-09-08T14:46:06,213 ```python 2022-09-08T14:46:06,213 values_ = [ 2022-09-08T14:46:06,214 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-09-08T14:46:06,214 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-09-08T14:46:06,214 [False, 100, 1, 188.1, 688.25, "test03"], 2022-09-08T14:46:06,215 [True, 0, 0, 0, 6.25, "test04"], 2022-09-08T14:46:06,215 ] 2022-09-08T14:46:06,215 timestamps_ = [1, 2, 3, 4] 2022-09-08T14:46:06,216 tablet_ = Tablet( 2022-09-08T14:46:06,216 device_id, measurements_, data_types_, values_, timestamps_ 2022-09-08T14:46:06,216 ) 2022-09-08T14:46:06,217 session.insert_tablet(tablet_) 2022-09-08T14:46:06,217 ``` 2022-09-08T14:46:06,217 * Numpy Tablet 2022-09-08T14:46:06,218 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-09-08T14:46:06,218 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-09-08T14:46:06,219 **Notice** 2022-09-08T14:46:06,219 1. time and value columns in Tablet are ndarray. 2022-09-08T14:46:06,219 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-09-08T14:46:06,220 (if not, the default dtypes are also ok). 2022-09-08T14:46:06,220 ```python 2022-09-08T14:46:06,221 import numpy as np 2022-09-08T14:46:06,221 data_types_ = [ 2022-09-08T14:46:06,221 TSDataType.BOOLEAN, 2022-09-08T14:46:06,222 TSDataType.INT32, 2022-09-08T14:46:06,222 TSDataType.INT64, 2022-09-08T14:46:06,222 TSDataType.FLOAT, 2022-09-08T14:46:06,222 TSDataType.DOUBLE, 2022-09-08T14:46:06,223 TSDataType.TEXT, 2022-09-08T14:46:06,223 ] 2022-09-08T14:46:06,223 np_values_ = [ 2022-09-08T14:46:06,224 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-09-08T14:46:06,224 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-09-08T14:46:06,224 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-09-08T14:46:06,225 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-09-08T14:46:06,225 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-09-08T14:46:06,225 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-09-08T14:46:06,226 ] 2022-09-08T14:46:06,226 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-09-08T14:46:06,226 np_tablet_ = NumpyTablet( 2022-09-08T14:46:06,227 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-09-08T14:46:06,227 ) 2022-09-08T14:46:06,227 session.insert_tablet(np_tablet_) 2022-09-08T14:46:06,227 ``` 2022-09-08T14:46:06,228 * Insert multiple Tablets 2022-09-08T14:46:06,229 ```python 2022-09-08T14:46:06,229 session.insert_tablets(tablet_lst) 2022-09-08T14:46:06,229 ``` 2022-09-08T14:46:06,230 * Insert a Record 2022-09-08T14:46:06,230 ```python 2022-09-08T14:46:06,231 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-09-08T14:46:06,231 ``` 2022-09-08T14:46:06,232 * Insert multiple Records 2022-09-08T14:46:06,232 ```python 2022-09-08T14:46:06,233 session.insert_records( 2022-09-08T14:46:06,233 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-09-08T14:46:06,233 ) 2022-09-08T14:46:06,233 ``` 2022-09-08T14:46:06,234 * Insert multiple Records that belong to the same device. 2022-09-08T14:46:06,234 With type info the server has no need to do type inference, which leads a better performance 2022-09-08T14:46:06,235 ```python 2022-09-08T14:46:06,235 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-09-08T14:46:06,236 ``` 2022-09-08T14:46:06,236 #### Insert with type inference 2022-09-08T14:46:06,237 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. 2022-09-08T14:46:06,238 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-09-08T14:46:06,238 ```python 2022-09-08T14:46:06,239 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-09-08T14:46:06,239 ``` 2022-09-08T14:46:06,240 #### Insert of Aligned Timeseries 2022-09-08T14:46:06,240 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-09-08T14:46:06,241 * insert_aligned_record 2022-09-08T14:46:06,241 * insert_aligned_records 2022-09-08T14:46:06,241 * insert_aligned_records_of_one_device 2022-09-08T14:46:06,242 * insert_aligned_tablet 2022-09-08T14:46:06,242 * insert_aligned_tablets 2022-09-08T14:46:06,243 ### IoTDB-SQL Interface 2022-09-08T14:46:06,244 * Execute query statement 2022-09-08T14:46:06,244 ```python 2022-09-08T14:46:06,244 session.execute_query_statement(sql) 2022-09-08T14:46:06,245 ``` 2022-09-08T14:46:06,245 * Execute non query statement 2022-09-08T14:46:06,246 ```python 2022-09-08T14:46:06,246 session.execute_non_query_statement(sql) 2022-09-08T14:46:06,247 ``` 2022-09-08T14:46:06,247 ### Pandas Support 2022-09-08T14:46:06,248 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-09-08T14:46:06,248 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-09-08T14:46:06,249 Example: 2022-09-08T14:46:06,250 ```python 2022-09-08T14:46:06,250 from iotdb.Session import Session 2022-09-08T14:46:06,251 ip = "127.0.0.1" 2022-09-08T14:46:06,251 port_ = "6667" 2022-09-08T14:46:06,251 username_ = "root" 2022-09-08T14:46:06,251 password_ = "root" 2022-09-08T14:46:06,252 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:06,252 session.open(False) 2022-09-08T14:46:06,252 result = session.execute_query_statement("SELECT * FROM root.*") 2022-09-08T14:46:06,253 # Transform to Pandas Dataset 2022-09-08T14:46:06,253 df = result.todf() 2022-09-08T14:46:06,254 session.close() 2022-09-08T14:46:06,255 # Now you can work with the dataframe 2022-09-08T14:46:06,255 df = ... 2022-09-08T14:46:06,255 ``` 2022-09-08T14:46:06,256 ### IoTDB Testcontainer 2022-09-08T14:46:06,257 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. 2022-09-08T14:46:06,258 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-09-08T14:46:06,258 ```python 2022-09-08T14:46:06,258 class MyTestCase(unittest.TestCase): 2022-09-08T14:46:06,259 def test_something(self): 2022-09-08T14:46:06,259 with IoTDBContainer() as c: 2022-09-08T14:46:06,260 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-09-08T14:46:06,260 session.open(False) 2022-09-08T14:46:06,260 result = session.execute_query_statement("SHOW TIMESERIES") 2022-09-08T14:46:06,260 print(result) 2022-09-08T14:46:06,261 session.close() 2022-09-08T14:46:06,261 ``` 2022-09-08T14:46:06,262 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. 2022-09-08T14:46:06,263 ## Developers 2022-09-08T14:46:06,263 ### Introduction 2022-09-08T14:46:06,264 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. 2022-09-08T14:46:06,265 ### Prerequisites 2022-09-08T14:46:06,266 Python3.7 or later is preferred. 2022-09-08T14:46:06,266 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. 2022-09-08T14:46:06,267 ``` 2022-09-08T14:46:06,267 http://thrift.apache.org/docs/install/ 2022-09-08T14:46:06,268 ``` 2022-09-08T14:46:06,268 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-09-08T14:46:06,268 ```shell 2022-09-08T14:46:06,269 pip install -r requirements_dev.txt 2022-09-08T14:46:06,269 ``` 2022-09-08T14:46:06,270 ### Compile the thrift library and Debug 2022-09-08T14:46:06,271 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-09-08T14:46:06,272 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-09-08T14:46:06,272 This folder is ignored from git and should **never be pushed to git!** 2022-09-08T14:46:06,272 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-09-08T14:46:06,274 ### Session Client & Example 2022-09-08T14:46:06,274 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. 2022-09-08T14:46:06,275 Or, another simple example: 2022-09-08T14:46:06,276 ```python 2022-09-08T14:46:06,276 from iotdb.Session import Session 2022-09-08T14:46:06,277 ip = "127.0.0.1" 2022-09-08T14:46:06,277 port_ = "6667" 2022-09-08T14:46:06,277 username_ = "root" 2022-09-08T14:46:06,278 password_ = "root" 2022-09-08T14:46:06,278 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:06,278 session.open(False) 2022-09-08T14:46:06,279 zone = session.get_time_zone() 2022-09-08T14:46:06,279 session.close() 2022-09-08T14:46:06,279 ``` 2022-09-08T14:46:06,281 ### Tests 2022-09-08T14:46:06,281 Please add your custom tests in `tests` folder. 2022-09-08T14:46:06,282 To run all defined tests just type `pytest .` in the root folder. 2022-09-08T14:46:06,282 **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). 2022-09-08T14:46:06,284 ### Futher Tools 2022-09-08T14:46:06,284 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-09-08T14:46:06,285 Both can be run by `black .` or `flake8 .` respectively. 2022-09-08T14:46:06,286 ## Releasing 2022-09-08T14:46:06,287 To do a release just ensure that you have the right set of generated thrift files. 2022-09-08T14:46:06,287 Then run linting and auto-formatting. 2022-09-08T14:46:06,287 Then, ensure that all tests work (via `pytest .`). 2022-09-08T14:46:06,287 Then you are good to go to do a release! 2022-09-08T14:46:06,289 ### Preparing your environment 2022-09-08T14:46:06,289 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-09-08T14:46:06,290 ### Doing the Release 2022-09-08T14:46:06,291 There is a convenient script `release.sh` to do all steps for a release. 2022-09-08T14:46:06,291 Namely, these are 2022-09-08T14:46:06,292 * Remove all transient directories from last release (if exists) 2022-09-08T14:46:06,292 * (Re-)generate all generated sources via mvn 2022-09-08T14:46:06,293 * Run Linting (flake8) 2022-09-08T14:46:06,293 * Run Tests via pytest 2022-09-08T14:46:06,293 * Build 2022-09-08T14:46:06,293 * Release to pypi 2022-09-08T14:46:10,767 running egg_info 2022-09-08T14:46:11,403 writing apache_iotdb.egg-info/PKG-INFO 2022-09-08T14:46:12,005 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2022-09-08T14:46:14,997 writing requirements to apache_iotdb.egg-info/requires.txt 2022-09-08T14:46:15,600 writing top-level names to apache_iotdb.egg-info/top_level.txt 2022-09-08T14:46:16,362 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:16,368 adding license file 'LICENSE' 2022-09-08T14:46:16,376 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:16,380 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-09-08T14:46:16,381 warnings.warn(msg) 2022-09-08T14:46:16,597 Getting requirements to build wheel: finished with status 'done' 2022-09-08T14:46:16,622 Created temporary directory: /tmp/pip-modern-metadata-smg3sbfn 2022-09-08T14:46:16,628 Preparing metadata (pyproject.toml): started 2022-09-08T14:46:16,630 Running command Preparing metadata (pyproject.toml) 2022-09-08T14:46:18,512 2022-09-08T14:46:18,520 # Apache IoTDB 2022-09-08T14:46:18,521 [![Main Mac and Linux](https://github.com/apache/iotdb/actions/workflows/main-unix.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-unix.yml) 2022-09-08T14:46:18,521 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2022-09-08T14:46:18,522 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-09-08T14:46:18,522 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-09-08T14:46:18,523 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-09-08T14:46:18,523 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-09-08T14:46:18,523 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-09-08T14:46:18,524 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-09-08T14:46:18,524 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-09-08T14:46:18,524 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-09-08T14:46:18,525 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-09-08T14:46:18,526 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-09-08T14:46:18,526 architecture, high performance and rich feature set together with its deep integration with 2022-09-08T14:46:18,526 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-09-08T14:46:18,527 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-09-08T14:46:18,527 ## Python Native API 2022-09-08T14:46:18,528 ### Requirements 2022-09-08T14:46:18,528 You have to install thrift (>=0.13) before using the package. 2022-09-08T14:46:18,530 ### How to use (Example) 2022-09-08T14:46:18,530 First, download the latest package: `pip3 install apache-iotdb` 2022-09-08T14:46:18,531 *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!* 2022-09-08T14:46:18,531 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) 2022-09-08T14:46:18,532 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-09-08T14:46:18,533 (you need to add `import iotdb` in the head of the file) 2022-09-08T14:46:18,533 Or: 2022-09-08T14:46:18,534 ```python 2022-09-08T14:46:18,534 from iotdb.Session import Session 2022-09-08T14:46:18,535 ip = "127.0.0.1" 2022-09-08T14:46:18,535 port_ = "6667" 2022-09-08T14:46:18,535 username_ = "root" 2022-09-08T14:46:18,535 password_ = "root" 2022-09-08T14:46:18,536 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:18,536 session.open(False) 2022-09-08T14:46:18,536 zone = session.get_time_zone() 2022-09-08T14:46:18,537 session.close() 2022-09-08T14:46:18,537 ``` 2022-09-08T14:46:18,538 ### Initialization 2022-09-08T14:46:18,538 * Initialize a Session 2022-09-08T14:46:18,539 ```python 2022-09-08T14:46:18,539 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-09-08T14:46:18,539 ``` 2022-09-08T14:46:18,540 * Open a session, with a parameter to specify whether to enable RPC compression 2022-09-08T14:46:18,541 ```python 2022-09-08T14:46:18,541 session.open(enable_rpc_compression=False) 2022-09-08T14:46:18,541 ``` 2022-09-08T14:46:18,542 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-09-08T14:46:18,543 * Close a Session 2022-09-08T14:46:18,543 ```python 2022-09-08T14:46:18,543 session.close() 2022-09-08T14:46:18,544 ``` 2022-09-08T14:46:18,544 ### Data Definition Interface (DDL Interface) 2022-09-08T14:46:18,545 #### Storage Group Management 2022-09-08T14:46:18,546 * Set storage group 2022-09-08T14:46:18,546 ```python 2022-09-08T14:46:18,547 session.set_storage_group(group_name) 2022-09-08T14:46:18,547 ``` 2022-09-08T14:46:18,548 * Delete one or several storage groups 2022-09-08T14:46:18,548 ```python 2022-09-08T14:46:18,548 session.delete_storage_group(group_name) 2022-09-08T14:46:18,549 session.delete_storage_groups(group_name_lst) 2022-09-08T14:46:18,549 ``` 2022-09-08T14:46:18,549 #### Timeseries Management 2022-09-08T14:46:18,550 * Create one or multiple timeseries 2022-09-08T14:46:18,551 ```python 2022-09-08T14:46:18,551 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-09-08T14:46:18,551 props=None, tags=None, attributes=None, alias=None) 2022-09-08T14:46:18,552 session.create_multi_time_series( 2022-09-08T14:46:18,552 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-09-08T14:46:18,552 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-09-08T14:46:18,553 ) 2022-09-08T14:46:18,553 ``` 2022-09-08T14:46:18,554 * Create aligned timeseries 2022-09-08T14:46:18,554 ```python 2022-09-08T14:46:18,555 session.create_aligned_time_series( 2022-09-08T14:46:18,555 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-09-08T14:46:18,555 ) 2022-09-08T14:46:18,555 ``` 2022-09-08T14:46:18,556 Attention: Alias of measurements are **not supported** currently. 2022-09-08T14:46:18,557 * Delete one or several timeseries 2022-09-08T14:46:18,557 ```python 2022-09-08T14:46:18,558 session.delete_time_series(paths_list) 2022-09-08T14:46:18,558 ``` 2022-09-08T14:46:18,558 * Check whether the specific timeseries exists 2022-09-08T14:46:18,559 ```python 2022-09-08T14:46:18,559 session.check_time_series_exists(path) 2022-09-08T14:46:18,560 ``` 2022-09-08T14:46:18,560 ### Data Manipulation Interface (DML Interface) 2022-09-08T14:46:18,561 #### Insert 2022-09-08T14:46:18,561 It is recommended to use insertTablet to help improve write efficiency. 2022-09-08T14:46:18,562 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-09-08T14:46:18,562 * **Better Write Performance** 2022-09-08T14:46:18,563 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-09-08T14:46:18,564 We have two implementations of Tablet in Python API. 2022-09-08T14:46:18,564 * Normal Tablet 2022-09-08T14:46:18,565 ```python 2022-09-08T14:46:18,565 values_ = [ 2022-09-08T14:46:18,565 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-09-08T14:46:18,566 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-09-08T14:46:18,566 [False, 100, 1, 188.1, 688.25, "test03"], 2022-09-08T14:46:18,566 [True, 0, 0, 0, 6.25, "test04"], 2022-09-08T14:46:18,567 ] 2022-09-08T14:46:18,567 timestamps_ = [1, 2, 3, 4] 2022-09-08T14:46:18,567 tablet_ = Tablet( 2022-09-08T14:46:18,567 device_id, measurements_, data_types_, values_, timestamps_ 2022-09-08T14:46:18,568 ) 2022-09-08T14:46:18,568 session.insert_tablet(tablet_) 2022-09-08T14:46:18,568 ``` 2022-09-08T14:46:18,569 * Numpy Tablet 2022-09-08T14:46:18,569 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-09-08T14:46:18,570 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-09-08T14:46:18,570 **Notice** 2022-09-08T14:46:18,571 1. time and value columns in Tablet are ndarray. 2022-09-08T14:46:18,571 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-09-08T14:46:18,571 (if not, the default dtypes are also ok). 2022-09-08T14:46:18,572 ```python 2022-09-08T14:46:18,572 import numpy as np 2022-09-08T14:46:18,573 data_types_ = [ 2022-09-08T14:46:18,573 TSDataType.BOOLEAN, 2022-09-08T14:46:18,573 TSDataType.INT32, 2022-09-08T14:46:18,574 TSDataType.INT64, 2022-09-08T14:46:18,574 TSDataType.FLOAT, 2022-09-08T14:46:18,574 TSDataType.DOUBLE, 2022-09-08T14:46:18,574 TSDataType.TEXT, 2022-09-08T14:46:18,575 ] 2022-09-08T14:46:18,575 np_values_ = [ 2022-09-08T14:46:18,575 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-09-08T14:46:18,576 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-09-08T14:46:18,576 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-09-08T14:46:18,576 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-09-08T14:46:18,577 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-09-08T14:46:18,577 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-09-08T14:46:18,577 ] 2022-09-08T14:46:18,577 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-09-08T14:46:18,578 np_tablet_ = NumpyTablet( 2022-09-08T14:46:18,578 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-09-08T14:46:18,578 ) 2022-09-08T14:46:18,579 session.insert_tablet(np_tablet_) 2022-09-08T14:46:18,579 ``` 2022-09-08T14:46:18,580 * Insert multiple Tablets 2022-09-08T14:46:18,580 ```python 2022-09-08T14:46:18,581 session.insert_tablets(tablet_lst) 2022-09-08T14:46:18,581 ``` 2022-09-08T14:46:18,581 * Insert a Record 2022-09-08T14:46:18,582 ```python 2022-09-08T14:46:18,582 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-09-08T14:46:18,583 ``` 2022-09-08T14:46:18,583 * Insert multiple Records 2022-09-08T14:46:18,584 ```python 2022-09-08T14:46:18,584 session.insert_records( 2022-09-08T14:46:18,585 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-09-08T14:46:18,585 ) 2022-09-08T14:46:18,585 ``` 2022-09-08T14:46:18,586 * Insert multiple Records that belong to the same device. 2022-09-08T14:46:18,586 With type info the server has no need to do type inference, which leads a better performance 2022-09-08T14:46:18,587 ```python 2022-09-08T14:46:18,587 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-09-08T14:46:18,588 ``` 2022-09-08T14:46:18,588 #### Insert with type inference 2022-09-08T14:46:18,589 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. 2022-09-08T14:46:18,589 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-09-08T14:46:18,590 ```python 2022-09-08T14:46:18,591 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-09-08T14:46:18,591 ``` 2022-09-08T14:46:18,592 #### Insert of Aligned Timeseries 2022-09-08T14:46:18,592 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-09-08T14:46:18,593 * insert_aligned_record 2022-09-08T14:46:18,593 * insert_aligned_records 2022-09-08T14:46:18,593 * insert_aligned_records_of_one_device 2022-09-08T14:46:18,594 * insert_aligned_tablet 2022-09-08T14:46:18,594 * insert_aligned_tablets 2022-09-08T14:46:18,595 ### IoTDB-SQL Interface 2022-09-08T14:46:18,595 * Execute query statement 2022-09-08T14:46:18,596 ```python 2022-09-08T14:46:18,596 session.execute_query_statement(sql) 2022-09-08T14:46:18,597 ``` 2022-09-08T14:46:18,597 * Execute non query statement 2022-09-08T14:46:18,598 ```python 2022-09-08T14:46:18,598 session.execute_non_query_statement(sql) 2022-09-08T14:46:18,599 ``` 2022-09-08T14:46:18,600 ### Pandas Support 2022-09-08T14:46:18,600 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-09-08T14:46:18,600 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-09-08T14:46:18,601 Example: 2022-09-08T14:46:18,602 ```python 2022-09-08T14:46:18,602 from iotdb.Session import Session 2022-09-08T14:46:18,602 ip = "127.0.0.1" 2022-09-08T14:46:18,603 port_ = "6667" 2022-09-08T14:46:18,603 username_ = "root" 2022-09-08T14:46:18,603 password_ = "root" 2022-09-08T14:46:18,604 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:18,604 session.open(False) 2022-09-08T14:46:18,604 result = session.execute_query_statement("SELECT * FROM root.*") 2022-09-08T14:46:18,605 # Transform to Pandas Dataset 2022-09-08T14:46:18,605 df = result.todf() 2022-09-08T14:46:18,606 session.close() 2022-09-08T14:46:18,606 # Now you can work with the dataframe 2022-09-08T14:46:18,607 df = ... 2022-09-08T14:46:18,607 ``` 2022-09-08T14:46:18,608 ### IoTDB Testcontainer 2022-09-08T14:46:18,608 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. 2022-09-08T14:46:18,609 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-09-08T14:46:18,609 ```python 2022-09-08T14:46:18,610 class MyTestCase(unittest.TestCase): 2022-09-08T14:46:18,610 def test_something(self): 2022-09-08T14:46:18,611 with IoTDBContainer() as c: 2022-09-08T14:46:18,611 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-09-08T14:46:18,611 session.open(False) 2022-09-08T14:46:18,612 result = session.execute_query_statement("SHOW TIMESERIES") 2022-09-08T14:46:18,612 print(result) 2022-09-08T14:46:18,612 session.close() 2022-09-08T14:46:18,612 ``` 2022-09-08T14:46:18,613 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. 2022-09-08T14:46:18,614 ## Developers 2022-09-08T14:46:18,615 ### Introduction 2022-09-08T14:46:18,615 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. 2022-09-08T14:46:18,616 ### Prerequisites 2022-09-08T14:46:18,617 Python3.7 or later is preferred. 2022-09-08T14:46:18,617 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. 2022-09-08T14:46:18,618 ``` 2022-09-08T14:46:18,618 http://thrift.apache.org/docs/install/ 2022-09-08T14:46:18,619 ``` 2022-09-08T14:46:18,619 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-09-08T14:46:18,620 ```shell 2022-09-08T14:46:18,620 pip install -r requirements_dev.txt 2022-09-08T14:46:18,620 ``` 2022-09-08T14:46:18,622 ### Compile the thrift library and Debug 2022-09-08T14:46:18,622 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-09-08T14:46:18,623 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-09-08T14:46:18,623 This folder is ignored from git and should **never be pushed to git!** 2022-09-08T14:46:18,624 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-09-08T14:46:18,625 ### Session Client & Example 2022-09-08T14:46:18,626 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. 2022-09-08T14:46:18,627 Or, another simple example: 2022-09-08T14:46:18,628 ```python 2022-09-08T14:46:18,628 from iotdb.Session import Session 2022-09-08T14:46:18,629 ip = "127.0.0.1" 2022-09-08T14:46:18,629 port_ = "6667" 2022-09-08T14:46:18,629 username_ = "root" 2022-09-08T14:46:18,630 password_ = "root" 2022-09-08T14:46:18,630 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:18,630 session.open(False) 2022-09-08T14:46:18,631 zone = session.get_time_zone() 2022-09-08T14:46:18,631 session.close() 2022-09-08T14:46:18,631 ``` 2022-09-08T14:46:18,632 ### Tests 2022-09-08T14:46:18,633 Please add your custom tests in `tests` folder. 2022-09-08T14:46:18,633 To run all defined tests just type `pytest .` in the root folder. 2022-09-08T14:46:18,634 **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). 2022-09-08T14:46:18,635 ### Futher Tools 2022-09-08T14:46:18,636 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-09-08T14:46:18,636 Both can be run by `black .` or `flake8 .` respectively. 2022-09-08T14:46:18,637 ## Releasing 2022-09-08T14:46:18,638 To do a release just ensure that you have the right set of generated thrift files. 2022-09-08T14:46:18,638 Then run linting and auto-formatting. 2022-09-08T14:46:18,639 Then, ensure that all tests work (via `pytest .`). 2022-09-08T14:46:18,639 Then you are good to go to do a release! 2022-09-08T14:46:18,640 ### Preparing your environment 2022-09-08T14:46:18,641 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-09-08T14:46:18,642 ### Doing the Release 2022-09-08T14:46:18,642 There is a convenient script `release.sh` to do all steps for a release. 2022-09-08T14:46:18,643 Namely, these are 2022-09-08T14:46:18,643 * Remove all transient directories from last release (if exists) 2022-09-08T14:46:18,644 * (Re-)generate all generated sources via mvn 2022-09-08T14:46:18,644 * Run Linting (flake8) 2022-09-08T14:46:18,644 * Run Tests via pytest 2022-09-08T14:46:18,644 * Build 2022-09-08T14:46:18,645 * Release to pypi 2022-09-08T14:46:22,908 running dist_info 2022-09-08T14:46:23,565 creating /tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info 2022-09-08T14:46:24,186 writing /tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/PKG-INFO 2022-09-08T14:46:24,784 writing dependency_links to /tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/dependency_links.txt 2022-09-08T14:46:27,720 writing requirements to /tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/requires.txt 2022-09-08T14:46:28,316 writing top-level names to /tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/top_level.txt 2022-09-08T14:46:28,319 writing manifest file '/tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:29,046 reading manifest file '/tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:29,050 adding license file 'LICENSE' 2022-09-08T14:46:29,058 writing manifest file '/tmp/pip-modern-metadata-smg3sbfn/apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:29,060 creating '/tmp/pip-modern-metadata-smg3sbfn/apache_iotdb-0.13.2.dist-info' 2022-09-08T14:46:29,291 adding license file "LICENSE" (matched pattern "LICEN[CS]E*") 2022-09-08T14:46:29,303 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-09-08T14:46:29,303 warnings.warn(msg) 2022-09-08T14:46:29,528 Preparing metadata (pyproject.toml): finished with status 'done' 2022-09-08T14:46:29,548 Source in /tmp/pip-wheel-sfdywcno/apache-iotdb_1794f0c2d3d94f40903c1733a4017600 has version 0.13.2, which satisfies requirement apache-iotdb==0.13.2 from https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz#sha256=1cce6e24f56457bd8195bb82b8e3d7924dfeb66a5458d7e137cbc0a9a0939de1 2022-09-08T14:46:29,550 Removed apache-iotdb==0.13.2 from https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz#sha256=1cce6e24f56457bd8195bb82b8e3d7924dfeb66a5458d7e137cbc0a9a0939de1 from build tracker '/tmp/pip-build-tracker-54r643a2' 2022-09-08T14:46:29,567 Created temporary directory: /tmp/pip-unpack-mx1xmn2m 2022-09-08T14:46:29,568 Building wheels for collected packages: apache-iotdb 2022-09-08T14:46:29,578 Created temporary directory: /tmp/pip-wheel-gztycs74 2022-09-08T14:46:29,579 Destination directory: /tmp/pip-wheel-gztycs74 2022-09-08T14:46:29,584 Building wheel for apache-iotdb (pyproject.toml): started 2022-09-08T14:46:29,586 Running command Building wheel for apache-iotdb (pyproject.toml) 2022-09-08T14:46:31,430 2022-09-08T14:46:31,438 # Apache IoTDB 2022-09-08T14:46:31,438 [![Main Mac and Linux](https://github.com/apache/iotdb/actions/workflows/main-unix.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-unix.yml) 2022-09-08T14:46:31,439 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2022-09-08T14:46:31,439 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-09-08T14:46:31,439 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-09-08T14:46:31,440 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-09-08T14:46:31,440 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-09-08T14:46:31,440 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-09-08T14:46:31,441 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-09-08T14:46:31,441 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-09-08T14:46:31,441 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-09-08T14:46:31,442 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-09-08T14:46:31,443 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-09-08T14:46:31,443 architecture, high performance and rich feature set together with its deep integration with 2022-09-08T14:46:31,444 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-09-08T14:46:31,444 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-09-08T14:46:31,445 ## Python Native API 2022-09-08T14:46:31,446 ### Requirements 2022-09-08T14:46:31,446 You have to install thrift (>=0.13) before using the package. 2022-09-08T14:46:31,448 ### How to use (Example) 2022-09-08T14:46:31,448 First, download the latest package: `pip3 install apache-iotdb` 2022-09-08T14:46:31,449 *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!* 2022-09-08T14:46:31,450 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) 2022-09-08T14:46:31,451 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-09-08T14:46:31,451 (you need to add `import iotdb` in the head of the file) 2022-09-08T14:46:31,452 Or: 2022-09-08T14:46:31,453 ```python 2022-09-08T14:46:31,453 from iotdb.Session import Session 2022-09-08T14:46:31,454 ip = "127.0.0.1" 2022-09-08T14:46:31,455 port_ = "6667" 2022-09-08T14:46:31,455 username_ = "root" 2022-09-08T14:46:31,456 password_ = "root" 2022-09-08T14:46:31,456 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:31,456 session.open(False) 2022-09-08T14:46:31,457 zone = session.get_time_zone() 2022-09-08T14:46:31,457 session.close() 2022-09-08T14:46:31,457 ``` 2022-09-08T14:46:31,458 ### Initialization 2022-09-08T14:46:31,459 * Initialize a Session 2022-09-08T14:46:31,459 ```python 2022-09-08T14:46:31,460 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-09-08T14:46:31,460 ``` 2022-09-08T14:46:31,461 * Open a session, with a parameter to specify whether to enable RPC compression 2022-09-08T14:46:31,461 ```python 2022-09-08T14:46:31,462 session.open(enable_rpc_compression=False) 2022-09-08T14:46:31,462 ``` 2022-09-08T14:46:31,462 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-09-08T14:46:31,463 * Close a Session 2022-09-08T14:46:31,464 ```python 2022-09-08T14:46:31,464 session.close() 2022-09-08T14:46:31,464 ``` 2022-09-08T14:46:31,465 ### Data Definition Interface (DDL Interface) 2022-09-08T14:46:31,466 #### Storage Group Management 2022-09-08T14:46:31,466 * Set storage group 2022-09-08T14:46:31,467 ```python 2022-09-08T14:46:31,467 session.set_storage_group(group_name) 2022-09-08T14:46:31,467 ``` 2022-09-08T14:46:31,468 * Delete one or several storage groups 2022-09-08T14:46:31,469 ```python 2022-09-08T14:46:31,469 session.delete_storage_group(group_name) 2022-09-08T14:46:31,469 session.delete_storage_groups(group_name_lst) 2022-09-08T14:46:31,470 ``` 2022-09-08T14:46:31,470 #### Timeseries Management 2022-09-08T14:46:31,471 * Create one or multiple timeseries 2022-09-08T14:46:31,471 ```python 2022-09-08T14:46:31,471 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-09-08T14:46:31,472 props=None, tags=None, attributes=None, alias=None) 2022-09-08T14:46:31,472 session.create_multi_time_series( 2022-09-08T14:46:31,473 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-09-08T14:46:31,473 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-09-08T14:46:31,473 ) 2022-09-08T14:46:31,474 ``` 2022-09-08T14:46:31,474 * Create aligned timeseries 2022-09-08T14:46:31,475 ```python 2022-09-08T14:46:31,475 session.create_aligned_time_series( 2022-09-08T14:46:31,476 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-09-08T14:46:31,476 ) 2022-09-08T14:46:31,476 ``` 2022-09-08T14:46:31,477 Attention: Alias of measurements are **not supported** currently. 2022-09-08T14:46:31,478 * Delete one or several timeseries 2022-09-08T14:46:31,478 ```python 2022-09-08T14:46:31,478 session.delete_time_series(paths_list) 2022-09-08T14:46:31,479 ``` 2022-09-08T14:46:31,479 * Check whether the specific timeseries exists 2022-09-08T14:46:31,480 ```python 2022-09-08T14:46:31,480 session.check_time_series_exists(path) 2022-09-08T14:46:31,481 ``` 2022-09-08T14:46:31,481 ### Data Manipulation Interface (DML Interface) 2022-09-08T14:46:31,482 #### Insert 2022-09-08T14:46:31,482 It is recommended to use insertTablet to help improve write efficiency. 2022-09-08T14:46:31,483 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-09-08T14:46:31,483 * **Better Write Performance** 2022-09-08T14:46:31,484 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-09-08T14:46:31,485 We have two implementations of Tablet in Python API. 2022-09-08T14:46:31,485 * Normal Tablet 2022-09-08T14:46:31,486 ```python 2022-09-08T14:46:31,486 values_ = [ 2022-09-08T14:46:31,486 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-09-08T14:46:31,487 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-09-08T14:46:31,487 [False, 100, 1, 188.1, 688.25, "test03"], 2022-09-08T14:46:31,488 [True, 0, 0, 0, 6.25, "test04"], 2022-09-08T14:46:31,488 ] 2022-09-08T14:46:31,488 timestamps_ = [1, 2, 3, 4] 2022-09-08T14:46:31,489 tablet_ = Tablet( 2022-09-08T14:46:31,489 device_id, measurements_, data_types_, values_, timestamps_ 2022-09-08T14:46:31,490 ) 2022-09-08T14:46:31,490 session.insert_tablet(tablet_) 2022-09-08T14:46:31,490 ``` 2022-09-08T14:46:31,491 * Numpy Tablet 2022-09-08T14:46:31,491 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-09-08T14:46:31,492 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-09-08T14:46:31,493 **Notice** 2022-09-08T14:46:31,493 1. time and value columns in Tablet are ndarray. 2022-09-08T14:46:31,493 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-09-08T14:46:31,494 (if not, the default dtypes are also ok). 2022-09-08T14:46:31,494 ```python 2022-09-08T14:46:31,495 import numpy as np 2022-09-08T14:46:31,495 data_types_ = [ 2022-09-08T14:46:31,496 TSDataType.BOOLEAN, 2022-09-08T14:46:31,496 TSDataType.INT32, 2022-09-08T14:46:31,496 TSDataType.INT64, 2022-09-08T14:46:31,497 TSDataType.FLOAT, 2022-09-08T14:46:31,497 TSDataType.DOUBLE, 2022-09-08T14:46:31,498 TSDataType.TEXT, 2022-09-08T14:46:31,498 ] 2022-09-08T14:46:31,498 np_values_ = [ 2022-09-08T14:46:31,499 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-09-08T14:46:31,499 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-09-08T14:46:31,500 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-09-08T14:46:31,500 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-09-08T14:46:31,501 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-09-08T14:46:31,501 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-09-08T14:46:31,501 ] 2022-09-08T14:46:31,502 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-09-08T14:46:31,502 np_tablet_ = NumpyTablet( 2022-09-08T14:46:31,503 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-09-08T14:46:31,503 ) 2022-09-08T14:46:31,503 session.insert_tablet(np_tablet_) 2022-09-08T14:46:31,504 ``` 2022-09-08T14:46:31,504 * Insert multiple Tablets 2022-09-08T14:46:31,505 ```python 2022-09-08T14:46:31,505 session.insert_tablets(tablet_lst) 2022-09-08T14:46:31,506 ``` 2022-09-08T14:46:31,506 * Insert a Record 2022-09-08T14:46:31,507 ```python 2022-09-08T14:46:31,507 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-09-08T14:46:31,507 ``` 2022-09-08T14:46:31,508 * Insert multiple Records 2022-09-08T14:46:31,509 ```python 2022-09-08T14:46:31,509 session.insert_records( 2022-09-08T14:46:31,509 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-09-08T14:46:31,510 ) 2022-09-08T14:46:31,510 ``` 2022-09-08T14:46:31,511 * Insert multiple Records that belong to the same device. 2022-09-08T14:46:31,511 With type info the server has no need to do type inference, which leads a better performance 2022-09-08T14:46:31,512 ```python 2022-09-08T14:46:31,512 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-09-08T14:46:31,512 ``` 2022-09-08T14:46:31,513 #### Insert with type inference 2022-09-08T14:46:31,514 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. 2022-09-08T14:46:31,514 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-09-08T14:46:31,515 ```python 2022-09-08T14:46:31,515 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-09-08T14:46:31,516 ``` 2022-09-08T14:46:31,516 #### Insert of Aligned Timeseries 2022-09-08T14:46:31,517 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-09-08T14:46:31,517 * insert_aligned_record 2022-09-08T14:46:31,518 * insert_aligned_records 2022-09-08T14:46:31,518 * insert_aligned_records_of_one_device 2022-09-08T14:46:31,518 * insert_aligned_tablet 2022-09-08T14:46:31,519 * insert_aligned_tablets 2022-09-08T14:46:31,520 ### IoTDB-SQL Interface 2022-09-08T14:46:31,520 * Execute query statement 2022-09-08T14:46:31,521 ```python 2022-09-08T14:46:31,521 session.execute_query_statement(sql) 2022-09-08T14:46:31,521 ``` 2022-09-08T14:46:31,522 * Execute non query statement 2022-09-08T14:46:31,523 ```python 2022-09-08T14:46:31,523 session.execute_non_query_statement(sql) 2022-09-08T14:46:31,523 ``` 2022-09-08T14:46:31,524 ### Pandas Support 2022-09-08T14:46:31,525 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-09-08T14:46:31,525 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-09-08T14:46:31,526 Example: 2022-09-08T14:46:31,526 ```python 2022-09-08T14:46:31,526 from iotdb.Session import Session 2022-09-08T14:46:31,527 ip = "127.0.0.1" 2022-09-08T14:46:31,527 port_ = "6667" 2022-09-08T14:46:31,528 username_ = "root" 2022-09-08T14:46:31,528 password_ = "root" 2022-09-08T14:46:31,528 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:31,529 session.open(False) 2022-09-08T14:46:31,529 result = session.execute_query_statement("SELECT * FROM root.*") 2022-09-08T14:46:31,530 # Transform to Pandas Dataset 2022-09-08T14:46:31,530 df = result.todf() 2022-09-08T14:46:31,530 session.close() 2022-09-08T14:46:31,531 # Now you can work with the dataframe 2022-09-08T14:46:31,531 df = ... 2022-09-08T14:46:31,532 ``` 2022-09-08T14:46:31,533 ### IoTDB Testcontainer 2022-09-08T14:46:31,533 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. 2022-09-08T14:46:31,534 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-09-08T14:46:31,534 ```python 2022-09-08T14:46:31,534 class MyTestCase(unittest.TestCase): 2022-09-08T14:46:31,535 def test_something(self): 2022-09-08T14:46:31,535 with IoTDBContainer() as c: 2022-09-08T14:46:31,536 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-09-08T14:46:31,536 session.open(False) 2022-09-08T14:46:31,536 result = session.execute_query_statement("SHOW TIMESERIES") 2022-09-08T14:46:31,537 print(result) 2022-09-08T14:46:31,537 session.close() 2022-09-08T14:46:31,537 ``` 2022-09-08T14:46:31,538 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. 2022-09-08T14:46:31,539 ## Developers 2022-09-08T14:46:31,539 ### Introduction 2022-09-08T14:46:31,540 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. 2022-09-08T14:46:31,541 ### Prerequisites 2022-09-08T14:46:31,542 Python3.7 or later is preferred. 2022-09-08T14:46:31,542 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. 2022-09-08T14:46:31,543 ``` 2022-09-08T14:46:31,543 http://thrift.apache.org/docs/install/ 2022-09-08T14:46:31,544 ``` 2022-09-08T14:46:31,544 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-09-08T14:46:31,545 ```shell 2022-09-08T14:46:31,545 pip install -r requirements_dev.txt 2022-09-08T14:46:31,545 ``` 2022-09-08T14:46:31,546 ### Compile the thrift library and Debug 2022-09-08T14:46:31,547 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-09-08T14:46:31,548 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-09-08T14:46:31,548 This folder is ignored from git and should **never be pushed to git!** 2022-09-08T14:46:31,548 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-09-08T14:46:31,550 ### Session Client & Example 2022-09-08T14:46:31,551 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. 2022-09-08T14:46:31,552 Or, another simple example: 2022-09-08T14:46:31,552 ```python 2022-09-08T14:46:31,553 from iotdb.Session import Session 2022-09-08T14:46:31,553 ip = "127.0.0.1" 2022-09-08T14:46:31,553 port_ = "6667" 2022-09-08T14:46:31,554 username_ = "root" 2022-09-08T14:46:31,554 password_ = "root" 2022-09-08T14:46:31,554 session = Session(ip, port_, username_, password_) 2022-09-08T14:46:31,555 session.open(False) 2022-09-08T14:46:31,555 zone = session.get_time_zone() 2022-09-08T14:46:31,555 session.close() 2022-09-08T14:46:31,555 ``` 2022-09-08T14:46:31,557 ### Tests 2022-09-08T14:46:31,557 Please add your custom tests in `tests` folder. 2022-09-08T14:46:31,558 To run all defined tests just type `pytest .` in the root folder. 2022-09-08T14:46:31,558 **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). 2022-09-08T14:46:31,560 ### Futher Tools 2022-09-08T14:46:31,560 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-09-08T14:46:31,561 Both can be run by `black .` or `flake8 .` respectively. 2022-09-08T14:46:31,562 ## Releasing 2022-09-08T14:46:31,562 To do a release just ensure that you have the right set of generated thrift files. 2022-09-08T14:46:31,563 Then run linting and auto-formatting. 2022-09-08T14:46:31,563 Then, ensure that all tests work (via `pytest .`). 2022-09-08T14:46:31,563 Then you are good to go to do a release! 2022-09-08T14:46:31,564 ### Preparing your environment 2022-09-08T14:46:31,565 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-09-08T14:46:31,566 ### Doing the Release 2022-09-08T14:46:31,567 There is a convenient script `release.sh` to do all steps for a release. 2022-09-08T14:46:31,567 Namely, these are 2022-09-08T14:46:31,568 * Remove all transient directories from last release (if exists) 2022-09-08T14:46:31,568 * (Re-)generate all generated sources via mvn 2022-09-08T14:46:31,568 * Run Linting (flake8) 2022-09-08T14:46:31,569 * Run Tests via pytest 2022-09-08T14:46:31,569 * Build 2022-09-08T14:46:31,569 * Release to pypi 2022-09-08T14:46:35,304 running bdist_wheel 2022-09-08T14:46:36,525 running build 2022-09-08T14:46:36,526 running build_py 2022-09-08T14:46:37,151 creating build 2022-09-08T14:46:37,152 creating build/lib 2022-09-08T14:46:37,153 creating build/lib/tests 2022-09-08T14:46:37,155 copying tests/test_aligned_timeseries.py -> build/lib/tests 2022-09-08T14:46:37,160 copying tests/test_session.py -> build/lib/tests 2022-09-08T14:46:37,164 copying tests/__init__.py -> build/lib/tests 2022-09-08T14:46:37,168 copying tests/test_todf.py -> build/lib/tests 2022-09-08T14:46:37,172 copying tests/tablet_performance_comparison.py -> build/lib/tests 2022-09-08T14:46:37,175 copying tests/test_tablet.py -> build/lib/tests 2022-09-08T14:46:37,179 copying tests/test_numpy_tablet.py -> build/lib/tests 2022-09-08T14:46:37,183 copying tests/test_dataframe.py -> build/lib/tests 2022-09-08T14:46:37,187 creating build/lib/iotdb 2022-09-08T14:46:37,188 copying iotdb/Session.py -> build/lib/iotdb 2022-09-08T14:46:37,194 copying iotdb/__init__.py -> build/lib/iotdb 2022-09-08T14:46:37,197 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2022-09-08T14:46:37,201 creating build/lib/iotdb/thrift 2022-09-08T14:46:37,203 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2022-09-08T14:46:37,207 creating build/lib/iotdb/utils 2022-09-08T14:46:37,209 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,213 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,216 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,220 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,223 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,226 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,230 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,233 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,236 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2022-09-08T14:46:37,242 creating build/lib/iotdb/thrift/rpc 2022-09-08T14:46:37,243 copying iotdb/thrift/rpc/TSIService.py -> build/lib/iotdb/thrift/rpc 2022-09-08T14:46:37,262 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2022-09-08T14:46:37,279 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2022-09-08T14:46:37,282 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2022-09-08T14:46:38,546 installing to build/bdist.linux-armv7l/wheel 2022-09-08T14:46:38,546 running install 2022-09-08T14:46:38,607 running install_lib 2022-09-08T14:46:39,234 creating build/bdist.linux-armv7l 2022-09-08T14:46:39,234 creating build/bdist.linux-armv7l/wheel 2022-09-08T14:46:39,238 creating build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,240 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,245 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,249 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,252 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,257 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,261 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,265 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,269 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2022-09-08T14:46:39,273 creating build/bdist.linux-armv7l/wheel/iotdb 2022-09-08T14:46:39,275 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-09-08T14:46:39,281 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-09-08T14:46:39,285 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2022-09-08T14:46:39,287 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2022-09-08T14:46:39,291 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-09-08T14:46:39,292 copying build/lib/iotdb/thrift/rpc/TSIService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-09-08T14:46:39,312 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-09-08T14:46:39,329 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-09-08T14:46:39,333 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-09-08T14:46:39,337 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,339 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,343 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,346 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,350 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,354 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,357 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,361 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,364 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,368 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-09-08T14:46:39,373 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-09-08T14:46:39,376 running install_egg_info 2022-09-08T14:46:40,707 running egg_info 2022-09-08T14:46:41,333 writing apache_iotdb.egg-info/PKG-INFO 2022-09-08T14:46:41,924 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2022-09-08T14:46:44,872 writing requirements to apache_iotdb.egg-info/requires.txt 2022-09-08T14:46:45,461 writing top-level names to apache_iotdb.egg-info/top_level.txt 2022-09-08T14:46:45,508 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:45,512 adding license file 'LICENSE' 2022-09-08T14:46:45,520 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-09-08T14:46:45,523 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.2-py3.7.egg-info 2022-09-08T14:46:45,545 running install_scripts 2022-09-08T14:46:45,712 adding license file "LICENSE" (matched pattern "LICEN[CS]E*") 2022-09-08T14:46:45,722 creating build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.2.dist-info/WHEEL 2022-09-08T14:46:45,726 creating '/tmp/pip-wheel-gztycs74/tmpc589p8ug/apache_iotdb-0.13.2-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2022-09-08T14:46:45,733 adding 'iotdb/IoTDBContainer.py' 2022-09-08T14:46:45,743 adding 'iotdb/Session.py' 2022-09-08T14:46:45,746 adding 'iotdb/__init__.py' 2022-09-08T14:46:45,748 adding 'iotdb/thrift/__init__.py' 2022-09-08T14:46:45,778 adding 'iotdb/thrift/rpc/TSIService.py' 2022-09-08T14:46:45,786 adding 'iotdb/thrift/rpc/__init__.py' 2022-09-08T14:46:45,788 adding 'iotdb/thrift/rpc/constants.py' 2022-09-08T14:46:45,816 adding 'iotdb/thrift/rpc/ttypes.py' 2022-09-08T14:46:45,825 adding 'iotdb/utils/BitMap.py' 2022-09-08T14:46:45,828 adding 'iotdb/utils/Field.py' 2022-09-08T14:46:45,831 adding 'iotdb/utils/IoTDBConstants.py' 2022-09-08T14:46:45,835 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2022-09-08T14:46:45,838 adding 'iotdb/utils/NumpyTablet.py' 2022-09-08T14:46:45,841 adding 'iotdb/utils/RowRecord.py' 2022-09-08T14:46:45,844 adding 'iotdb/utils/SessionDataSet.py' 2022-09-08T14:46:45,847 adding 'iotdb/utils/Tablet.py' 2022-09-08T14:46:45,850 adding 'iotdb/utils/__init__.py' 2022-09-08T14:46:45,853 adding 'tests/__init__.py' 2022-09-08T14:46:45,857 adding 'tests/tablet_performance_comparison.py' 2022-09-08T14:46:45,860 adding 'tests/test_aligned_timeseries.py' 2022-09-08T14:46:45,863 adding 'tests/test_dataframe.py' 2022-09-08T14:46:45,866 adding 'tests/test_numpy_tablet.py' 2022-09-08T14:46:45,870 adding 'tests/test_session.py' 2022-09-08T14:46:45,872 adding 'tests/test_tablet.py' 2022-09-08T14:46:45,875 adding 'tests/test_todf.py' 2022-09-08T14:46:45,881 adding 'apache_iotdb-0.13.2.dist-info/LICENSE' 2022-09-08T14:46:45,885 adding 'apache_iotdb-0.13.2.dist-info/METADATA' 2022-09-08T14:46:45,887 adding 'apache_iotdb-0.13.2.dist-info/WHEEL' 2022-09-08T14:46:45,889 adding 'apache_iotdb-0.13.2.dist-info/top_level.txt' 2022-09-08T14:46:45,891 adding 'apache_iotdb-0.13.2.dist-info/RECORD' 2022-09-08T14:46:45,897 removing build/bdist.linux-armv7l/wheel 2022-09-08T14:46:45,920 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-09-08T14:46:45,920 warnings.warn(msg) 2022-09-08T14:46:46,177 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2022-09-08T14:46:46,195 Created wheel for apache-iotdb: filename=apache_iotdb-0.13.2-py3-none-any.whl size=75607 sha256=136811be5cdfe045bc349a8f6c0b07117600185c0c7ada8353610179adde27ae 2022-09-08T14:46:46,197 Stored in directory: /tmp/pip-ephem-wheel-cache-pvnhjbro/wheels/b6/ab/ef/baf5678754857ba7ed8ff0704164048569c6f2917a20807317 2022-09-08T14:46:46,225 Successfully built apache-iotdb 2022-09-08T14:46:46,239 Removed build tracker: '/tmp/pip-build-tracker-54r643a2'