2022-08-09T09:22:59,662 Created temporary directory: /tmp/pip-ephem-wheel-cache-w6_x9s9a 2022-08-09T09:22:59,667 Created temporary directory: /tmp/pip-build-tracker-7u95u_wy 2022-08-09T09:22:59,668 Initialized build tracking at /tmp/pip-build-tracker-7u95u_wy 2022-08-09T09:22:59,669 Created build tracker: /tmp/pip-build-tracker-7u95u_wy 2022-08-09T09:22:59,669 Entered build tracker: /tmp/pip-build-tracker-7u95u_wy 2022-08-09T09:22:59,670 Created temporary directory: /tmp/pip-wheel-mpsfo2rb 2022-08-09T09:22:59,740 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2022-08-09T09:22:59,749 2 location(s) to search for versions of apache-iotdb: 2022-08-09T09:22:59,749 * https://pypi.org/simple/apache-iotdb/ 2022-08-09T09:22:59,749 * https://www.piwheels.org/simple/apache-iotdb/ 2022-08-09T09:22:59,750 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2022-08-09T09:22:59,751 Getting page https://pypi.org/simple/apache-iotdb/ 2022-08-09T09:22:59,755 Found index url https://pypi.org/simple 2022-08-09T09:22:59,972 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-08-09T09:22:59,973 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-08-09T09:22:59,974 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-08-09T09:22:59,975 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-08-09T09:22:59,976 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-08-09T09:22:59,977 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-08-09T09:22:59,978 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-08-09T09:22:59,979 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-08-09T09:22:59,980 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-08-09T09:22:59,981 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-08-09T09:22:59,982 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-08-09T09:22:59,983 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-08-09T09:22:59,985 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-08-09T09:22:59,985 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-08-09T09:22:59,987 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-08-09T09:22:59,987 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-08-09T09:22:59,989 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-08-09T09:22:59,989 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-08-09T09:22:59,991 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-08-09T09:22:59,991 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-08-09T09:22:59,993 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-08-09T09:22:59,994 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-08-09T09:22:59,995 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-08-09T09:22:59,996 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-08-09T09:22:59,997 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-08-09T09:22:59,998 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-08-09T09:22:59,999 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-08-09T09:23:00,000 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-08-09T09:23:00,001 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-08-09T09:23:00,002 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-08-09T09:23:00,003 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-08-09T09:23:00,004 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-08-09T09:23:00,005 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-08-09T09:23:00,006 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-08-09T09:23:00,007 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-08-09T09:23:00,008 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-08-09T09:23:00,009 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-08-09T09:23:00,010 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-08-09T09:23:00,011 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-08-09T09:23:00,012 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-08-09T09:23:00,013 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-08-09T09:23:00,014 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-08-09T09:23:00,015 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2022-08-09T09:23:00,015 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2022-08-09T09:23:00,018 Found index url https://www.piwheels.org/simple 2022-08-09T09:23:00,253 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-08-09T09:23:00,253 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-08-09T09:23:00,254 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-08-09T09:23:00,255 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-08-09T09:23:00,255 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-08-09T09:23:00,256 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-08-09T09:23:00,256 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-08-09T09:23:00,257 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-08-09T09:23:00,257 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-08-09T09:23:00,258 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-08-09T09:23:00,258 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-08-09T09:23:00,259 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-08-09T09:23:00,260 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-08-09T09:23:00,260 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-08-09T09:23:00,261 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-08-09T09:23:00,261 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-08-09T09:23:00,262 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-08-09T09:23:00,262 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-08-09T09:23:00,263 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-08-09T09:23:00,263 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-08-09T09:23:00,264 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2022-08-09T09:23:00,265 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2022-08-09T09:23:00,305 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2022-08-09T09:23:00,340 Collecting apache-iotdb==0.13.1 2022-08-09T09:23:00,344 Created temporary directory: /tmp/pip-unpack-5ulgq5vi 2022-08-09T09:23:00,859 Downloading apache-iotdb-0.13.1.tar.gz (58 kB) 2022-08-09T09:23:01,124 Added apache-iotdb==0.13.1 from https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz#sha256=93f9d4d49f688166596691a8d3ec0606332ab2e39dfe174f007a8134246ac415 to build tracker '/tmp/pip-build-tracker-7u95u_wy' 2022-08-09T09:23:01,133 Created temporary directory: /tmp/pip-build-env-wy6372ec 2022-08-09T09:23:01,148 Created temporary directory: /tmp/pip-standalone-pip-zwyz4sh_ 2022-08-09T09:23:03,499 Installing build dependencies: started 2022-08-09T09:23:03,501 Running command pip subprocess to install build dependencies 2022-08-09T09:23:13,080 Using pip 22.1.2 from /tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip (python 3.7) 2022-08-09T09:23:14,552 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2022-08-09T09:23:18,638 Collecting setuptools>=40.8.0 2022-08-09T09:23:18,913 Using cached https://www.piwheels.org/simple/setuptools/setuptools-63.4.2-py3-none-any.whl (1.2 MB) 2022-08-09T09:23:19,656 Collecting wheel 2022-08-09T09:23:19,695 Using cached https://www.piwheels.org/simple/wheel/wheel-0.37.1-py2.py3-none-any.whl (35 kB) 2022-08-09T09:23:25,626 Installing collected packages: wheel, setuptools 2022-08-09T09:23:25,897 Creating /tmp/pip-build-env-wy6372ec/overlay/bin 2022-08-09T09:23:25,902 changing mode of /tmp/pip-build-env-wy6372ec/overlay/bin/wheel to 755 2022-08-09T09:23:30,739 Successfully installed setuptools-63.4.2 wheel-0.37.1 2022-08-09T09:23:30,971 --- Logging error --- 2022-08-09T09:23:30,971 Traceback (most recent call last): 2022-08-09T09:23:30,972 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/utils/logging.py", line 177, in emit 2022-08-09T09:23:30,972 self.console.print(renderable, overflow="ignore", crop=False, style=style) 2022-08-09T09:23:30,972 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_vendor/rich/console.py", line 1752, in print 2022-08-09T09:23:30,973 extend(render(renderable, render_options)) 2022-08-09T09:23:30,973 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_vendor/rich/console.py", line 1390, in render 2022-08-09T09:23:30,974 for render_output in iter_render: 2022-08-09T09:23:30,974 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/utils/logging.py", line 134, in __rich_console__ 2022-08-09T09:23:30,974 for line in lines: 2022-08-09T09:23:30,975 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_vendor/rich/segment.py", line 245, in split_lines 2022-08-09T09:23:30,975 for segment in segments: 2022-08-09T09:23:30,975 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_vendor/rich/console.py", line 1368, in render 2022-08-09T09:23:30,976 renderable = rich_cast(renderable) 2022-08-09T09:23:30,976 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_vendor/rich/protocol.py", line 36, in rich_cast 2022-08-09T09:23:30,976 renderable = cast_method() 2022-08-09T09:23:30,977 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/self_outdated_check.py", line 130, in __rich__ 2022-08-09T09:23:30,977 pip_cmd = get_best_invocation_for_this_pip() 2022-08-09T09:23:30,977 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/utils/entrypoints.py", line 60, in get_best_invocation_for_this_pip 2022-08-09T09:23:30,978 os.path.join(binary_prefix, exe_name), 2022-08-09T09:23:30,978 File "/usr/lib/python3.7/genericpath.py", line 97, in samefile 2022-08-09T09:23:30,978 s2 = os.stat(f2) 2022-08-09T09:23:30,979 FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pip3.7' 2022-08-09T09:23:30,979 Call stack: 2022-08-09T09:23:30,979 File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main 2022-08-09T09:23:30,980 "__main__", mod_spec) 2022-08-09T09:23:30,980 File "/usr/lib/python3.7/runpy.py", line 85, in _run_code 2022-08-09T09:23:30,980 exec(code, run_globals) 2022-08-09T09:23:30,981 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/__main__.py", line 31, in 2022-08-09T09:23:30,981 sys.exit(_main()) 2022-08-09T09:23:30,981 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/cli/main.py", line 70, in main 2022-08-09T09:23:30,981 return command.main(cmd_args) 2022-08-09T09:23:30,982 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/cli/base_command.py", line 101, in main 2022-08-09T09:23:30,982 return self._main(args) 2022-08-09T09:23:30,982 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/cli/base_command.py", line 223, in _main 2022-08-09T09:23:30,983 self.handle_pip_version_check(options) 2022-08-09T09:23:30,983 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/cli/req_command.py", line 148, in handle_pip_version_check 2022-08-09T09:23:30,983 pip_self_version_check(session, options) 2022-08-09T09:23:30,984 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/self_outdated_check.py", line 237, in pip_self_version_check 2022-08-09T09:23:30,984 logger.info("[present-rich] %s", upgrade_prompt) 2022-08-09T09:23:30,984 File "/usr/lib/python3.7/logging/__init__.py", line 1383, in info 2022-08-09T09:23:30,985 self._log(INFO, msg, args, **kwargs) 2022-08-09T09:23:30,985 File "/usr/lib/python3.7/logging/__init__.py", line 1519, in _log 2022-08-09T09:23:30,985 self.handle(record) 2022-08-09T09:23:30,986 File "/usr/lib/python3.7/logging/__init__.py", line 1529, in handle 2022-08-09T09:23:30,986 self.callHandlers(record) 2022-08-09T09:23:30,986 File "/usr/lib/python3.7/logging/__init__.py", line 1591, in callHandlers 2022-08-09T09:23:30,987 hdlr.handle(record) 2022-08-09T09:23:30,987 File "/usr/lib/python3.7/logging/__init__.py", line 905, in handle 2022-08-09T09:23:30,987 self.emit(record) 2022-08-09T09:23:30,988 File "/tmp/pip-standalone-pip-zwyz4sh_/__env_pip__.zip/pip/_internal/utils/logging.py", line 179, in emit 2022-08-09T09:23:30,988 self.handleError(record) 2022-08-09T09:23:30,988 Message: '[present-rich] %s' 2022-08-09T09:23:30,989 Arguments: (UpgradePrompt(old='22.1.2', new='22.2.2'),) 2022-08-09T09:23:31,427 Installing build dependencies: finished with status 'done' 2022-08-09T09:23:31,454 Getting requirements to build wheel: started 2022-08-09T09:23:31,456 Running command Getting requirements to build wheel 2022-08-09T09:23:33,370 2022-08-09T09:23:33,378 # Apache IoTDB 2022-08-09T09:23:33,379 [![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-08-09T09:23:33,379 [![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-08-09T09:23:33,380 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-08-09T09:23:33,380 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-08-09T09:23:33,381 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-08-09T09:23:33,381 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-08-09T09:23:33,381 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-08-09T09:23:33,382 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-08-09T09:23:33,382 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-08-09T09:23:33,383 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-08-09T09:23:33,384 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-08-09T09:23:33,384 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-08-09T09:23:33,385 architecture, high performance and rich feature set together with its deep integration with 2022-08-09T09:23:33,385 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-08-09T09:23:33,385 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-08-09T09:23:33,386 ## Python Native API 2022-08-09T09:23:33,387 ### Requirements 2022-08-09T09:23:33,387 You have to install thrift (>=0.13) before using the package. 2022-08-09T09:23:33,389 ### How to use (Example) 2022-08-09T09:23:33,390 First, download the latest package: `pip3 install apache-iotdb` 2022-08-09T09:23:33,390 *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-08-09T09:23:33,391 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-08-09T09:23:33,392 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-08-09T09:23:33,392 (you need to add `import iotdb` in the head of the file) 2022-08-09T09:23:33,393 Or: 2022-08-09T09:23:33,394 ```python 2022-08-09T09:23:33,394 from iotdb.Session import Session 2022-08-09T09:23:33,395 ip = "127.0.0.1" 2022-08-09T09:23:33,395 port_ = "6667" 2022-08-09T09:23:33,395 username_ = "root" 2022-08-09T09:23:33,396 password_ = "root" 2022-08-09T09:23:33,396 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:33,396 session.open(False) 2022-08-09T09:23:33,396 zone = session.get_time_zone() 2022-08-09T09:23:33,397 session.close() 2022-08-09T09:23:33,397 ``` 2022-08-09T09:23:33,398 ### Initialization 2022-08-09T09:23:33,398 * Initialize a Session 2022-08-09T09:23:33,399 ```python 2022-08-09T09:23:33,399 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-08-09T09:23:33,399 ``` 2022-08-09T09:23:33,400 * Open a session, with a parameter to specify whether to enable RPC compression 2022-08-09T09:23:33,400 ```python 2022-08-09T09:23:33,401 session.open(enable_rpc_compression=False) 2022-08-09T09:23:33,401 ``` 2022-08-09T09:23:33,402 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-08-09T09:23:33,402 * Close a Session 2022-08-09T09:23:33,403 ```python 2022-08-09T09:23:33,404 session.close() 2022-08-09T09:23:33,404 ``` 2022-08-09T09:23:33,404 ### Data Definition Interface (DDL Interface) 2022-08-09T09:23:33,405 #### Storage Group Management 2022-08-09T09:23:33,406 * Set storage group 2022-08-09T09:23:33,406 ```python 2022-08-09T09:23:33,407 session.set_storage_group(group_name) 2022-08-09T09:23:33,407 ``` 2022-08-09T09:23:33,408 * Delete one or several storage groups 2022-08-09T09:23:33,408 ```python 2022-08-09T09:23:33,409 session.delete_storage_group(group_name) 2022-08-09T09:23:33,409 session.delete_storage_groups(group_name_lst) 2022-08-09T09:23:33,410 ``` 2022-08-09T09:23:33,410 #### Timeseries Management 2022-08-09T09:23:33,410 * Create one or multiple timeseries 2022-08-09T09:23:33,411 ```python 2022-08-09T09:23:33,412 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-08-09T09:23:33,412 props=None, tags=None, attributes=None, alias=None) 2022-08-09T09:23:33,413 session.create_multi_time_series( 2022-08-09T09:23:33,413 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-08-09T09:23:33,413 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-08-09T09:23:33,414 ) 2022-08-09T09:23:33,414 ``` 2022-08-09T09:23:33,415 * Create aligned timeseries 2022-08-09T09:23:33,415 ```python 2022-08-09T09:23:33,416 session.create_aligned_time_series( 2022-08-09T09:23:33,416 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-08-09T09:23:33,416 ) 2022-08-09T09:23:33,417 ``` 2022-08-09T09:23:33,417 Attention: Alias of measurements are **not supported** currently. 2022-08-09T09:23:33,418 * Delete one or several timeseries 2022-08-09T09:23:33,419 ```python 2022-08-09T09:23:33,419 session.delete_time_series(paths_list) 2022-08-09T09:23:33,419 ``` 2022-08-09T09:23:33,420 * Check whether the specific timeseries exists 2022-08-09T09:23:33,421 ```python 2022-08-09T09:23:33,421 session.check_time_series_exists(path) 2022-08-09T09:23:33,421 ``` 2022-08-09T09:23:33,422 ### Data Manipulation Interface (DML Interface) 2022-08-09T09:23:33,423 #### Insert 2022-08-09T09:23:33,423 It is recommended to use insertTablet to help improve write efficiency. 2022-08-09T09:23:33,424 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-08-09T09:23:33,424 * **Better Write Performance** 2022-08-09T09:23:33,425 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-08-09T09:23:33,426 We have two implementations of Tablet in Python API. 2022-08-09T09:23:33,426 * Normal Tablet 2022-08-09T09:23:33,427 ```python 2022-08-09T09:23:33,427 values_ = [ 2022-08-09T09:23:33,428 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-08-09T09:23:33,428 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-08-09T09:23:33,428 [False, 100, 1, 188.1, 688.25, "test03"], 2022-08-09T09:23:33,428 [True, 0, 0, 0, 6.25, "test04"], 2022-08-09T09:23:33,429 ] 2022-08-09T09:23:33,429 timestamps_ = [1, 2, 3, 4] 2022-08-09T09:23:33,430 tablet_ = Tablet( 2022-08-09T09:23:33,430 device_id, measurements_, data_types_, values_, timestamps_ 2022-08-09T09:23:33,430 ) 2022-08-09T09:23:33,430 session.insert_tablet(tablet_) 2022-08-09T09:23:33,431 ``` 2022-08-09T09:23:33,431 * Numpy Tablet 2022-08-09T09:23:33,432 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-08-09T09:23:33,432 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-08-09T09:23:33,432 **Notice** 2022-08-09T09:23:33,433 1. time and value columns in Tablet are ndarray. 2022-08-09T09:23:33,433 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-08-09T09:23:33,433 (if not, the default dtypes are also ok). 2022-08-09T09:23:33,434 ```python 2022-08-09T09:23:33,434 data_types_ = [ 2022-08-09T09:23:33,435 TSDataType.BOOLEAN, 2022-08-09T09:23:33,435 TSDataType.INT32, 2022-08-09T09:23:33,435 TSDataType.INT64, 2022-08-09T09:23:33,436 TSDataType.FLOAT, 2022-08-09T09:23:33,436 TSDataType.DOUBLE, 2022-08-09T09:23:33,436 TSDataType.TEXT, 2022-08-09T09:23:33,437 ] 2022-08-09T09:23:33,437 np_values_ = [ 2022-08-09T09:23:33,438 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-08-09T09:23:33,438 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-08-09T09:23:33,438 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-08-09T09:23:33,439 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-08-09T09:23:33,439 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-08-09T09:23:33,439 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-08-09T09:23:33,439 ] 2022-08-09T09:23:33,440 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-08-09T09:23:33,440 np_tablet_ = NumpyTablet( 2022-08-09T09:23:33,440 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-08-09T09:23:33,441 ) 2022-08-09T09:23:33,441 session.insert_tablet(np_tablet_) 2022-08-09T09:23:33,441 ``` 2022-08-09T09:23:33,442 * Insert multiple Tablets 2022-08-09T09:23:33,442 ```python 2022-08-09T09:23:33,443 session.insert_tablets(tablet_lst) 2022-08-09T09:23:33,443 ``` 2022-08-09T09:23:33,444 * Insert a Record 2022-08-09T09:23:33,444 ```python 2022-08-09T09:23:33,445 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-08-09T09:23:33,445 ``` 2022-08-09T09:23:33,446 * Insert multiple Records 2022-08-09T09:23:33,446 ```python 2022-08-09T09:23:33,447 session.insert_records( 2022-08-09T09:23:33,447 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-08-09T09:23:33,447 ) 2022-08-09T09:23:33,448 ``` 2022-08-09T09:23:33,448 * Insert multiple Records that belong to the same device. 2022-08-09T09:23:33,449 With type info the server has no need to do type inference, which leads a better performance 2022-08-09T09:23:33,449 ```python 2022-08-09T09:23:33,450 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-08-09T09:23:33,450 ``` 2022-08-09T09:23:33,451 #### Insert with type inference 2022-08-09T09:23:33,451 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-08-09T09:23:33,452 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-08-09T09:23:33,453 ```python 2022-08-09T09:23:33,453 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-08-09T09:23:33,453 ``` 2022-08-09T09:23:33,454 #### Insert of Aligned Timeseries 2022-08-09T09:23:33,455 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-08-09T09:23:33,455 * insert_aligned_record 2022-08-09T09:23:33,455 * insert_aligned_records 2022-08-09T09:23:33,456 * insert_aligned_records_of_one_device 2022-08-09T09:23:33,456 * insert_aligned_tablet 2022-08-09T09:23:33,456 * insert_aligned_tablets 2022-08-09T09:23:33,457 ### IoTDB-SQL Interface 2022-08-09T09:23:33,458 * Execute query statement 2022-08-09T09:23:33,459 ```python 2022-08-09T09:23:33,459 session.execute_query_statement(sql) 2022-08-09T09:23:33,459 ``` 2022-08-09T09:23:33,460 * Execute non query statement 2022-08-09T09:23:33,461 ```python 2022-08-09T09:23:33,461 session.execute_non_query_statement(sql) 2022-08-09T09:23:33,461 ``` 2022-08-09T09:23:33,462 ### Pandas Support 2022-08-09T09:23:33,463 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-08-09T09:23:33,463 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-08-09T09:23:33,464 Example: 2022-08-09T09:23:33,464 ```python 2022-08-09T09:23:33,465 from iotdb.Session import Session 2022-08-09T09:23:33,465 ip = "127.0.0.1" 2022-08-09T09:23:33,466 port_ = "6667" 2022-08-09T09:23:33,466 username_ = "root" 2022-08-09T09:23:33,466 password_ = "root" 2022-08-09T09:23:33,467 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:33,467 session.open(False) 2022-08-09T09:23:33,468 result = session.execute_query_statement("SELECT * FROM root.*") 2022-08-09T09:23:33,468 # Transform to Pandas Dataset 2022-08-09T09:23:33,468 df = result.todf() 2022-08-09T09:23:33,469 session.close() 2022-08-09T09:23:33,470 # Now you can work with the dataframe 2022-08-09T09:23:33,470 df = ... 2022-08-09T09:23:33,470 ``` 2022-08-09T09:23:33,471 ### IoTDB Testcontainer 2022-08-09T09:23:33,472 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-08-09T09:23:33,473 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-08-09T09:23:33,473 ```python 2022-08-09T09:23:33,473 class MyTestCase(unittest.TestCase): 2022-08-09T09:23:33,474 def test_something(self): 2022-08-09T09:23:33,474 with IoTDBContainer() as c: 2022-08-09T09:23:33,475 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-08-09T09:23:33,475 session.open(False) 2022-08-09T09:23:33,475 result = session.execute_query_statement("SHOW TIMESERIES") 2022-08-09T09:23:33,476 print(result) 2022-08-09T09:23:33,476 session.close() 2022-08-09T09:23:33,477 ``` 2022-08-09T09:23:33,477 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-08-09T09:23:33,478 ## Developers 2022-08-09T09:23:33,479 ### Introduction 2022-08-09T09:23:33,480 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-08-09T09:23:33,481 ### Prerequisites 2022-08-09T09:23:33,481 Python3.7 or later is preferred. 2022-08-09T09:23:33,482 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-08-09T09:23:33,483 ``` 2022-08-09T09:23:33,483 http://thrift.apache.org/docs/install/ 2022-08-09T09:23:33,484 ``` 2022-08-09T09:23:33,484 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-08-09T09:23:33,485 ```shell 2022-08-09T09:23:33,485 pip install -r requirements_dev.txt 2022-08-09T09:23:33,485 ``` 2022-08-09T09:23:33,486 ### Compile the thrift library and Debug 2022-08-09T09:23:33,487 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-08-09T09:23:33,488 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-08-09T09:23:33,488 This folder is ignored from git and should **never be pushed to git!** 2022-08-09T09:23:33,489 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-08-09T09:23:33,490 ### Session Client & Example 2022-08-09T09:23:33,491 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-08-09T09:23:33,492 Or, another simple example: 2022-08-09T09:23:33,492 ```python 2022-08-09T09:23:33,493 from iotdb.Session import Session 2022-08-09T09:23:33,493 ip = "127.0.0.1" 2022-08-09T09:23:33,494 port_ = "6667" 2022-08-09T09:23:33,494 username_ = "root" 2022-08-09T09:23:33,494 password_ = "root" 2022-08-09T09:23:33,495 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:33,495 session.open(False) 2022-08-09T09:23:33,495 zone = session.get_time_zone() 2022-08-09T09:23:33,496 session.close() 2022-08-09T09:23:33,496 ``` 2022-08-09T09:23:33,497 ### Tests 2022-08-09T09:23:33,498 Please add your custom tests in `tests` folder. 2022-08-09T09:23:33,498 To run all defined tests just type `pytest .` in the root folder. 2022-08-09T09:23:33,499 **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-08-09T09:23:33,500 ### Futher Tools 2022-08-09T09:23:33,501 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-08-09T09:23:33,501 Both can be run by `black .` or `flake8 .` respectively. 2022-08-09T09:23:33,502 ## Releasing 2022-08-09T09:23:33,503 To do a release just ensure that you have the right set of generated thrift files. 2022-08-09T09:23:33,503 Then run linting and auto-formatting. 2022-08-09T09:23:33,504 Then, ensure that all tests work (via `pytest .`). 2022-08-09T09:23:33,504 Then you are good to go to do a release! 2022-08-09T09:23:33,505 ### Preparing your environment 2022-08-09T09:23:33,506 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-08-09T09:23:33,507 ### Doing the Release 2022-08-09T09:23:33,508 There is a convenient script `release.sh` to do all steps for a release. 2022-08-09T09:23:33,508 Namely, these are 2022-08-09T09:23:33,509 * Remove all transient directories from last release (if exists) 2022-08-09T09:23:33,509 * (Re-)generate all generated sources via mvn 2022-08-09T09:23:33,510 * Run Linting (flake8) 2022-08-09T09:23:33,510 * Run Tests via pytest 2022-08-09T09:23:33,510 * Build 2022-08-09T09:23:33,510 * Release to pypi 2022-08-09T09:23:37,878 running egg_info 2022-08-09T09:23:38,502 writing apache_iotdb.egg-info/PKG-INFO 2022-08-09T09:23:39,095 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2022-08-09T09:23:42,038 writing requirements to apache_iotdb.egg-info/requires.txt 2022-08-09T09:23:42,633 writing top-level names to apache_iotdb.egg-info/top_level.txt 2022-08-09T09:23:43,363 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:23:43,369 adding license file 'LICENSE' 2022-08-09T09:23:43,376 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:23:43,380 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-08-09T09:23:43,381 warnings.warn(msg) 2022-08-09T09:23:43,597 Getting requirements to build wheel: finished with status 'done' 2022-08-09T09:23:43,618 Created temporary directory: /tmp/pip-modern-metadata-0rnzef_b 2022-08-09T09:23:43,623 Preparing metadata (pyproject.toml): started 2022-08-09T09:23:43,625 Running command Preparing metadata (pyproject.toml) 2022-08-09T09:23:45,447 2022-08-09T09:23:45,455 # Apache IoTDB 2022-08-09T09:23:45,455 [![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-08-09T09:23:45,456 [![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-08-09T09:23:45,456 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-08-09T09:23:45,456 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-08-09T09:23:45,457 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-08-09T09:23:45,457 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-08-09T09:23:45,457 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-08-09T09:23:45,458 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-08-09T09:23:45,458 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-08-09T09:23:45,458 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-08-09T09:23:45,459 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-08-09T09:23:45,460 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-08-09T09:23:45,460 architecture, high performance and rich feature set together with its deep integration with 2022-08-09T09:23:45,460 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-08-09T09:23:45,460 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-08-09T09:23:45,461 ## Python Native API 2022-08-09T09:23:45,462 ### Requirements 2022-08-09T09:23:45,462 You have to install thrift (>=0.13) before using the package. 2022-08-09T09:23:45,464 ### How to use (Example) 2022-08-09T09:23:45,464 First, download the latest package: `pip3 install apache-iotdb` 2022-08-09T09:23:45,465 *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-08-09T09:23:45,465 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-08-09T09:23:45,466 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-08-09T09:23:45,467 (you need to add `import iotdb` in the head of the file) 2022-08-09T09:23:45,467 Or: 2022-08-09T09:23:45,468 ```python 2022-08-09T09:23:45,468 from iotdb.Session import Session 2022-08-09T09:23:45,469 ip = "127.0.0.1" 2022-08-09T09:23:45,469 port_ = "6667" 2022-08-09T09:23:45,469 username_ = "root" 2022-08-09T09:23:45,469 password_ = "root" 2022-08-09T09:23:45,470 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:45,470 session.open(False) 2022-08-09T09:23:45,470 zone = session.get_time_zone() 2022-08-09T09:23:45,471 session.close() 2022-08-09T09:23:45,471 ``` 2022-08-09T09:23:45,472 ### Initialization 2022-08-09T09:23:45,472 * Initialize a Session 2022-08-09T09:23:45,473 ```python 2022-08-09T09:23:45,473 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-08-09T09:23:45,474 ``` 2022-08-09T09:23:45,474 * Open a session, with a parameter to specify whether to enable RPC compression 2022-08-09T09:23:45,475 ```python 2022-08-09T09:23:45,475 session.open(enable_rpc_compression=False) 2022-08-09T09:23:45,475 ``` 2022-08-09T09:23:45,476 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-08-09T09:23:45,477 * Close a Session 2022-08-09T09:23:45,477 ```python 2022-08-09T09:23:45,478 session.close() 2022-08-09T09:23:45,478 ``` 2022-08-09T09:23:45,479 ### Data Definition Interface (DDL Interface) 2022-08-09T09:23:45,479 #### Storage Group Management 2022-08-09T09:23:45,480 * Set storage group 2022-08-09T09:23:45,480 ```python 2022-08-09T09:23:45,481 session.set_storage_group(group_name) 2022-08-09T09:23:45,481 ``` 2022-08-09T09:23:45,482 * Delete one or several storage groups 2022-08-09T09:23:45,482 ```python 2022-08-09T09:23:45,483 session.delete_storage_group(group_name) 2022-08-09T09:23:45,483 session.delete_storage_groups(group_name_lst) 2022-08-09T09:23:45,483 ``` 2022-08-09T09:23:45,484 #### Timeseries Management 2022-08-09T09:23:45,484 * Create one or multiple timeseries 2022-08-09T09:23:45,485 ```python 2022-08-09T09:23:45,485 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-08-09T09:23:45,485 props=None, tags=None, attributes=None, alias=None) 2022-08-09T09:23:45,486 session.create_multi_time_series( 2022-08-09T09:23:45,486 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-08-09T09:23:45,487 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-08-09T09:23:45,487 ) 2022-08-09T09:23:45,487 ``` 2022-08-09T09:23:45,488 * Create aligned timeseries 2022-08-09T09:23:45,489 ```python 2022-08-09T09:23:45,489 session.create_aligned_time_series( 2022-08-09T09:23:45,489 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-08-09T09:23:45,490 ) 2022-08-09T09:23:45,490 ``` 2022-08-09T09:23:45,490 Attention: Alias of measurements are **not supported** currently. 2022-08-09T09:23:45,491 * Delete one or several timeseries 2022-08-09T09:23:45,492 ```python 2022-08-09T09:23:45,492 session.delete_time_series(paths_list) 2022-08-09T09:23:45,492 ``` 2022-08-09T09:23:45,493 * Check whether the specific timeseries exists 2022-08-09T09:23:45,494 ```python 2022-08-09T09:23:45,494 session.check_time_series_exists(path) 2022-08-09T09:23:45,494 ``` 2022-08-09T09:23:45,495 ### Data Manipulation Interface (DML Interface) 2022-08-09T09:23:45,496 #### Insert 2022-08-09T09:23:45,496 It is recommended to use insertTablet to help improve write efficiency. 2022-08-09T09:23:45,497 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-08-09T09:23:45,497 * **Better Write Performance** 2022-08-09T09:23:45,497 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-08-09T09:23:45,498 We have two implementations of Tablet in Python API. 2022-08-09T09:23:45,499 * Normal Tablet 2022-08-09T09:23:45,500 ```python 2022-08-09T09:23:45,500 values_ = [ 2022-08-09T09:23:45,500 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-08-09T09:23:45,500 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-08-09T09:23:45,501 [False, 100, 1, 188.1, 688.25, "test03"], 2022-08-09T09:23:45,501 [True, 0, 0, 0, 6.25, "test04"], 2022-08-09T09:23:45,501 ] 2022-08-09T09:23:45,502 timestamps_ = [1, 2, 3, 4] 2022-08-09T09:23:45,502 tablet_ = Tablet( 2022-08-09T09:23:45,502 device_id, measurements_, data_types_, values_, timestamps_ 2022-08-09T09:23:45,503 ) 2022-08-09T09:23:45,503 session.insert_tablet(tablet_) 2022-08-09T09:23:45,503 ``` 2022-08-09T09:23:45,504 * Numpy Tablet 2022-08-09T09:23:45,504 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-08-09T09:23:45,505 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-08-09T09:23:45,505 **Notice** 2022-08-09T09:23:45,505 1. time and value columns in Tablet are ndarray. 2022-08-09T09:23:45,506 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-08-09T09:23:45,506 (if not, the default dtypes are also ok). 2022-08-09T09:23:45,507 ```python 2022-08-09T09:23:45,507 data_types_ = [ 2022-08-09T09:23:45,507 TSDataType.BOOLEAN, 2022-08-09T09:23:45,508 TSDataType.INT32, 2022-08-09T09:23:45,508 TSDataType.INT64, 2022-08-09T09:23:45,508 TSDataType.FLOAT, 2022-08-09T09:23:45,508 TSDataType.DOUBLE, 2022-08-09T09:23:45,509 TSDataType.TEXT, 2022-08-09T09:23:45,509 ] 2022-08-09T09:23:45,509 np_values_ = [ 2022-08-09T09:23:45,510 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-08-09T09:23:45,510 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-08-09T09:23:45,510 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-08-09T09:23:45,511 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-08-09T09:23:45,511 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-08-09T09:23:45,511 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-08-09T09:23:45,511 ] 2022-08-09T09:23:45,512 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-08-09T09:23:45,512 np_tablet_ = NumpyTablet( 2022-08-09T09:23:45,512 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-08-09T09:23:45,513 ) 2022-08-09T09:23:45,513 session.insert_tablet(np_tablet_) 2022-08-09T09:23:45,513 ``` 2022-08-09T09:23:45,514 * Insert multiple Tablets 2022-08-09T09:23:45,515 ```python 2022-08-09T09:23:45,515 session.insert_tablets(tablet_lst) 2022-08-09T09:23:45,515 ``` 2022-08-09T09:23:45,516 * Insert a Record 2022-08-09T09:23:45,517 ```python 2022-08-09T09:23:45,517 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-08-09T09:23:45,517 ``` 2022-08-09T09:23:45,518 * Insert multiple Records 2022-08-09T09:23:45,518 ```python 2022-08-09T09:23:45,519 session.insert_records( 2022-08-09T09:23:45,519 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-08-09T09:23:45,519 ) 2022-08-09T09:23:45,520 ``` 2022-08-09T09:23:45,520 * Insert multiple Records that belong to the same device. 2022-08-09T09:23:45,521 With type info the server has no need to do type inference, which leads a better performance 2022-08-09T09:23:45,522 ```python 2022-08-09T09:23:45,522 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-08-09T09:23:45,522 ``` 2022-08-09T09:23:45,523 #### Insert with type inference 2022-08-09T09:23:45,523 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-08-09T09:23:45,524 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-08-09T09:23:45,525 ```python 2022-08-09T09:23:45,526 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-08-09T09:23:45,526 ``` 2022-08-09T09:23:45,527 #### Insert of Aligned Timeseries 2022-08-09T09:23:45,527 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-08-09T09:23:45,528 * insert_aligned_record 2022-08-09T09:23:45,528 * insert_aligned_records 2022-08-09T09:23:45,528 * insert_aligned_records_of_one_device 2022-08-09T09:23:45,529 * insert_aligned_tablet 2022-08-09T09:23:45,529 * insert_aligned_tablets 2022-08-09T09:23:45,530 ### IoTDB-SQL Interface 2022-08-09T09:23:45,531 * Execute query statement 2022-08-09T09:23:45,531 ```python 2022-08-09T09:23:45,532 session.execute_query_statement(sql) 2022-08-09T09:23:45,532 ``` 2022-08-09T09:23:45,532 * Execute non query statement 2022-08-09T09:23:45,533 ```python 2022-08-09T09:23:45,533 session.execute_non_query_statement(sql) 2022-08-09T09:23:45,534 ``` 2022-08-09T09:23:45,535 ### Pandas Support 2022-08-09T09:23:45,535 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-08-09T09:23:45,536 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-08-09T09:23:45,536 Example: 2022-08-09T09:23:45,537 ```python 2022-08-09T09:23:45,537 from iotdb.Session import Session 2022-08-09T09:23:45,538 ip = "127.0.0.1" 2022-08-09T09:23:45,538 port_ = "6667" 2022-08-09T09:23:45,538 username_ = "root" 2022-08-09T09:23:45,539 password_ = "root" 2022-08-09T09:23:45,539 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:45,539 session.open(False) 2022-08-09T09:23:45,539 result = session.execute_query_statement("SELECT * FROM root.*") 2022-08-09T09:23:45,540 # Transform to Pandas Dataset 2022-08-09T09:23:45,540 df = result.todf() 2022-08-09T09:23:45,541 session.close() 2022-08-09T09:23:45,542 # Now you can work with the dataframe 2022-08-09T09:23:45,542 df = ... 2022-08-09T09:23:45,542 ``` 2022-08-09T09:23:45,543 ### IoTDB Testcontainer 2022-08-09T09:23:45,544 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-08-09T09:23:45,544 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-08-09T09:23:45,545 ```python 2022-08-09T09:23:45,545 class MyTestCase(unittest.TestCase): 2022-08-09T09:23:45,546 def test_something(self): 2022-08-09T09:23:45,546 with IoTDBContainer() as c: 2022-08-09T09:23:45,546 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-08-09T09:23:45,547 session.open(False) 2022-08-09T09:23:45,547 result = session.execute_query_statement("SHOW TIMESERIES") 2022-08-09T09:23:45,547 print(result) 2022-08-09T09:23:45,547 session.close() 2022-08-09T09:23:45,548 ``` 2022-08-09T09:23:45,548 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-08-09T09:23:45,549 ## Developers 2022-08-09T09:23:45,550 ### Introduction 2022-08-09T09:23:45,550 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-08-09T09:23:45,552 ### Prerequisites 2022-08-09T09:23:45,552 Python3.7 or later is preferred. 2022-08-09T09:23:45,553 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-08-09T09:23:45,554 ``` 2022-08-09T09:23:45,554 http://thrift.apache.org/docs/install/ 2022-08-09T09:23:45,554 ``` 2022-08-09T09:23:45,555 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-08-09T09:23:45,555 ```shell 2022-08-09T09:23:45,555 pip install -r requirements_dev.txt 2022-08-09T09:23:45,556 ``` 2022-08-09T09:23:45,557 ### Compile the thrift library and Debug 2022-08-09T09:23:45,558 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-08-09T09:23:45,558 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-08-09T09:23:45,559 This folder is ignored from git and should **never be pushed to git!** 2022-08-09T09:23:45,559 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-08-09T09:23:45,561 ### Session Client & Example 2022-08-09T09:23:45,561 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-08-09T09:23:45,562 Or, another simple example: 2022-08-09T09:23:45,563 ```python 2022-08-09T09:23:45,563 from iotdb.Session import Session 2022-08-09T09:23:45,564 ip = "127.0.0.1" 2022-08-09T09:23:45,564 port_ = "6667" 2022-08-09T09:23:45,565 username_ = "root" 2022-08-09T09:23:45,565 password_ = "root" 2022-08-09T09:23:45,565 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:45,565 session.open(False) 2022-08-09T09:23:45,566 zone = session.get_time_zone() 2022-08-09T09:23:45,566 session.close() 2022-08-09T09:23:45,566 ``` 2022-08-09T09:23:45,568 ### Tests 2022-08-09T09:23:45,568 Please add your custom tests in `tests` folder. 2022-08-09T09:23:45,569 To run all defined tests just type `pytest .` in the root folder. 2022-08-09T09:23:45,569 **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-08-09T09:23:45,571 ### Futher Tools 2022-08-09T09:23:45,571 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-08-09T09:23:45,572 Both can be run by `black .` or `flake8 .` respectively. 2022-08-09T09:23:45,573 ## Releasing 2022-08-09T09:23:45,573 To do a release just ensure that you have the right set of generated thrift files. 2022-08-09T09:23:45,574 Then run linting and auto-formatting. 2022-08-09T09:23:45,574 Then, ensure that all tests work (via `pytest .`). 2022-08-09T09:23:45,574 Then you are good to go to do a release! 2022-08-09T09:23:45,576 ### Preparing your environment 2022-08-09T09:23:45,576 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-08-09T09:23:45,578 ### Doing the Release 2022-08-09T09:23:45,578 There is a convenient script `release.sh` to do all steps for a release. 2022-08-09T09:23:45,578 Namely, these are 2022-08-09T09:23:45,579 * Remove all transient directories from last release (if exists) 2022-08-09T09:23:45,579 * (Re-)generate all generated sources via mvn 2022-08-09T09:23:45,580 * Run Linting (flake8) 2022-08-09T09:23:45,580 * Run Tests via pytest 2022-08-09T09:23:45,580 * Build 2022-08-09T09:23:45,580 * Release to pypi 2022-08-09T09:23:49,884 running dist_info 2022-08-09T09:23:50,541 creating /tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info 2022-08-09T09:23:51,171 writing /tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/PKG-INFO 2022-08-09T09:23:51,768 writing dependency_links to /tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/dependency_links.txt 2022-08-09T09:23:54,737 writing requirements to /tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/requires.txt 2022-08-09T09:23:55,333 writing top-level names to /tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/top_level.txt 2022-08-09T09:23:55,335 writing manifest file '/tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:23:56,061 reading manifest file '/tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:23:56,064 adding license file 'LICENSE' 2022-08-09T09:23:56,071 writing manifest file '/tmp/pip-modern-metadata-0rnzef_b/apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:23:56,073 creating '/tmp/pip-modern-metadata-0rnzef_b/apache_iotdb-0.13.1.dist-info' 2022-08-09T09:23:56,298 adding license file "LICENSE" (matched pattern "LICEN[CS]E*") 2022-08-09T09:23:56,310 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-08-09T09:23:56,310 warnings.warn(msg) 2022-08-09T09:23:56,533 Preparing metadata (pyproject.toml): finished with status 'done' 2022-08-09T09:23:56,551 Source in /tmp/pip-wheel-mpsfo2rb/apache-iotdb_fa997ba941da49d5b25b1379010a0013 has version 0.13.1, which satisfies requirement apache-iotdb==0.13.1 from https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz#sha256=93f9d4d49f688166596691a8d3ec0606332ab2e39dfe174f007a8134246ac415 2022-08-09T09:23:56,553 Removed apache-iotdb==0.13.1 from https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz#sha256=93f9d4d49f688166596691a8d3ec0606332ab2e39dfe174f007a8134246ac415 from build tracker '/tmp/pip-build-tracker-7u95u_wy' 2022-08-09T09:23:56,569 Created temporary directory: /tmp/pip-unpack-4lt_x1z_ 2022-08-09T09:23:56,570 Building wheels for collected packages: apache-iotdb 2022-08-09T09:23:56,580 Created temporary directory: /tmp/pip-wheel-cutlt6nw 2022-08-09T09:23:56,581 Destination directory: /tmp/pip-wheel-cutlt6nw 2022-08-09T09:23:56,586 Building wheel for apache-iotdb (pyproject.toml): started 2022-08-09T09:23:56,588 Running command Building wheel for apache-iotdb (pyproject.toml) 2022-08-09T09:23:58,417 2022-08-09T09:23:58,425 # Apache IoTDB 2022-08-09T09:23:58,426 [![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-08-09T09:23:58,426 [![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-08-09T09:23:58,426 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2022-08-09T09:23:58,427 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2022-08-09T09:23:58,427 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2022-08-09T09:23:58,427 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2022-08-09T09:23:58,428 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2022-08-09T09:23:58,428 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2022-08-09T09:23:58,428 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2022-08-09T09:23:58,429 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2022-08-09T09:23:58,430 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2022-08-09T09:23:58,430 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2022-08-09T09:23:58,430 architecture, high performance and rich feature set together with its deep integration with 2022-08-09T09:23:58,431 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2022-08-09T09:23:58,431 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2022-08-09T09:23:58,432 ## Python Native API 2022-08-09T09:23:58,432 ### Requirements 2022-08-09T09:23:58,433 You have to install thrift (>=0.13) before using the package. 2022-08-09T09:23:58,434 ### How to use (Example) 2022-08-09T09:23:58,435 First, download the latest package: `pip3 install apache-iotdb` 2022-08-09T09:23:58,435 *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-08-09T09:23:58,436 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-08-09T09:23:58,436 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2022-08-09T09:23:58,437 (you need to add `import iotdb` in the head of the file) 2022-08-09T09:23:58,438 Or: 2022-08-09T09:23:58,438 ```python 2022-08-09T09:23:58,439 from iotdb.Session import Session 2022-08-09T09:23:58,439 ip = "127.0.0.1" 2022-08-09T09:23:58,439 port_ = "6667" 2022-08-09T09:23:58,440 username_ = "root" 2022-08-09T09:23:58,440 password_ = "root" 2022-08-09T09:23:58,440 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:58,441 session.open(False) 2022-08-09T09:23:58,441 zone = session.get_time_zone() 2022-08-09T09:23:58,441 session.close() 2022-08-09T09:23:58,442 ``` 2022-08-09T09:23:58,442 ### Initialization 2022-08-09T09:23:58,443 * Initialize a Session 2022-08-09T09:23:58,443 ```python 2022-08-09T09:23:58,444 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2022-08-09T09:23:58,444 ``` 2022-08-09T09:23:58,445 * Open a session, with a parameter to specify whether to enable RPC compression 2022-08-09T09:23:58,445 ```python 2022-08-09T09:23:58,446 session.open(enable_rpc_compression=False) 2022-08-09T09:23:58,446 ``` 2022-08-09T09:23:58,447 Notice: this RPC compression status of client must comply with that of IoTDB server 2022-08-09T09:23:58,447 * Close a Session 2022-08-09T09:23:58,448 ```python 2022-08-09T09:23:58,448 session.close() 2022-08-09T09:23:58,449 ``` 2022-08-09T09:23:58,449 ### Data Definition Interface (DDL Interface) 2022-08-09T09:23:58,450 #### Storage Group Management 2022-08-09T09:23:58,450 * Set storage group 2022-08-09T09:23:58,451 ```python 2022-08-09T09:23:58,451 session.set_storage_group(group_name) 2022-08-09T09:23:58,452 ``` 2022-08-09T09:23:58,452 * Delete one or several storage groups 2022-08-09T09:23:58,453 ```python 2022-08-09T09:23:58,453 session.delete_storage_group(group_name) 2022-08-09T09:23:58,454 session.delete_storage_groups(group_name_lst) 2022-08-09T09:23:58,454 ``` 2022-08-09T09:23:58,454 #### Timeseries Management 2022-08-09T09:23:58,455 * Create one or multiple timeseries 2022-08-09T09:23:58,455 ```python 2022-08-09T09:23:58,456 session.create_time_series(ts_path, data_type, encoding, compressor, 2022-08-09T09:23:58,456 props=None, tags=None, attributes=None, alias=None) 2022-08-09T09:23:58,457 session.create_multi_time_series( 2022-08-09T09:23:58,457 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2022-08-09T09:23:58,457 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2022-08-09T09:23:58,458 ) 2022-08-09T09:23:58,458 ``` 2022-08-09T09:23:58,459 * Create aligned timeseries 2022-08-09T09:23:58,459 ```python 2022-08-09T09:23:58,460 session.create_aligned_time_series( 2022-08-09T09:23:58,460 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2022-08-09T09:23:58,460 ) 2022-08-09T09:23:58,461 ``` 2022-08-09T09:23:58,461 Attention: Alias of measurements are **not supported** currently. 2022-08-09T09:23:58,462 * Delete one or several timeseries 2022-08-09T09:23:58,462 ```python 2022-08-09T09:23:58,463 session.delete_time_series(paths_list) 2022-08-09T09:23:58,463 ``` 2022-08-09T09:23:58,464 * Check whether the specific timeseries exists 2022-08-09T09:23:58,464 ```python 2022-08-09T09:23:58,465 session.check_time_series_exists(path) 2022-08-09T09:23:58,465 ``` 2022-08-09T09:23:58,465 ### Data Manipulation Interface (DML Interface) 2022-08-09T09:23:58,466 #### Insert 2022-08-09T09:23:58,467 It is recommended to use insertTablet to help improve write efficiency. 2022-08-09T09:23:58,467 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2022-08-09T09:23:58,468 * **Better Write Performance** 2022-08-09T09:23:58,468 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2022-08-09T09:23:58,469 We have two implementations of Tablet in Python API. 2022-08-09T09:23:58,469 * Normal Tablet 2022-08-09T09:23:58,470 ```python 2022-08-09T09:23:58,470 values_ = [ 2022-08-09T09:23:58,471 [False, 10, 11, 1.1, 10011.1, "test01"], 2022-08-09T09:23:58,471 [True, 100, 11111, 1.25, 101.0, "test02"], 2022-08-09T09:23:58,471 [False, 100, 1, 188.1, 688.25, "test03"], 2022-08-09T09:23:58,472 [True, 0, 0, 0, 6.25, "test04"], 2022-08-09T09:23:58,472 ] 2022-08-09T09:23:58,472 timestamps_ = [1, 2, 3, 4] 2022-08-09T09:23:58,472 tablet_ = Tablet( 2022-08-09T09:23:58,473 device_id, measurements_, data_types_, values_, timestamps_ 2022-08-09T09:23:58,473 ) 2022-08-09T09:23:58,473 session.insert_tablet(tablet_) 2022-08-09T09:23:58,474 ``` 2022-08-09T09:23:58,474 * Numpy Tablet 2022-08-09T09:23:58,475 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2022-08-09T09:23:58,475 With less memory footprint and time cost of serialization, the insert performance will be better. 2022-08-09T09:23:58,476 **Notice** 2022-08-09T09:23:58,476 1. time and value columns in Tablet are ndarray. 2022-08-09T09:23:58,476 2. recommended to use the specific dtypes to each ndarray, see the example below 2022-08-09T09:23:58,477 (if not, the default dtypes are also ok). 2022-08-09T09:23:58,477 ```python 2022-08-09T09:23:58,478 data_types_ = [ 2022-08-09T09:23:58,478 TSDataType.BOOLEAN, 2022-08-09T09:23:58,478 TSDataType.INT32, 2022-08-09T09:23:58,478 TSDataType.INT64, 2022-08-09T09:23:58,479 TSDataType.FLOAT, 2022-08-09T09:23:58,479 TSDataType.DOUBLE, 2022-08-09T09:23:58,479 TSDataType.TEXT, 2022-08-09T09:23:58,480 ] 2022-08-09T09:23:58,480 np_values_ = [ 2022-08-09T09:23:58,480 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2022-08-09T09:23:58,481 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2022-08-09T09:23:58,481 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2022-08-09T09:23:58,481 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2022-08-09T09:23:58,481 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2022-08-09T09:23:58,482 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2022-08-09T09:23:58,482 ] 2022-08-09T09:23:58,482 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2022-08-09T09:23:58,483 np_tablet_ = NumpyTablet( 2022-08-09T09:23:58,483 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2022-08-09T09:23:58,483 ) 2022-08-09T09:23:58,484 session.insert_tablet(np_tablet_) 2022-08-09T09:23:58,484 ``` 2022-08-09T09:23:58,485 * Insert multiple Tablets 2022-08-09T09:23:58,485 ```python 2022-08-09T09:23:58,485 session.insert_tablets(tablet_lst) 2022-08-09T09:23:58,486 ``` 2022-08-09T09:23:58,486 * Insert a Record 2022-08-09T09:23:58,487 ```python 2022-08-09T09:23:58,487 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2022-08-09T09:23:58,488 ``` 2022-08-09T09:23:58,488 * Insert multiple Records 2022-08-09T09:23:58,489 ```python 2022-08-09T09:23:58,489 session.insert_records( 2022-08-09T09:23:58,489 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2022-08-09T09:23:58,490 ) 2022-08-09T09:23:58,490 ``` 2022-08-09T09:23:58,491 * Insert multiple Records that belong to the same device. 2022-08-09T09:23:58,491 With type info the server has no need to do type inference, which leads a better performance 2022-08-09T09:23:58,492 ```python 2022-08-09T09:23:58,492 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2022-08-09T09:23:58,493 ``` 2022-08-09T09:23:58,493 #### Insert with type inference 2022-08-09T09:23:58,494 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-08-09T09:23:58,495 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2022-08-09T09:23:58,495 ```python 2022-08-09T09:23:58,496 session.insert_str_record(device_id, timestamp, measurements, string_values) 2022-08-09T09:23:58,496 ``` 2022-08-09T09:23:58,497 #### Insert of Aligned Timeseries 2022-08-09T09:23:58,497 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2022-08-09T09:23:58,498 * insert_aligned_record 2022-08-09T09:23:58,498 * insert_aligned_records 2022-08-09T09:23:58,499 * insert_aligned_records_of_one_device 2022-08-09T09:23:58,499 * insert_aligned_tablet 2022-08-09T09:23:58,499 * insert_aligned_tablets 2022-08-09T09:23:58,500 ### IoTDB-SQL Interface 2022-08-09T09:23:58,501 * Execute query statement 2022-08-09T09:23:58,501 ```python 2022-08-09T09:23:58,502 session.execute_query_statement(sql) 2022-08-09T09:23:58,502 ``` 2022-08-09T09:23:58,503 * Execute non query statement 2022-08-09T09:23:58,503 ```python 2022-08-09T09:23:58,504 session.execute_non_query_statement(sql) 2022-08-09T09:23:58,504 ``` 2022-08-09T09:23:58,505 ### Pandas Support 2022-08-09T09:23:58,506 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2022-08-09T09:23:58,506 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2022-08-09T09:23:58,506 Example: 2022-08-09T09:23:58,507 ```python 2022-08-09T09:23:58,507 from iotdb.Session import Session 2022-08-09T09:23:58,508 ip = "127.0.0.1" 2022-08-09T09:23:58,508 port_ = "6667" 2022-08-09T09:23:58,509 username_ = "root" 2022-08-09T09:23:58,509 password_ = "root" 2022-08-09T09:23:58,509 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:58,509 session.open(False) 2022-08-09T09:23:58,510 result = session.execute_query_statement("SELECT * FROM root.*") 2022-08-09T09:23:58,510 # Transform to Pandas Dataset 2022-08-09T09:23:58,511 df = result.todf() 2022-08-09T09:23:58,511 session.close() 2022-08-09T09:23:58,512 # Now you can work with the dataframe 2022-08-09T09:23:58,512 df = ... 2022-08-09T09:23:58,513 ``` 2022-08-09T09:23:58,513 ### IoTDB Testcontainer 2022-08-09T09:23:58,514 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-08-09T09:23:58,515 To start (and stop) an IoTDB Database in a Docker container simply do: 2022-08-09T09:23:58,515 ```python 2022-08-09T09:23:58,515 class MyTestCase(unittest.TestCase): 2022-08-09T09:23:58,516 def test_something(self): 2022-08-09T09:23:58,516 with IoTDBContainer() as c: 2022-08-09T09:23:58,517 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2022-08-09T09:23:58,517 session.open(False) 2022-08-09T09:23:58,517 result = session.execute_query_statement("SHOW TIMESERIES") 2022-08-09T09:23:58,518 print(result) 2022-08-09T09:23:58,518 session.close() 2022-08-09T09:23:58,518 ``` 2022-08-09T09:23:58,519 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-08-09T09:23:58,520 ## Developers 2022-08-09T09:23:58,520 ### Introduction 2022-08-09T09:23:58,521 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-08-09T09:23:58,522 ### Prerequisites 2022-08-09T09:23:58,523 Python3.7 or later is preferred. 2022-08-09T09:23:58,523 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-08-09T09:23:58,524 ``` 2022-08-09T09:23:58,524 http://thrift.apache.org/docs/install/ 2022-08-09T09:23:58,525 ``` 2022-08-09T09:23:58,525 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2022-08-09T09:23:58,526 ```shell 2022-08-09T09:23:58,526 pip install -r requirements_dev.txt 2022-08-09T09:23:58,526 ``` 2022-08-09T09:23:58,527 ### Compile the thrift library and Debug 2022-08-09T09:23:58,528 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2022-08-09T09:23:58,529 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2022-08-09T09:23:58,529 This folder is ignored from git and should **never be pushed to git!** 2022-08-09T09:23:58,530 **Notice** Do not upload `iotdb/thrift` to the git repo. 2022-08-09T09:23:58,531 ### Session Client & Example 2022-08-09T09:23:58,532 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-08-09T09:23:58,533 Or, another simple example: 2022-08-09T09:23:58,533 ```python 2022-08-09T09:23:58,534 from iotdb.Session import Session 2022-08-09T09:23:58,534 ip = "127.0.0.1" 2022-08-09T09:23:58,535 port_ = "6667" 2022-08-09T09:23:58,535 username_ = "root" 2022-08-09T09:23:58,535 password_ = "root" 2022-08-09T09:23:58,536 session = Session(ip, port_, username_, password_) 2022-08-09T09:23:58,536 session.open(False) 2022-08-09T09:23:58,536 zone = session.get_time_zone() 2022-08-09T09:23:58,536 session.close() 2022-08-09T09:23:58,537 ``` 2022-08-09T09:23:58,538 ### Tests 2022-08-09T09:23:58,539 Please add your custom tests in `tests` folder. 2022-08-09T09:23:58,539 To run all defined tests just type `pytest .` in the root folder. 2022-08-09T09:23:58,540 **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-08-09T09:23:58,541 ### Futher Tools 2022-08-09T09:23:58,542 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2022-08-09T09:23:58,542 Both can be run by `black .` or `flake8 .` respectively. 2022-08-09T09:23:58,543 ## Releasing 2022-08-09T09:23:58,544 To do a release just ensure that you have the right set of generated thrift files. 2022-08-09T09:23:58,544 Then run linting and auto-formatting. 2022-08-09T09:23:58,544 Then, ensure that all tests work (via `pytest .`). 2022-08-09T09:23:58,545 Then you are good to go to do a release! 2022-08-09T09:23:58,546 ### Preparing your environment 2022-08-09T09:23:58,547 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2022-08-09T09:23:58,548 ### Doing the Release 2022-08-09T09:23:58,549 There is a convenient script `release.sh` to do all steps for a release. 2022-08-09T09:23:58,549 Namely, these are 2022-08-09T09:23:58,549 * Remove all transient directories from last release (if exists) 2022-08-09T09:23:58,550 * (Re-)generate all generated sources via mvn 2022-08-09T09:23:58,550 * Run Linting (flake8) 2022-08-09T09:23:58,550 * Run Tests via pytest 2022-08-09T09:23:58,551 * Build 2022-08-09T09:23:58,551 * Release to pypi 2022-08-09T09:24:02,339 running bdist_wheel 2022-08-09T09:24:03,568 running build 2022-08-09T09:24:03,569 running build_py 2022-08-09T09:24:04,201 creating build 2022-08-09T09:24:04,202 creating build/lib 2022-08-09T09:24:04,203 creating build/lib/iotdb 2022-08-09T09:24:04,205 copying iotdb/__init__.py -> build/lib/iotdb 2022-08-09T09:24:04,208 copying iotdb/Session.py -> build/lib/iotdb 2022-08-09T09:24:04,214 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2022-08-09T09:24:04,219 creating build/lib/tests 2022-08-09T09:24:04,220 copying tests/test_todf.py -> build/lib/tests 2022-08-09T09:24:04,225 copying tests/tablet_performance_comparison.py -> build/lib/tests 2022-08-09T09:24:04,229 copying tests/__init__.py -> build/lib/tests 2022-08-09T09:24:04,232 copying tests/test_dataframe.py -> build/lib/tests 2022-08-09T09:24:04,235 copying tests/test_numpy_tablet.py -> build/lib/tests 2022-08-09T09:24:04,239 copying tests/test_aligned_timeseries.py -> build/lib/tests 2022-08-09T09:24:04,243 copying tests/test_session.py -> build/lib/tests 2022-08-09T09:24:04,247 copying tests/test_tablet.py -> build/lib/tests 2022-08-09T09:24:04,252 creating build/lib/iotdb/thrift 2022-08-09T09:24:04,254 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2022-08-09T09:24:04,259 creating build/lib/iotdb/utils 2022-08-09T09:24:04,260 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,264 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,267 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,272 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,275 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,279 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,282 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,286 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,290 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2022-08-09T09:24:04,295 creating build/lib/iotdb/thrift/rpc 2022-08-09T09:24:04,297 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2022-08-09T09:24:04,300 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2022-08-09T09:24:04,304 copying iotdb/thrift/rpc/TSIService.py -> build/lib/iotdb/thrift/rpc 2022-08-09T09:24:04,322 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2022-08-09T09:24:05,607 installing to build/bdist.linux-armv7l/wheel 2022-08-09T09:24:05,607 running install 2022-08-09T09:24:05,669 running install_lib 2022-08-09T09:24:06,295 creating build/bdist.linux-armv7l 2022-08-09T09:24:06,296 creating build/bdist.linux-armv7l/wheel 2022-08-09T09:24:06,299 creating build/bdist.linux-armv7l/wheel/iotdb 2022-08-09T09:24:06,301 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-08-09T09:24:06,306 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2022-08-09T09:24:06,308 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2022-08-09T09:24:06,312 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-08-09T09:24:06,314 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-08-09T09:24:06,318 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-08-09T09:24:06,321 copying build/lib/iotdb/thrift/rpc/TSIService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-08-09T09:24:06,342 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2022-08-09T09:24:06,359 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,361 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,365 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,368 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,372 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,376 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,380 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,384 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,388 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,392 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2022-08-09T09:24:06,396 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-08-09T09:24:06,403 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2022-08-09T09:24:06,407 creating build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,409 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,413 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,418 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,421 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,425 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,429 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,433 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,438 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2022-08-09T09:24:06,441 running install_egg_info 2022-08-09T09:24:07,776 running egg_info 2022-08-09T09:24:08,403 writing apache_iotdb.egg-info/PKG-INFO 2022-08-09T09:24:09,000 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2022-08-09T09:24:11,973 writing requirements to apache_iotdb.egg-info/requires.txt 2022-08-09T09:24:12,569 writing top-level names to apache_iotdb.egg-info/top_level.txt 2022-08-09T09:24:12,617 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:24:12,621 adding license file 'LICENSE' 2022-08-09T09:24:12,629 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2022-08-09T09:24:12,631 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.1-py3.7.egg-info 2022-08-09T09:24:12,652 running install_scripts 2022-08-09T09:24:12,819 adding license file "LICENSE" (matched pattern "LICEN[CS]E*") 2022-08-09T09:24:12,827 creating build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.1.dist-info/WHEEL 2022-08-09T09:24:12,832 creating '/tmp/pip-wheel-cutlt6nw/tmpinsnur2y/apache_iotdb-0.13.1-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2022-08-09T09:24:12,839 adding 'iotdb/IoTDBContainer.py' 2022-08-09T09:24:12,848 adding 'iotdb/Session.py' 2022-08-09T09:24:12,851 adding 'iotdb/__init__.py' 2022-08-09T09:24:12,854 adding 'iotdb/thrift/__init__.py' 2022-08-09T09:24:12,883 adding 'iotdb/thrift/rpc/TSIService.py' 2022-08-09T09:24:12,891 adding 'iotdb/thrift/rpc/__init__.py' 2022-08-09T09:24:12,893 adding 'iotdb/thrift/rpc/constants.py' 2022-08-09T09:24:12,922 adding 'iotdb/thrift/rpc/ttypes.py' 2022-08-09T09:24:12,931 adding 'iotdb/utils/BitMap.py' 2022-08-09T09:24:12,934 adding 'iotdb/utils/Field.py' 2022-08-09T09:24:12,937 adding 'iotdb/utils/IoTDBConstants.py' 2022-08-09T09:24:12,941 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2022-08-09T09:24:12,945 adding 'iotdb/utils/NumpyTablet.py' 2022-08-09T09:24:12,947 adding 'iotdb/utils/RowRecord.py' 2022-08-09T09:24:12,950 adding 'iotdb/utils/SessionDataSet.py' 2022-08-09T09:24:12,953 adding 'iotdb/utils/Tablet.py' 2022-08-09T09:24:12,956 adding 'iotdb/utils/__init__.py' 2022-08-09T09:24:12,959 adding 'tests/__init__.py' 2022-08-09T09:24:12,963 adding 'tests/tablet_performance_comparison.py' 2022-08-09T09:24:12,967 adding 'tests/test_aligned_timeseries.py' 2022-08-09T09:24:12,969 adding 'tests/test_dataframe.py' 2022-08-09T09:24:12,972 adding 'tests/test_numpy_tablet.py' 2022-08-09T09:24:12,976 adding 'tests/test_session.py' 2022-08-09T09:24:12,979 adding 'tests/test_tablet.py' 2022-08-09T09:24:12,982 adding 'tests/test_todf.py' 2022-08-09T09:24:12,987 adding 'apache_iotdb-0.13.1.dist-info/LICENSE' 2022-08-09T09:24:12,991 adding 'apache_iotdb-0.13.1.dist-info/METADATA' 2022-08-09T09:24:12,993 adding 'apache_iotdb-0.13.1.dist-info/WHEEL' 2022-08-09T09:24:12,995 adding 'apache_iotdb-0.13.1.dist-info/top_level.txt' 2022-08-09T09:24:12,997 adding 'apache_iotdb-0.13.1.dist-info/RECORD' 2022-08-09T09:24:13,002 removing build/bdist.linux-armv7l/wheel 2022-08-09T09:24:13,026 /usr/local/lib/python3.7/dist-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'website' 2022-08-09T09:24:13,026 warnings.warn(msg) 2022-08-09T09:24:13,283 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2022-08-09T09:24:13,300 Created wheel for apache-iotdb: filename=apache_iotdb-0.13.1-py3-none-any.whl size=75598 sha256=22668867268f1ea89b8205cbda30d0578aaa5ccfff0b552396e7059a95d3781a 2022-08-09T09:24:13,302 Stored in directory: /tmp/pip-ephem-wheel-cache-w6_x9s9a/wheels/b1/bc/21/575a77a047859037cd0a15be51bf90b8c96ca0db7d8a4c38d5 2022-08-09T09:24:13,331 Successfully built apache-iotdb 2022-08-09T09:24:13,343 Removed build tracker: '/tmp/pip-build-tracker-7u95u_wy'