2023-03-23T10:22:58,422 Created temporary directory: /tmp/pip-ephem-wheel-cache-28xljue8 2023-03-23T10:22:58,428 Created temporary directory: /tmp/pip-build-tracker-f_jesudj 2023-03-23T10:22:58,429 Initialized build tracking at /tmp/pip-build-tracker-f_jesudj 2023-03-23T10:22:58,429 Created build tracker: /tmp/pip-build-tracker-f_jesudj 2023-03-23T10:22:58,430 Entered build tracker: /tmp/pip-build-tracker-f_jesudj 2023-03-23T10:22:58,431 Created temporary directory: /tmp/pip-wheel-r2fbo6mg 2023-03-23T10:22:58,441 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453 2023-03-23T10:22:58,447 Created temporary directory: /tmp/pip-ephem-wheel-cache-lp8ulzf2 2023-03-23T10:22:58,508 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-03-23T10:22:58,515 2 location(s) to search for versions of apache-iotdb: 2023-03-23T10:22:58,515 * https://pypi.org/simple/apache-iotdb/ 2023-03-23T10:22:58,515 * https://www.piwheels.org/simple/apache-iotdb/ 2023-03-23T10:22:58,516 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2023-03-23T10:22:58,517 Getting page https://pypi.org/simple/apache-iotdb/ 2023-03-23T10:22:58,520 Found index url https://pypi.org/simple 2023-03-23T10:22:58,709 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2023-03-23T10:22:58,737 Found link https://files.pythonhosted.org/packages/76/14/d01b6281df00530c69bc8eae2074b9970bbe865a5e971b5cd2019e8b8250/apache-iotdb-0.9.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.0 2023-03-23T10:22:58,738 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/84/aa/fa9401ccadb89ddce7c2b8a03baee9dbb9913c52b5936d0ec7968cabf056/apache_iotdb-0.9.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,739 Found link https://files.pythonhosted.org/packages/01/fa/e65db378e4d8e07322ec175f37568bceb55ebb3c8397fa7b48e9f087c451/apache-iotdb-0.9.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.2 2023-03-23T10:22:58,740 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/43/8d/72fa03325e9281b613a0eabae9cc7c606ce0e8952bee0c3ca855e4579a1d/apache_iotdb-0.9.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,741 Found link https://files.pythonhosted.org/packages/34/95/030c2da665358de8ba950099b3b0397dca437fcde60d5d1730d0c451d5e3/apache-iotdb-0.9.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.3 2023-03-23T10:22:58,742 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/5c/d4/2e329baab32ad93730ba4b79df9b91f1d55d0d37428a5dbbe2dd4c9f3a9d/apache_iotdb-0.9.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,743 Found link https://files.pythonhosted.org/packages/1d/dc/138e08717f8c2e0e238f35d39b34af6cfc1c7a1332b6aa4689750f4fda26/apache-iotdb-0.10.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.0 2023-03-23T10:22:58,744 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c3/76/46884f04945b6f02bbec4e06d83fafc16f326ca0f9b35b8c0141018990c0/apache_iotdb-0.10.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,746 Found link https://files.pythonhosted.org/packages/f6/4d/b229b9f309431e8164c9cd893431009a57efcaa059f58c1091d222601da3/apache-iotdb-0.10.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.1 2023-03-23T10:22:58,747 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d6/87/2e003dcf87ffa8e73f48a62a107b989967e906670d905a05ae1c1349f396/apache_iotdb-0.10.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,748 Found link https://files.pythonhosted.org/packages/16/8b/2ec65fa81d5961bd927c02d6a209490bf325b2a164506cd3b12e846d7061/apache-iotdb-0.11.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.0 2023-03-23T10:22:58,749 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/47/c8/047703f7e8125b15361c766b90c6f1cbdbf797f84803f38b1732c1a386cb/apache_iotdb-0.11.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,750 Found link https://files.pythonhosted.org/packages/55/a1/ef100f67e0f26fbc1d19b84115b21de942e7b7e01803706d19f841ac06c1/apache-iotdb-0.11.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.1 2023-03-23T10:22:58,751 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/9f/dce2d782c8b64700539039ef5d66f5f7a781689538c0a176cf56099ec9d1/apache_iotdb-0.11.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,752 Found link https://files.pythonhosted.org/packages/69/d5/f1b9ff293fe02eb1f1cb3cba13b5d9a4b547415ab0045b2a8a3612249e12/apache-iotdb-0.11.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.2 2023-03-23T10:22:58,753 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/96/a5f0c63659cc8477c53d8a8321c07ea5a0bb2430abaaab477a6185bb43a1/apache_iotdb-0.11.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,754 Found link https://files.pythonhosted.org/packages/7d/cf/0d672a828527f59cdc66c078b0b8e356ca0a3191224a4363ce2256337d1c/apache-iotdb-0.11.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.3 2023-03-23T10:22:58,755 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d2/c7/6709b26341e59788d05a297182aa3f96c692e85421c169f657e92c3b4765/apache_iotdb-0.11.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,756 Found link https://files.pythonhosted.org/packages/00/a1/5b1b8a2754f4b25420d9a4461b5e2b8573bb89b43054f9303ea0558df0de/apache-iotdb-0.11.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.4 2023-03-23T10:22:58,757 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/48/f4/a21fd4495f93c428de788a477665f1815b257568469c38108666125fff4b/apache_iotdb-0.11.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,758 Found link https://files.pythonhosted.org/packages/9e/16/bb2ef45f62e9866f1be97f04e2c581247d3b145e5d8a01b7c143023c6c45/apache-iotdb-0.12.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.0 2023-03-23T10:22:58,759 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/32/e051c3ce387e54b1f036995e92ff352895cf01a51b170752e906a7d42364/apache_iotdb-0.12.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,760 Found link https://files.pythonhosted.org/packages/20/0c/b39e9f362fb0a1a43cb0a05a5b2d9163815f0048575e0c071bbaa50070b8/apache-iotdb-0.12.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.1 2023-03-23T10:22:58,761 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/55/cf/219a0c3cd17537cebf6e67deeaa77b57741c9b40bcddbb7f59ac9b828401/apache_iotdb-0.12.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,762 Found link https://files.pythonhosted.org/packages/fd/64/d83ceaaab941dd78df38cd8c35d27028a27724c2535f0e6f01a48472aa28/apache-iotdb-0.12.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.2 2023-03-23T10:22:58,763 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/0b/33/60af46cbc25d7ecf9722bf311295cb0acbf2841f6eb3e3af7433ac3e199d/apache_iotdb-0.12.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,764 Found link https://files.pythonhosted.org/packages/24/7c/81a9dcfd218d4654b03d9079578659d6201aa4f9e9ccba328c0742e8e9c1/apache-iotdb-0.12.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.3 2023-03-23T10:22:58,765 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/ae/e79cef98fa20cf977ea22b065fcff8d7b976922dd281f4a74a02b1a72b41/apache_iotdb-0.12.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,766 Found link https://files.pythonhosted.org/packages/9e/11/0d12f9b906b3aac1446c09e297bcdf3a0cdfb016aae1ec77effa214999de/apache-iotdb-0.12.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.4 2023-03-23T10:22:58,767 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/cb/34f5d9137086d912e4518d751eca1ac9a8b908706c4b3176ca32911fabd2/apache_iotdb-0.12.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,768 Found link https://files.pythonhosted.org/packages/8a/52/93503eac47c1561edc21431f7154b694afad9d461e2af0fea36966953c24/apache-iotdb-0.12.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.5 2023-03-23T10:22:58,769 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7a/30/1cd9bca76c1f4f9b4cd48d11f23103ade9c5a35410bbf0a8f5997bab51b0/apache_iotdb-0.12.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,770 Found link https://files.pythonhosted.org/packages/00/d9/19746ff8906cc2ac3c9326fbcbd244d2424f4aad5d7201843956d27dcb0b/apache-iotdb-0.12.6.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.6 2023-03-23T10:22:58,771 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/cf/7b/ab3acb96fd057e900f9aca1b030f4fb42caf4104000ab742ce19a1029b6f/apache_iotdb-0.12.6-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,772 Found link https://files.pythonhosted.org/packages/a6/cd/33de301e51132f8d0d79adc346d38685a6b871251846bad95b35ebf74ac9/apache-iotdb-0.13.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0 2023-03-23T10:22:58,773 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/71/c1/3684d3b6e6eddda5fbe994e123c6bc6569409994a44b5d3e4b130554802a/apache_iotdb-0.13.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,774 Found link https://files.pythonhosted.org/packages/7e/3e/40f0d900e04598036cc65ae437a2ee9f4aa149860d434a6f4b291460582c/apache-iotdb-0.13.0.post1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0.post1 2023-03-23T10:22:58,775 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7c/f2/ef6f589910f1b850ad665d4958e2a26b5249bddc81d5f29a711e21a79dc1/apache_iotdb-0.13.0.post1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,776 Found link https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.1 2023-03-23T10:22:58,777 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/b7/1d/3074d8ab58366c99783fe0ed853472a21d69dfd2b80ca001281d170833e2/apache_iotdb-0.13.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,778 Found link https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.2 2023-03-23T10:22:58,779 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/94/0c/3a7d8a238d7c8771453889f8f03f9ebcd418839306e64f4ddea8c0baee81/apache_iotdb-0.13.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,780 Found link https://files.pythonhosted.org/packages/30/a0/0153c56e1af8653bfdcf47423949dd6b23e53882c9009acc25e661a44dbe/apache-iotdb-0.13.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.3 2023-03-23T10:22:58,781 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/a0/51/7e8405405f7f0ef8eabab31b4860cb747a8acfa53e30f56939c115b53db9/apache_iotdb-0.13.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,782 Found link https://files.pythonhosted.org/packages/42/eb/3d7ac8d794238b75997ff3f55db6e02436bfa558a8df4ea21e58bf8db6fd/apache-iotdb-0.13.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5 2023-03-23T10:22:58,783 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/51/a3/9117edfd3d72a1d338b7cff8060e672dd7b39dfeb2ca0d6c22db51bf9b90/apache_iotdb-0.13.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,784 Found link https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5.1 2023-03-23T10:22:58,785 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/89/0a/816b8a85f6be9f8fe3534f79ea12341dad900b59ba0ac126835640a09db0/apache_iotdb-0.13.5.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,786 Found link https://files.pythonhosted.org/packages/bb/7d/24cefdcd57e96d496fd3492fc28b3d53da6ba0fc6ee69f99dddec1cf500c/apache-iotdb-0.14.0rc1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.14.0rc1 2023-03-23T10:22:58,787 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/6d/37/0e5a292ed1a695927cefec20d4ad01d3c7af78e691d5250f1646f318d4ef/apache_iotdb-0.14.0rc1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,788 Found link https://files.pythonhosted.org/packages/49/91/11702001bdc0af0266d5f4dd222b5f937684e8c08e5044735ade6748cd58/apache-iotdb-1.0.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.0 2023-03-23T10:22:58,789 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3d/57/3019d5cf51e6198d5b7ee9e3c07a15efa7487e8b280b4b71cc521a6651e3/apache_iotdb-1.0.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,790 Found link https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.1 2023-03-23T10:22:58,791 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/06/82/b658ff03f52072e1afde6bb9f1f1933427ef776a78e246965943fba552d8/apache_iotdb-1.0.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:58,792 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2023-03-23T10:22:58,792 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2023-03-23T10:22:58,795 Found index url https://www.piwheels.org/simple 2023-03-23T10:22:59,010 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2023-03-23T10:22:59,032 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.1-py3-none-any.whl#sha256=9fc3d243ca97c88bd3ca1f5092686e3ab5c99a6e5206fd6a6c6fdaab15c796b6 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,033 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.0-py3-none-any.whl#sha256=85d0bb3ddb1c79359fec18e85c6d515dc3639752d77dea32c09c8afe0fefc906 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,033 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.14.0rc1-py3-none-any.whl#sha256=2f71e6b3443c4748717889729380082daa7bd8f9950d4c17909134372367bccc (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,034 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5-py3-none-any.whl#sha256=e25dac25664b9ff8313cbb697f634269ef857ec9217d3256b893c43c8b0c151f (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,034 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.3-py3-none-any.whl#sha256=c3be87cabc4d19ad9fd999f524ac8547b971adb4a304bf8874fdb56a6ecca371 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,035 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.2-py3-none-any.whl#sha256=136811be5cdfe045bc349a8f6c0b07117600185c0c7ada8353610179adde27ae (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,035 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.1-py3-none-any.whl#sha256=22668867268f1ea89b8205cbda30d0578aaa5ccfff0b552396e7059a95d3781a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,036 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0.post1-py3-none-any.whl#sha256=d53cf02df2cc507d9caf48167c52d69e24abab9800430de3ff8abf8159bff63b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,036 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0-py3-none-any.whl#sha256=67b7429e60cdd5e1e3a808592a87a591c028af62de8e2fec2535b4a3105f21b7 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,037 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.6-py3-none-any.whl#sha256=a4f679df0053b74f83de861277de12e030eb8601063b172ec44789118ba11400 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,037 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.5-py3-none-any.whl#sha256=06bb080be5b0469037e68db56a7feb10da911a396a47d598598d8d8c50d07419 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,038 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.4-py3-none-any.whl#sha256=af5fa8000dd449fb6d98420287b2049b5e68d268fa1529fa96955b5fe7637c13 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,039 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.3-py3-none-any.whl#sha256=eb77b047b61a087b286e01afea6ee9761c9e687479a4e551be085d82612ed220 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,039 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.2-py3-none-any.whl#sha256=bb7605db211272947ba451cdad35a2b4f554167361f0c08acedbfb0723ac7ab8 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,040 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.1-py3-none-any.whl#sha256=bc5ddc6b683bf26a0b9a8c47ada13d29918503664e9e1c3fdefae73121f3a327 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,040 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.0-py3-none-any.whl#sha256=061d9407266b9d100113fa2d11890a8d5d56f8b496305c5864f08a9af35fcc12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,041 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.4-py3-none-any.whl#sha256=cf1ee85db62d31642b32742aba0a026a941b85cf4bb49ec48ef09b9e241f3bf5 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,041 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.3-py3-none-any.whl#sha256=55e9a0042694ba7fa482f733a1d548c0180bccf0e35e090b85d7b9050c95162b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,042 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.2-py3-none-any.whl#sha256=762d5b0c5f82869237d5375d2a8774f99654c3b693d6f77bf6e9decc78b7fd5d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,042 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.1-py3-none-any.whl#sha256=317a24e4870d587820f8d5be294e2e9a6ad09f70566ce4380506085c47b2fc0a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,043 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.0-py3-none-any.whl#sha256=4771e87dd8d933815206c063014beff8eff4c8025353723ac67603f49a119224 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,043 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.1-py3-none-any.whl#sha256=b4b13fa0d6ed86fbcc1231cad3d220ee81b38452e87fea655641720f803d4c1d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,044 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.0-py3-none-any.whl#sha256=388ade65f63cb37eef343e4f294cf3488b79894ff8061a7d9b2bf42277ded9de (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,044 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.3-py3-none-any.whl#sha256=b535b53a5182dc94116e67edb4a34c1efb007574273e2ff4ad72ebc3b4634326 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,045 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.2-py3-none-any.whl#sha256=b7fad95c7f041f18a621439aa3cd19fc79d76caa85a93967163566c10b7c6348 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,045 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.0-py3-none-any.whl#sha256=1feb6b731a9af26aac7a1e6fab74e85dd960562a1dca6e4c5c9d10234a570e82 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-03-23T10:22:59,046 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2023-03-23T10:22:59,046 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2023-03-23T10:22:59,089 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2023-03-23T10:22:59,119 Collecting apache-iotdb==0.13.5.1 2023-03-23T10:22:59,123 Created temporary directory: /tmp/pip-unpack-0hm0jn_v 2023-03-23T10:22:59,356 Downloading apache-iotdb-0.13.5.1.tar.gz (61 kB) 2023-03-23T10:22:59,637 Added apache-iotdb==0.13.5.1 from https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz to build tracker '/tmp/pip-build-tracker-f_jesudj' 2023-03-23T10:22:59,647 Created temporary directory: /tmp/pip-build-env-w_apa7l6 2023-03-23T10:22:59,666 Installing build dependencies: started 2023-03-23T10:22:59,669 Running command pip subprocess to install build dependencies 2023-03-23T10:23:02,340 Using pip 23.0.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7) 2023-03-23T10:23:03,622 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453 2023-03-23T10:23:03,681 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-03-23T10:23:07,636 Collecting setuptools>=40.8.0 2023-03-23T10:23:07,881 Using cached https://www.piwheels.org/simple/setuptools/setuptools-67.6.0-py3-none-any.whl (1.1 MB) 2023-03-23T10:23:08,521 Collecting wheel 2023-03-23T10:23:08,558 Using cached https://www.piwheels.org/simple/wheel/wheel-0.40.0-py3-none-any.whl (64 kB) 2023-03-23T10:23:14,268 Installing collected packages: wheel, setuptools 2023-03-23T10:23:14,730 Creating /tmp/pip-build-env-w_apa7l6/overlay/bin 2023-03-23T10:23:14,735 changing mode of /tmp/pip-build-env-w_apa7l6/overlay/bin/wheel to 755 2023-03-23T10:23:18,973 Successfully installed setuptools-67.6.0 wheel-0.40.0 2023-03-23T10:23:19,934 Installing build dependencies: finished with status 'done' 2023-03-23T10:23:19,946 Getting requirements to build wheel: started 2023-03-23T10:23:19,948 Running command Getting requirements to build wheel 2023-03-23T10:23:21,071 2023-03-23T10:23:21,079 # Apache IoTDB 2023-03-23T10:23:21,080 [![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) 2023-03-23T10:23:21,080 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2023-03-23T10:23:21,080 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2023-03-23T10:23:21,081 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-03-23T10:23:21,081 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-03-23T10:23:21,081 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-03-23T10:23:21,082 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-03-23T10:23:21,082 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2023-03-23T10:23:21,082 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2023-03-23T10:23:21,083 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-03-23T10:23:21,084 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-03-23T10:23:21,084 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-03-23T10:23:21,084 architecture, high performance and rich feature set together with its deep integration with 2023-03-23T10:23:21,085 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-03-23T10:23:21,085 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-03-23T10:23:21,086 ## Python Native API 2023-03-23T10:23:21,086 ### Requirements 2023-03-23T10:23:21,087 You have to install thrift (>=0.13) before using the package. 2023-03-23T10:23:21,088 ### How to use (Example) 2023-03-23T10:23:21,089 First, download the latest package: `pip3 install apache-iotdb` 2023-03-23T10:23:21,089 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-03-23T10:23:21,090 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-03-23T10:23:21,091 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-03-23T10:23:21,091 (you need to add `import iotdb` in the head of the file) 2023-03-23T10:23:21,092 Or: 2023-03-23T10:23:21,092 ```python 2023-03-23T10:23:21,093 from iotdb.Session import Session 2023-03-23T10:23:21,093 ip = "127.0.0.1" 2023-03-23T10:23:21,094 port_ = "6667" 2023-03-23T10:23:21,094 username_ = "root" 2023-03-23T10:23:21,094 password_ = "root" 2023-03-23T10:23:21,095 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:21,095 session.open(False) 2023-03-23T10:23:21,095 zone = session.get_time_zone() 2023-03-23T10:23:21,096 session.close() 2023-03-23T10:23:21,096 ``` 2023-03-23T10:23:21,097 ### Initialization 2023-03-23T10:23:21,097 * Initialize a Session 2023-03-23T10:23:21,098 ```python 2023-03-23T10:23:21,098 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-03-23T10:23:21,099 ``` 2023-03-23T10:23:21,099 * Open a session, with a parameter to specify whether to enable RPC compression 2023-03-23T10:23:21,100 ```python 2023-03-23T10:23:21,100 session.open(enable_rpc_compression=False) 2023-03-23T10:23:21,100 ``` 2023-03-23T10:23:21,101 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-03-23T10:23:21,102 * Close a Session 2023-03-23T10:23:21,102 ```python 2023-03-23T10:23:21,103 session.close() 2023-03-23T10:23:21,103 ``` 2023-03-23T10:23:21,104 ### Data Definition Interface (DDL Interface) 2023-03-23T10:23:21,104 #### Storage Group Management 2023-03-23T10:23:21,105 * Set storage group 2023-03-23T10:23:21,105 ```python 2023-03-23T10:23:21,106 session.set_storage_group(group_name) 2023-03-23T10:23:21,106 ``` 2023-03-23T10:23:21,107 * Delete one or several storage groups 2023-03-23T10:23:21,107 ```python 2023-03-23T10:23:21,108 session.delete_storage_group(group_name) 2023-03-23T10:23:21,108 session.delete_storage_groups(group_name_lst) 2023-03-23T10:23:21,108 ``` 2023-03-23T10:23:21,108 #### Timeseries Management 2023-03-23T10:23:21,109 * Create one or multiple timeseries 2023-03-23T10:23:21,110 ```python 2023-03-23T10:23:21,110 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-03-23T10:23:21,110 props=None, tags=None, attributes=None, alias=None) 2023-03-23T10:23:21,111 session.create_multi_time_series( 2023-03-23T10:23:21,111 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-03-23T10:23:21,112 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-03-23T10:23:21,112 ) 2023-03-23T10:23:21,112 ``` 2023-03-23T10:23:21,113 * Create aligned timeseries 2023-03-23T10:23:21,113 ```python 2023-03-23T10:23:21,114 session.create_aligned_time_series( 2023-03-23T10:23:21,114 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-03-23T10:23:21,114 ) 2023-03-23T10:23:21,115 ``` 2023-03-23T10:23:21,115 Attention: Alias of measurements are **not supported** currently. 2023-03-23T10:23:21,116 * Delete one or several timeseries 2023-03-23T10:23:21,117 ```python 2023-03-23T10:23:21,117 session.delete_time_series(paths_list) 2023-03-23T10:23:21,117 ``` 2023-03-23T10:23:21,118 * Check whether the specific timeseries exists 2023-03-23T10:23:21,118 ```python 2023-03-23T10:23:21,119 session.check_time_series_exists(path) 2023-03-23T10:23:21,119 ``` 2023-03-23T10:23:21,120 ### Data Manipulation Interface (DML Interface) 2023-03-23T10:23:21,120 #### Insert 2023-03-23T10:23:21,121 It is recommended to use insertTablet to help improve write efficiency. 2023-03-23T10:23:21,122 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-03-23T10:23:21,122 * **Better Write Performance** 2023-03-23T10:23:21,122 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-03-23T10:23:21,123 We have two implementations of Tablet in Python API. 2023-03-23T10:23:21,124 * Normal Tablet 2023-03-23T10:23:21,124 ```python 2023-03-23T10:23:21,125 values_ = [ 2023-03-23T10:23:21,125 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-03-23T10:23:21,125 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-03-23T10:23:21,126 [False, 100, 1, 188.1, 688.25, "test03"], 2023-03-23T10:23:21,126 [True, 0, 0, 0, 6.25, "test04"], 2023-03-23T10:23:21,126 ] 2023-03-23T10:23:21,127 timestamps_ = [1, 2, 3, 4] 2023-03-23T10:23:21,127 tablet_ = Tablet( 2023-03-23T10:23:21,127 device_id, measurements_, data_types_, values_, timestamps_ 2023-03-23T10:23:21,127 ) 2023-03-23T10:23:21,128 session.insert_tablet(tablet_) 2023-03-23T10:23:21,128 ``` 2023-03-23T10:23:21,128 * Numpy Tablet 2023-03-23T10:23:21,129 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-03-23T10:23:21,129 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-03-23T10:23:21,130 **Notice** 2023-03-23T10:23:21,130 1. time and value columns in Tablet are ndarray. 2023-03-23T10:23:21,131 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-03-23T10:23:21,131 (if not, the default dtypes are also ok). 2023-03-23T10:23:21,131 ```python 2023-03-23T10:23:21,132 import numpy as np 2023-03-23T10:23:21,132 data_types_ = [ 2023-03-23T10:23:21,132 TSDataType.BOOLEAN, 2023-03-23T10:23:21,133 TSDataType.INT32, 2023-03-23T10:23:21,133 TSDataType.INT64, 2023-03-23T10:23:21,133 TSDataType.FLOAT, 2023-03-23T10:23:21,133 TSDataType.DOUBLE, 2023-03-23T10:23:21,134 TSDataType.TEXT, 2023-03-23T10:23:21,134 ] 2023-03-23T10:23:21,135 np_values_ = [ 2023-03-23T10:23:21,135 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-03-23T10:23:21,135 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-03-23T10:23:21,135 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-03-23T10:23:21,136 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-03-23T10:23:21,136 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-03-23T10:23:21,136 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-03-23T10:23:21,137 ] 2023-03-23T10:23:21,137 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-03-23T10:23:21,137 np_tablet_ = NumpyTablet( 2023-03-23T10:23:21,138 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-03-23T10:23:21,138 ) 2023-03-23T10:23:21,138 session.insert_tablet(np_tablet_) 2023-03-23T10:23:21,138 ``` 2023-03-23T10:23:21,139 * Insert multiple Tablets 2023-03-23T10:23:21,140 ```python 2023-03-23T10:23:21,140 session.insert_tablets(tablet_lst) 2023-03-23T10:23:21,140 ``` 2023-03-23T10:23:21,141 * Insert a Record 2023-03-23T10:23:21,141 ```python 2023-03-23T10:23:21,142 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-03-23T10:23:21,142 ``` 2023-03-23T10:23:21,143 * Insert multiple Records 2023-03-23T10:23:21,143 ```python 2023-03-23T10:23:21,144 session.insert_records( 2023-03-23T10:23:21,144 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-03-23T10:23:21,144 ) 2023-03-23T10:23:21,145 ``` 2023-03-23T10:23:21,145 * Insert multiple Records that belong to the same device. 2023-03-23T10:23:21,146 With type info the server has no need to do type inference, which leads a better performance 2023-03-23T10:23:21,146 ```python 2023-03-23T10:23:21,147 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-03-23T10:23:21,147 ``` 2023-03-23T10:23:21,148 #### Insert with type inference 2023-03-23T10:23:21,148 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-03-23T10:23:21,149 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-03-23T10:23:21,149 ```python 2023-03-23T10:23:21,150 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-03-23T10:23:21,150 ``` 2023-03-23T10:23:21,151 #### Insert of Aligned Timeseries 2023-03-23T10:23:21,152 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-03-23T10:23:21,153 * insert_aligned_record 2023-03-23T10:23:21,153 * insert_aligned_records 2023-03-23T10:23:21,154 * insert_aligned_records_of_one_device 2023-03-23T10:23:21,154 * insert_aligned_tablet 2023-03-23T10:23:21,154 * insert_aligned_tablets 2023-03-23T10:23:21,155 ### IoTDB-SQL Interface 2023-03-23T10:23:21,156 * Execute query statement 2023-03-23T10:23:21,157 ```python 2023-03-23T10:23:21,157 session.execute_query_statement(sql) 2023-03-23T10:23:21,157 ``` 2023-03-23T10:23:21,158 * Execute non query statement 2023-03-23T10:23:21,158 ```python 2023-03-23T10:23:21,159 session.execute_non_query_statement(sql) 2023-03-23T10:23:21,159 ``` 2023-03-23T10:23:21,160 ### Pandas Support 2023-03-23T10:23:21,160 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-03-23T10:23:21,161 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-03-23T10:23:21,161 Example: 2023-03-23T10:23:21,162 ```python 2023-03-23T10:23:21,162 from iotdb.Session import Session 2023-03-23T10:23:21,163 ip = "127.0.0.1" 2023-03-23T10:23:21,163 port_ = "6667" 2023-03-23T10:23:21,163 username_ = "root" 2023-03-23T10:23:21,164 password_ = "root" 2023-03-23T10:23:21,164 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:21,164 session.open(False) 2023-03-23T10:23:21,165 result = session.execute_query_statement("SELECT * FROM root.*") 2023-03-23T10:23:21,165 # Transform to Pandas Dataset 2023-03-23T10:23:21,165 df = result.todf() 2023-03-23T10:23:21,166 session.close() 2023-03-23T10:23:21,167 # Now you can work with the dataframe 2023-03-23T10:23:21,167 df = ... 2023-03-23T10:23:21,167 ``` 2023-03-23T10:23:21,168 ### IoTDB Testcontainer 2023-03-23T10:23:21,169 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-03-23T10:23:21,169 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-03-23T10:23:21,170 ```python 2023-03-23T10:23:21,170 class MyTestCase(unittest.TestCase): 2023-03-23T10:23:21,170 def test_something(self): 2023-03-23T10:23:21,171 with IoTDBContainer() as c: 2023-03-23T10:23:21,171 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-03-23T10:23:21,171 session.open(False) 2023-03-23T10:23:21,172 result = session.execute_query_statement("SHOW TIMESERIES") 2023-03-23T10:23:21,172 print(result) 2023-03-23T10:23:21,172 session.close() 2023-03-23T10:23:21,172 ``` 2023-03-23T10:23:21,173 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-03-23T10:23:21,174 ## Developers 2023-03-23T10:23:21,175 ### Introduction 2023-03-23T10:23:21,175 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-03-23T10:23:21,177 ### Prerequisites 2023-03-23T10:23:21,177 Python3.7 or later is preferred. 2023-03-23T10:23:21,178 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-03-23T10:23:21,178 ``` 2023-03-23T10:23:21,179 http://thrift.apache.org/docs/install/ 2023-03-23T10:23:21,179 ``` 2023-03-23T10:23:21,180 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-03-23T10:23:21,180 ```shell 2023-03-23T10:23:21,180 pip install -r requirements_dev.txt 2023-03-23T10:23:21,180 ``` 2023-03-23T10:23:21,182 ### Compile the thrift library and Debug 2023-03-23T10:23:21,182 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-03-23T10:23:21,183 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-03-23T10:23:21,183 This folder is ignored from git and should **never be pushed to git!** 2023-03-23T10:23:21,184 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-03-23T10:23:21,185 ### Session Client & Example 2023-03-23T10:23:21,186 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-03-23T10:23:21,187 Or, another simple example: 2023-03-23T10:23:21,187 ```python 2023-03-23T10:23:21,188 from iotdb.Session import Session 2023-03-23T10:23:21,188 ip = "127.0.0.1" 2023-03-23T10:23:21,189 port_ = "6667" 2023-03-23T10:23:21,189 username_ = "root" 2023-03-23T10:23:21,189 password_ = "root" 2023-03-23T10:23:21,190 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:21,190 session.open(False) 2023-03-23T10:23:21,190 zone = session.get_time_zone() 2023-03-23T10:23:21,191 session.close() 2023-03-23T10:23:21,191 ``` 2023-03-23T10:23:21,192 ### Tests 2023-03-23T10:23:21,193 Please add your custom tests in `tests` folder. 2023-03-23T10:23:21,193 To run all defined tests just type `pytest .` in the root folder. 2023-03-23T10:23:21,194 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-03-23T10:23:21,195 ### Futher Tools 2023-03-23T10:23:21,196 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-03-23T10:23:21,196 Both can be run by `black .` or `flake8 .` respectively. 2023-03-23T10:23:21,198 ## Releasing 2023-03-23T10:23:21,198 To do a release just ensure that you have the right set of generated thrift files. 2023-03-23T10:23:21,198 Then run linting and auto-formatting. 2023-03-23T10:23:21,199 Then, ensure that all tests work (via `pytest .`). 2023-03-23T10:23:21,199 Then you are good to go to do a release! 2023-03-23T10:23:21,200 ### Preparing your environment 2023-03-23T10:23:21,201 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-03-23T10:23:21,202 ### Doing the Release 2023-03-23T10:23:21,203 There is a convenient script `release.sh` to do all steps for a release. 2023-03-23T10:23:21,203 Namely, these are 2023-03-23T10:23:21,204 * Remove all transient directories from last release (if exists) 2023-03-23T10:23:21,204 * (Re-)generate all generated sources via mvn 2023-03-23T10:23:21,204 * Run Linting (flake8) 2023-03-23T10:23:21,205 * Run Tests via pytest 2023-03-23T10:23:21,205 * Build 2023-03-23T10:23:21,205 * Release to pypi 2023-03-23T10:23:21,267 running egg_info 2023-03-23T10:23:21,278 writing apache_iotdb.egg-info/PKG-INFO 2023-03-23T10:23:21,283 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-03-23T10:23:21,287 writing requirements to apache_iotdb.egg-info/requires.txt 2023-03-23T10:23:21,290 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-03-23T10:23:21,340 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:21,346 adding license file 'LICENSE' 2023-03-23T10:23:21,354 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:21,358 /tmp/pip-build-env-w_apa7l6/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-03-23T10:23:21,358 warnings.warn(msg) 2023-03-23T10:23:21,481 Getting requirements to build wheel: finished with status 'done' 2023-03-23T10:23:21,501 Created temporary directory: /tmp/pip-modern-metadata-u8f42e0v 2023-03-23T10:23:21,507 Preparing metadata (pyproject.toml): started 2023-03-23T10:23:21,509 Running command Preparing metadata (pyproject.toml) 2023-03-23T10:23:22,576 2023-03-23T10:23:22,584 # Apache IoTDB 2023-03-23T10:23:22,585 [![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) 2023-03-23T10:23:22,585 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2023-03-23T10:23:22,585 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2023-03-23T10:23:22,586 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-03-23T10:23:22,586 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-03-23T10:23:22,587 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-03-23T10:23:22,587 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-03-23T10:23:22,587 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2023-03-23T10:23:22,588 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2023-03-23T10:23:22,588 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-03-23T10:23:22,589 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-03-23T10:23:22,589 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-03-23T10:23:22,589 architecture, high performance and rich feature set together with its deep integration with 2023-03-23T10:23:22,590 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-03-23T10:23:22,590 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-03-23T10:23:22,591 ## Python Native API 2023-03-23T10:23:22,591 ### Requirements 2023-03-23T10:23:22,592 You have to install thrift (>=0.13) before using the package. 2023-03-23T10:23:22,593 ### How to use (Example) 2023-03-23T10:23:22,594 First, download the latest package: `pip3 install apache-iotdb` 2023-03-23T10:23:22,594 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-03-23T10:23:22,595 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-03-23T10:23:22,596 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-03-23T10:23:22,596 (you need to add `import iotdb` in the head of the file) 2023-03-23T10:23:22,597 Or: 2023-03-23T10:23:22,598 ```python 2023-03-23T10:23:22,598 from iotdb.Session import Session 2023-03-23T10:23:22,598 ip = "127.0.0.1" 2023-03-23T10:23:22,599 port_ = "6667" 2023-03-23T10:23:22,599 username_ = "root" 2023-03-23T10:23:22,599 password_ = "root" 2023-03-23T10:23:22,600 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:22,600 session.open(False) 2023-03-23T10:23:22,600 zone = session.get_time_zone() 2023-03-23T10:23:22,601 session.close() 2023-03-23T10:23:22,601 ``` 2023-03-23T10:23:22,602 ### Initialization 2023-03-23T10:23:22,602 * Initialize a Session 2023-03-23T10:23:22,603 ```python 2023-03-23T10:23:22,603 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-03-23T10:23:22,603 ``` 2023-03-23T10:23:22,604 * Open a session, with a parameter to specify whether to enable RPC compression 2023-03-23T10:23:22,605 ```python 2023-03-23T10:23:22,605 session.open(enable_rpc_compression=False) 2023-03-23T10:23:22,605 ``` 2023-03-23T10:23:22,606 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-03-23T10:23:22,606 * Close a Session 2023-03-23T10:23:22,607 ```python 2023-03-23T10:23:22,607 session.close() 2023-03-23T10:23:22,608 ``` 2023-03-23T10:23:22,608 ### Data Definition Interface (DDL Interface) 2023-03-23T10:23:22,609 #### Storage Group Management 2023-03-23T10:23:22,610 * Set storage group 2023-03-23T10:23:22,610 ```python 2023-03-23T10:23:22,610 session.set_storage_group(group_name) 2023-03-23T10:23:22,611 ``` 2023-03-23T10:23:22,612 * Delete one or several storage groups 2023-03-23T10:23:22,612 ```python 2023-03-23T10:23:22,612 session.delete_storage_group(group_name) 2023-03-23T10:23:22,613 session.delete_storage_groups(group_name_lst) 2023-03-23T10:23:22,613 ``` 2023-03-23T10:23:22,613 #### Timeseries Management 2023-03-23T10:23:22,614 * Create one or multiple timeseries 2023-03-23T10:23:22,615 ```python 2023-03-23T10:23:22,615 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-03-23T10:23:22,615 props=None, tags=None, attributes=None, alias=None) 2023-03-23T10:23:22,616 session.create_multi_time_series( 2023-03-23T10:23:22,616 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-03-23T10:23:22,617 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-03-23T10:23:22,617 ) 2023-03-23T10:23:22,617 ``` 2023-03-23T10:23:22,618 * Create aligned timeseries 2023-03-23T10:23:22,618 ```python 2023-03-23T10:23:22,619 session.create_aligned_time_series( 2023-03-23T10:23:22,619 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-03-23T10:23:22,619 ) 2023-03-23T10:23:22,620 ``` 2023-03-23T10:23:22,620 Attention: Alias of measurements are **not supported** currently. 2023-03-23T10:23:22,621 * Delete one or several timeseries 2023-03-23T10:23:22,621 ```python 2023-03-23T10:23:22,622 session.delete_time_series(paths_list) 2023-03-23T10:23:22,622 ``` 2023-03-23T10:23:22,623 * Check whether the specific timeseries exists 2023-03-23T10:23:22,623 ```python 2023-03-23T10:23:22,623 session.check_time_series_exists(path) 2023-03-23T10:23:22,624 ``` 2023-03-23T10:23:22,624 ### Data Manipulation Interface (DML Interface) 2023-03-23T10:23:22,625 #### Insert 2023-03-23T10:23:22,626 It is recommended to use insertTablet to help improve write efficiency. 2023-03-23T10:23:22,626 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-03-23T10:23:22,627 * **Better Write Performance** 2023-03-23T10:23:22,627 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-03-23T10:23:22,628 We have two implementations of Tablet in Python API. 2023-03-23T10:23:22,628 * Normal Tablet 2023-03-23T10:23:22,629 ```python 2023-03-23T10:23:22,629 values_ = [ 2023-03-23T10:23:22,630 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-03-23T10:23:22,630 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-03-23T10:23:22,630 [False, 100, 1, 188.1, 688.25, "test03"], 2023-03-23T10:23:22,630 [True, 0, 0, 0, 6.25, "test04"], 2023-03-23T10:23:22,631 ] 2023-03-23T10:23:22,631 timestamps_ = [1, 2, 3, 4] 2023-03-23T10:23:22,631 tablet_ = Tablet( 2023-03-23T10:23:22,632 device_id, measurements_, data_types_, values_, timestamps_ 2023-03-23T10:23:22,632 ) 2023-03-23T10:23:22,632 session.insert_tablet(tablet_) 2023-03-23T10:23:22,633 ``` 2023-03-23T10:23:22,633 * Numpy Tablet 2023-03-23T10:23:22,633 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-03-23T10:23:22,634 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-03-23T10:23:22,634 **Notice** 2023-03-23T10:23:22,635 1. time and value columns in Tablet are ndarray. 2023-03-23T10:23:22,635 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-03-23T10:23:22,635 (if not, the default dtypes are also ok). 2023-03-23T10:23:22,636 ```python 2023-03-23T10:23:22,636 import numpy as np 2023-03-23T10:23:22,637 data_types_ = [ 2023-03-23T10:23:22,637 TSDataType.BOOLEAN, 2023-03-23T10:23:22,637 TSDataType.INT32, 2023-03-23T10:23:22,638 TSDataType.INT64, 2023-03-23T10:23:22,638 TSDataType.FLOAT, 2023-03-23T10:23:22,638 TSDataType.DOUBLE, 2023-03-23T10:23:22,639 TSDataType.TEXT, 2023-03-23T10:23:22,639 ] 2023-03-23T10:23:22,639 np_values_ = [ 2023-03-23T10:23:22,639 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-03-23T10:23:22,640 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-03-23T10:23:22,640 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-03-23T10:23:22,640 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-03-23T10:23:22,641 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-03-23T10:23:22,641 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-03-23T10:23:22,641 ] 2023-03-23T10:23:22,642 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-03-23T10:23:22,642 np_tablet_ = NumpyTablet( 2023-03-23T10:23:22,642 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-03-23T10:23:22,642 ) 2023-03-23T10:23:22,643 session.insert_tablet(np_tablet_) 2023-03-23T10:23:22,643 ``` 2023-03-23T10:23:22,644 * Insert multiple Tablets 2023-03-23T10:23:22,644 ```python 2023-03-23T10:23:22,645 session.insert_tablets(tablet_lst) 2023-03-23T10:23:22,645 ``` 2023-03-23T10:23:22,646 * Insert a Record 2023-03-23T10:23:22,646 ```python 2023-03-23T10:23:22,647 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-03-23T10:23:22,647 ``` 2023-03-23T10:23:22,647 * Insert multiple Records 2023-03-23T10:23:22,648 ```python 2023-03-23T10:23:22,648 session.insert_records( 2023-03-23T10:23:22,649 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-03-23T10:23:22,649 ) 2023-03-23T10:23:22,649 ``` 2023-03-23T10:23:22,650 * Insert multiple Records that belong to the same device. 2023-03-23T10:23:22,650 With type info the server has no need to do type inference, which leads a better performance 2023-03-23T10:23:22,651 ```python 2023-03-23T10:23:22,651 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-03-23T10:23:22,652 ``` 2023-03-23T10:23:22,652 #### Insert with type inference 2023-03-23T10:23:22,653 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-03-23T10:23:22,654 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-03-23T10:23:22,654 ```python 2023-03-23T10:23:22,655 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-03-23T10:23:22,655 ``` 2023-03-23T10:23:22,656 #### Insert of Aligned Timeseries 2023-03-23T10:23:22,656 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-03-23T10:23:22,657 * insert_aligned_record 2023-03-23T10:23:22,657 * insert_aligned_records 2023-03-23T10:23:22,658 * insert_aligned_records_of_one_device 2023-03-23T10:23:22,658 * insert_aligned_tablet 2023-03-23T10:23:22,658 * insert_aligned_tablets 2023-03-23T10:23:22,659 ### IoTDB-SQL Interface 2023-03-23T10:23:22,660 * Execute query statement 2023-03-23T10:23:22,661 ```python 2023-03-23T10:23:22,661 session.execute_query_statement(sql) 2023-03-23T10:23:22,661 ``` 2023-03-23T10:23:22,662 * Execute non query statement 2023-03-23T10:23:22,663 ```python 2023-03-23T10:23:22,664 session.execute_non_query_statement(sql) 2023-03-23T10:23:22,664 ``` 2023-03-23T10:23:22,665 ### Pandas Support 2023-03-23T10:23:22,666 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-03-23T10:23:22,666 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-03-23T10:23:22,667 Example: 2023-03-23T10:23:22,668 ```python 2023-03-23T10:23:22,668 from iotdb.Session import Session 2023-03-23T10:23:22,669 ip = "127.0.0.1" 2023-03-23T10:23:22,669 port_ = "6667" 2023-03-23T10:23:22,669 username_ = "root" 2023-03-23T10:23:22,669 password_ = "root" 2023-03-23T10:23:22,670 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:22,670 session.open(False) 2023-03-23T10:23:22,670 result = session.execute_query_statement("SELECT * FROM root.*") 2023-03-23T10:23:22,671 # Transform to Pandas Dataset 2023-03-23T10:23:22,671 df = result.todf() 2023-03-23T10:23:22,672 session.close() 2023-03-23T10:23:22,672 # Now you can work with the dataframe 2023-03-23T10:23:22,673 df = ... 2023-03-23T10:23:22,673 ``` 2023-03-23T10:23:22,674 ### IoTDB Testcontainer 2023-03-23T10:23:22,674 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-03-23T10:23:22,675 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-03-23T10:23:22,675 ```python 2023-03-23T10:23:22,676 class MyTestCase(unittest.TestCase): 2023-03-23T10:23:22,676 def test_something(self): 2023-03-23T10:23:22,676 with IoTDBContainer() as c: 2023-03-23T10:23:22,677 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-03-23T10:23:22,677 session.open(False) 2023-03-23T10:23:22,677 result = session.execute_query_statement("SHOW TIMESERIES") 2023-03-23T10:23:22,678 print(result) 2023-03-23T10:23:22,678 session.close() 2023-03-23T10:23:22,678 ``` 2023-03-23T10:23:22,679 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-03-23T10:23:22,680 ## Developers 2023-03-23T10:23:22,680 ### Introduction 2023-03-23T10:23:22,681 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-03-23T10:23:22,682 ### Prerequisites 2023-03-23T10:23:22,682 Python3.7 or later is preferred. 2023-03-23T10:23:22,683 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-03-23T10:23:22,684 ``` 2023-03-23T10:23:22,684 http://thrift.apache.org/docs/install/ 2023-03-23T10:23:22,684 ``` 2023-03-23T10:23:22,685 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-03-23T10:23:22,685 ```shell 2023-03-23T10:23:22,686 pip install -r requirements_dev.txt 2023-03-23T10:23:22,686 ``` 2023-03-23T10:23:22,687 ### Compile the thrift library and Debug 2023-03-23T10:23:22,688 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-03-23T10:23:22,688 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-03-23T10:23:22,689 This folder is ignored from git and should **never be pushed to git!** 2023-03-23T10:23:22,689 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-03-23T10:23:22,691 ### Session Client & Example 2023-03-23T10:23:22,691 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-03-23T10:23:22,692 Or, another simple example: 2023-03-23T10:23:22,693 ```python 2023-03-23T10:23:22,693 from iotdb.Session import Session 2023-03-23T10:23:22,694 ip = "127.0.0.1" 2023-03-23T10:23:22,694 port_ = "6667" 2023-03-23T10:23:22,695 username_ = "root" 2023-03-23T10:23:22,695 password_ = "root" 2023-03-23T10:23:22,695 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:22,695 session.open(False) 2023-03-23T10:23:22,696 zone = session.get_time_zone() 2023-03-23T10:23:22,696 session.close() 2023-03-23T10:23:22,696 ``` 2023-03-23T10:23:22,698 ### Tests 2023-03-23T10:23:22,698 Please add your custom tests in `tests` folder. 2023-03-23T10:23:22,699 To run all defined tests just type `pytest .` in the root folder. 2023-03-23T10:23:22,699 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-03-23T10:23:22,701 ### Futher Tools 2023-03-23T10:23:22,701 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-03-23T10:23:22,702 Both can be run by `black .` or `flake8 .` respectively. 2023-03-23T10:23:22,703 ## Releasing 2023-03-23T10:23:22,703 To do a release just ensure that you have the right set of generated thrift files. 2023-03-23T10:23:22,704 Then run linting and auto-formatting. 2023-03-23T10:23:22,704 Then, ensure that all tests work (via `pytest .`). 2023-03-23T10:23:22,704 Then you are good to go to do a release! 2023-03-23T10:23:22,705 ### Preparing your environment 2023-03-23T10:23:22,706 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-03-23T10:23:22,707 ### Doing the Release 2023-03-23T10:23:22,708 There is a convenient script `release.sh` to do all steps for a release. 2023-03-23T10:23:22,708 Namely, these are 2023-03-23T10:23:22,709 * Remove all transient directories from last release (if exists) 2023-03-23T10:23:22,709 * (Re-)generate all generated sources via mvn 2023-03-23T10:23:22,709 * Run Linting (flake8) 2023-03-23T10:23:22,710 * Run Tests via pytest 2023-03-23T10:23:22,710 * Build 2023-03-23T10:23:22,710 * Release to pypi 2023-03-23T10:23:22,712 running dist_info 2023-03-23T10:23:22,751 creating /tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info 2023-03-23T10:23:22,762 writing /tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/PKG-INFO 2023-03-23T10:23:22,767 writing dependency_links to /tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/dependency_links.txt 2023-03-23T10:23:22,772 writing requirements to /tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/requires.txt 2023-03-23T10:23:22,774 writing top-level names to /tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/top_level.txt 2023-03-23T10:23:22,777 writing manifest file '/tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:22,825 reading manifest file '/tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:22,829 adding license file 'LICENSE' 2023-03-23T10:23:22,836 writing manifest file '/tmp/pip-modern-metadata-u8f42e0v/apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:22,838 creating '/tmp/pip-modern-metadata-u8f42e0v/apache_iotdb-0.13.5.1.dist-info' 2023-03-23T10:23:23,031 /tmp/pip-build-env-w_apa7l6/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-03-23T10:23:23,031 warnings.warn(msg) 2023-03-23T10:23:23,156 Preparing metadata (pyproject.toml): finished with status 'done' 2023-03-23T10:23:23,173 Source in /tmp/pip-wheel-r2fbo6mg/apache-iotdb_9cd92967f54847908bd27e444dec6751 has version 0.13.5.1, which satisfies requirement apache-iotdb==0.13.5.1 from https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz 2023-03-23T10:23:23,175 Removed apache-iotdb==0.13.5.1 from https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz from build tracker '/tmp/pip-build-tracker-f_jesudj' 2023-03-23T10:23:23,192 Created temporary directory: /tmp/pip-unpack-f1n0241g 2023-03-23T10:23:23,193 Building wheels for collected packages: apache-iotdb 2023-03-23T10:23:23,202 Created temporary directory: /tmp/pip-wheel-_ba0ar1f 2023-03-23T10:23:23,203 Destination directory: /tmp/pip-wheel-_ba0ar1f 2023-03-23T10:23:23,208 Building wheel for apache-iotdb (pyproject.toml): started 2023-03-23T10:23:23,210 Running command Building wheel for apache-iotdb (pyproject.toml) 2023-03-23T10:23:24,258 2023-03-23T10:23:24,266 # Apache IoTDB 2023-03-23T10:23:24,266 [![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) 2023-03-23T10:23:24,267 [![Main Win](https://github.com/apache/iotdb/actions/workflows/main-win.yml/badge.svg)](https://github.com/apache/iotdb/actions/workflows/main-win.yml) 2023-03-23T10:23:24,267 [![coveralls](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master)](https://coveralls.io/repos/github/apache/iotdb/badge.svg?branch=master) 2023-03-23T10:23:24,267 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-03-23T10:23:24,268 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-03-23T10:23:24,268 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-03-23T10:23:24,268 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-03-23T10:23:24,269 ![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg) 2023-03-23T10:23:24,269 ![](https://img.shields.io/badge/java--language-1.8-blue.svg) 2023-03-23T10:23:24,269 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-03-23T10:23:24,270 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-03-23T10:23:24,271 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-03-23T10:23:24,271 architecture, high performance and rich feature set together with its deep integration with 2023-03-23T10:23:24,271 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-03-23T10:23:24,272 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-03-23T10:23:24,272 ## Python Native API 2023-03-23T10:23:24,273 ### Requirements 2023-03-23T10:23:24,274 You have to install thrift (>=0.13) before using the package. 2023-03-23T10:23:24,275 ### How to use (Example) 2023-03-23T10:23:24,276 First, download the latest package: `pip3 install apache-iotdb` 2023-03-23T10:23:24,276 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-03-23T10:23:24,277 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-03-23T10:23:24,278 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-03-23T10:23:24,278 (you need to add `import iotdb` in the head of the file) 2023-03-23T10:23:24,279 Or: 2023-03-23T10:23:24,279 ```python 2023-03-23T10:23:24,280 from iotdb.Session import Session 2023-03-23T10:23:24,280 ip = "127.0.0.1" 2023-03-23T10:23:24,281 port_ = "6667" 2023-03-23T10:23:24,281 username_ = "root" 2023-03-23T10:23:24,281 password_ = "root" 2023-03-23T10:23:24,281 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:24,282 session.open(False) 2023-03-23T10:23:24,282 zone = session.get_time_zone() 2023-03-23T10:23:24,282 session.close() 2023-03-23T10:23:24,283 ``` 2023-03-23T10:23:24,283 ### Initialization 2023-03-23T10:23:24,284 * Initialize a Session 2023-03-23T10:23:24,285 ```python 2023-03-23T10:23:24,285 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-03-23T10:23:24,285 ``` 2023-03-23T10:23:24,286 * Open a session, with a parameter to specify whether to enable RPC compression 2023-03-23T10:23:24,286 ```python 2023-03-23T10:23:24,287 session.open(enable_rpc_compression=False) 2023-03-23T10:23:24,287 ``` 2023-03-23T10:23:24,288 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-03-23T10:23:24,288 * Close a Session 2023-03-23T10:23:24,289 ```python 2023-03-23T10:23:24,289 session.close() 2023-03-23T10:23:24,289 ``` 2023-03-23T10:23:24,290 ### Data Definition Interface (DDL Interface) 2023-03-23T10:23:24,291 #### Storage Group Management 2023-03-23T10:23:24,291 * Set storage group 2023-03-23T10:23:24,292 ```python 2023-03-23T10:23:24,292 session.set_storage_group(group_name) 2023-03-23T10:23:24,293 ``` 2023-03-23T10:23:24,293 * Delete one or several storage groups 2023-03-23T10:23:24,294 ```python 2023-03-23T10:23:24,294 session.delete_storage_group(group_name) 2023-03-23T10:23:24,295 session.delete_storage_groups(group_name_lst) 2023-03-23T10:23:24,295 ``` 2023-03-23T10:23:24,295 #### Timeseries Management 2023-03-23T10:23:24,296 * Create one or multiple timeseries 2023-03-23T10:23:24,297 ```python 2023-03-23T10:23:24,297 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-03-23T10:23:24,297 props=None, tags=None, attributes=None, alias=None) 2023-03-23T10:23:24,298 session.create_multi_time_series( 2023-03-23T10:23:24,298 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-03-23T10:23:24,298 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-03-23T10:23:24,299 ) 2023-03-23T10:23:24,299 ``` 2023-03-23T10:23:24,300 * Create aligned timeseries 2023-03-23T10:23:24,300 ```python 2023-03-23T10:23:24,301 session.create_aligned_time_series( 2023-03-23T10:23:24,301 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-03-23T10:23:24,301 ) 2023-03-23T10:23:24,301 ``` 2023-03-23T10:23:24,302 Attention: Alias of measurements are **not supported** currently. 2023-03-23T10:23:24,303 * Delete one or several timeseries 2023-03-23T10:23:24,303 ```python 2023-03-23T10:23:24,304 session.delete_time_series(paths_list) 2023-03-23T10:23:24,304 ``` 2023-03-23T10:23:24,305 * Check whether the specific timeseries exists 2023-03-23T10:23:24,305 ```python 2023-03-23T10:23:24,305 session.check_time_series_exists(path) 2023-03-23T10:23:24,306 ``` 2023-03-23T10:23:24,306 ### Data Manipulation Interface (DML Interface) 2023-03-23T10:23:24,307 #### Insert 2023-03-23T10:23:24,308 It is recommended to use insertTablet to help improve write efficiency. 2023-03-23T10:23:24,308 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-03-23T10:23:24,308 * **Better Write Performance** 2023-03-23T10:23:24,309 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-03-23T10:23:24,310 We have two implementations of Tablet in Python API. 2023-03-23T10:23:24,310 * Normal Tablet 2023-03-23T10:23:24,311 ```python 2023-03-23T10:23:24,311 values_ = [ 2023-03-23T10:23:24,311 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-03-23T10:23:24,312 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-03-23T10:23:24,312 [False, 100, 1, 188.1, 688.25, "test03"], 2023-03-23T10:23:24,312 [True, 0, 0, 0, 6.25, "test04"], 2023-03-23T10:23:24,313 ] 2023-03-23T10:23:24,313 timestamps_ = [1, 2, 3, 4] 2023-03-23T10:23:24,313 tablet_ = Tablet( 2023-03-23T10:23:24,314 device_id, measurements_, data_types_, values_, timestamps_ 2023-03-23T10:23:24,314 ) 2023-03-23T10:23:24,314 session.insert_tablet(tablet_) 2023-03-23T10:23:24,315 ``` 2023-03-23T10:23:24,315 * Numpy Tablet 2023-03-23T10:23:24,315 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-03-23T10:23:24,316 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-03-23T10:23:24,316 **Notice** 2023-03-23T10:23:24,317 1. time and value columns in Tablet are ndarray. 2023-03-23T10:23:24,317 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-03-23T10:23:24,317 (if not, the default dtypes are also ok). 2023-03-23T10:23:24,318 ```python 2023-03-23T10:23:24,318 import numpy as np 2023-03-23T10:23:24,318 data_types_ = [ 2023-03-23T10:23:24,319 TSDataType.BOOLEAN, 2023-03-23T10:23:24,319 TSDataType.INT32, 2023-03-23T10:23:24,319 TSDataType.INT64, 2023-03-23T10:23:24,320 TSDataType.FLOAT, 2023-03-23T10:23:24,320 TSDataType.DOUBLE, 2023-03-23T10:23:24,320 TSDataType.TEXT, 2023-03-23T10:23:24,321 ] 2023-03-23T10:23:24,321 np_values_ = [ 2023-03-23T10:23:24,321 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-03-23T10:23:24,322 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-03-23T10:23:24,322 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-03-23T10:23:24,322 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-03-23T10:23:24,322 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-03-23T10:23:24,323 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-03-23T10:23:24,323 ] 2023-03-23T10:23:24,323 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-03-23T10:23:24,324 np_tablet_ = NumpyTablet( 2023-03-23T10:23:24,324 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-03-23T10:23:24,324 ) 2023-03-23T10:23:24,325 session.insert_tablet(np_tablet_) 2023-03-23T10:23:24,325 ``` 2023-03-23T10:23:24,326 * Insert multiple Tablets 2023-03-23T10:23:24,326 ```python 2023-03-23T10:23:24,327 session.insert_tablets(tablet_lst) 2023-03-23T10:23:24,327 ``` 2023-03-23T10:23:24,327 * Insert a Record 2023-03-23T10:23:24,328 ```python 2023-03-23T10:23:24,328 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-03-23T10:23:24,329 ``` 2023-03-23T10:23:24,329 * Insert multiple Records 2023-03-23T10:23:24,330 ```python 2023-03-23T10:23:24,330 session.insert_records( 2023-03-23T10:23:24,330 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-03-23T10:23:24,331 ) 2023-03-23T10:23:24,331 ``` 2023-03-23T10:23:24,332 * Insert multiple Records that belong to the same device. 2023-03-23T10:23:24,332 With type info the server has no need to do type inference, which leads a better performance 2023-03-23T10:23:24,333 ```python 2023-03-23T10:23:24,333 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-03-23T10:23:24,333 ``` 2023-03-23T10:23:24,334 #### Insert with type inference 2023-03-23T10:23:24,335 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-03-23T10:23:24,335 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-03-23T10:23:24,336 ```python 2023-03-23T10:23:24,336 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-03-23T10:23:24,337 ``` 2023-03-23T10:23:24,337 #### Insert of Aligned Timeseries 2023-03-23T10:23:24,338 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-03-23T10:23:24,339 * insert_aligned_record 2023-03-23T10:23:24,339 * insert_aligned_records 2023-03-23T10:23:24,339 * insert_aligned_records_of_one_device 2023-03-23T10:23:24,339 * insert_aligned_tablet 2023-03-23T10:23:24,340 * insert_aligned_tablets 2023-03-23T10:23:24,341 ### IoTDB-SQL Interface 2023-03-23T10:23:24,341 * Execute query statement 2023-03-23T10:23:24,342 ```python 2023-03-23T10:23:24,342 session.execute_query_statement(sql) 2023-03-23T10:23:24,343 ``` 2023-03-23T10:23:24,343 * Execute non query statement 2023-03-23T10:23:24,344 ```python 2023-03-23T10:23:24,344 session.execute_non_query_statement(sql) 2023-03-23T10:23:24,345 ``` 2023-03-23T10:23:24,346 ### Pandas Support 2023-03-23T10:23:24,347 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-03-23T10:23:24,347 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-03-23T10:23:24,348 Example: 2023-03-23T10:23:24,349 ```python 2023-03-23T10:23:24,349 from iotdb.Session import Session 2023-03-23T10:23:24,350 ip = "127.0.0.1" 2023-03-23T10:23:24,350 port_ = "6667" 2023-03-23T10:23:24,350 username_ = "root" 2023-03-23T10:23:24,350 password_ = "root" 2023-03-23T10:23:24,351 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:24,351 session.open(False) 2023-03-23T10:23:24,351 result = session.execute_query_statement("SELECT * FROM root.*") 2023-03-23T10:23:24,352 # Transform to Pandas Dataset 2023-03-23T10:23:24,352 df = result.todf() 2023-03-23T10:23:24,353 session.close() 2023-03-23T10:23:24,353 # Now you can work with the dataframe 2023-03-23T10:23:24,354 df = ... 2023-03-23T10:23:24,354 ``` 2023-03-23T10:23:24,355 ### IoTDB Testcontainer 2023-03-23T10:23:24,355 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-03-23T10:23:24,356 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-03-23T10:23:24,356 ```python 2023-03-23T10:23:24,357 class MyTestCase(unittest.TestCase): 2023-03-23T10:23:24,357 def test_something(self): 2023-03-23T10:23:24,357 with IoTDBContainer() as c: 2023-03-23T10:23:24,358 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-03-23T10:23:24,358 session.open(False) 2023-03-23T10:23:24,358 result = session.execute_query_statement("SHOW TIMESERIES") 2023-03-23T10:23:24,359 print(result) 2023-03-23T10:23:24,359 session.close() 2023-03-23T10:23:24,359 ``` 2023-03-23T10:23:24,360 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-03-23T10:23:24,361 ## Developers 2023-03-23T10:23:24,361 ### Introduction 2023-03-23T10:23:24,362 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-03-23T10:23:24,363 ### Prerequisites 2023-03-23T10:23:24,363 Python3.7 or later is preferred. 2023-03-23T10:23:24,364 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-03-23T10:23:24,365 ``` 2023-03-23T10:23:24,365 http://thrift.apache.org/docs/install/ 2023-03-23T10:23:24,365 ``` 2023-03-23T10:23:24,366 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-03-23T10:23:24,366 ```shell 2023-03-23T10:23:24,366 pip install -r requirements_dev.txt 2023-03-23T10:23:24,367 ``` 2023-03-23T10:23:24,368 ### Compile the thrift library and Debug 2023-03-23T10:23:24,368 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-03-23T10:23:24,369 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-03-23T10:23:24,369 This folder is ignored from git and should **never be pushed to git!** 2023-03-23T10:23:24,370 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-03-23T10:23:24,371 ### Session Client & Example 2023-03-23T10:23:24,372 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-03-23T10:23:24,373 Or, another simple example: 2023-03-23T10:23:24,374 ```python 2023-03-23T10:23:24,374 from iotdb.Session import Session 2023-03-23T10:23:24,375 ip = "127.0.0.1" 2023-03-23T10:23:24,375 port_ = "6667" 2023-03-23T10:23:24,375 username_ = "root" 2023-03-23T10:23:24,375 password_ = "root" 2023-03-23T10:23:24,376 session = Session(ip, port_, username_, password_) 2023-03-23T10:23:24,376 session.open(False) 2023-03-23T10:23:24,376 zone = session.get_time_zone() 2023-03-23T10:23:24,377 session.close() 2023-03-23T10:23:24,377 ``` 2023-03-23T10:23:24,378 ### Tests 2023-03-23T10:23:24,379 Please add your custom tests in `tests` folder. 2023-03-23T10:23:24,379 To run all defined tests just type `pytest .` in the root folder. 2023-03-23T10:23:24,380 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-03-23T10:23:24,381 ### Futher Tools 2023-03-23T10:23:24,382 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-03-23T10:23:24,382 Both can be run by `black .` or `flake8 .` respectively. 2023-03-23T10:23:24,383 ## Releasing 2023-03-23T10:23:24,384 To do a release just ensure that you have the right set of generated thrift files. 2023-03-23T10:23:24,384 Then run linting and auto-formatting. 2023-03-23T10:23:24,385 Then, ensure that all tests work (via `pytest .`). 2023-03-23T10:23:24,385 Then you are good to go to do a release! 2023-03-23T10:23:24,386 ### Preparing your environment 2023-03-23T10:23:24,387 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-03-23T10:23:24,388 ### Doing the Release 2023-03-23T10:23:24,388 There is a convenient script `release.sh` to do all steps for a release. 2023-03-23T10:23:24,389 Namely, these are 2023-03-23T10:23:24,389 * Remove all transient directories from last release (if exists) 2023-03-23T10:23:24,390 * (Re-)generate all generated sources via mvn 2023-03-23T10:23:24,390 * Run Linting (flake8) 2023-03-23T10:23:24,390 * Run Tests via pytest 2023-03-23T10:23:24,390 * Build 2023-03-23T10:23:24,391 * Release to pypi 2023-03-23T10:23:24,496 running bdist_wheel 2023-03-23T10:23:24,571 running build 2023-03-23T10:23:24,572 running build_py 2023-03-23T10:23:24,590 creating build 2023-03-23T10:23:24,591 creating build/lib 2023-03-23T10:23:24,592 creating build/lib/tests 2023-03-23T10:23:24,594 copying tests/__init__.py -> build/lib/tests 2023-03-23T10:23:24,598 copying tests/test_delete_data.py -> build/lib/tests 2023-03-23T10:23:24,602 copying tests/test_dataframe.py -> build/lib/tests 2023-03-23T10:23:24,606 copying tests/test_numpy_tablet.py -> build/lib/tests 2023-03-23T10:23:24,610 copying tests/tablet_performance_comparison.py -> build/lib/tests 2023-03-23T10:23:24,614 copying tests/test_todf.py -> build/lib/tests 2023-03-23T10:23:24,618 copying tests/test_tablet.py -> build/lib/tests 2023-03-23T10:23:24,622 copying tests/test_aligned_timeseries.py -> build/lib/tests 2023-03-23T10:23:24,626 copying tests/test_session.py -> build/lib/tests 2023-03-23T10:23:24,632 creating build/lib/iotdb 2023-03-23T10:23:24,634 copying iotdb/__init__.py -> build/lib/iotdb 2023-03-23T10:23:24,638 copying iotdb/Session.py -> build/lib/iotdb 2023-03-23T10:23:24,645 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2023-03-23T10:23:24,651 creating build/lib/iotdb/utils 2023-03-23T10:23:24,653 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,657 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,662 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,666 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,671 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,675 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,678 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,682 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,686 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2023-03-23T10:23:24,691 creating build/lib/iotdb/thrift 2023-03-23T10:23:24,694 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2023-03-23T10:23:24,699 creating build/lib/iotdb/thrift/rpc 2023-03-23T10:23:24,701 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2023-03-23T10:23:24,706 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2023-03-23T10:23:24,709 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2023-03-23T10:23:24,726 copying iotdb/thrift/rpc/TSIService.py -> build/lib/iotdb/thrift/rpc 2023-03-23T10:23:24,787 installing to build/bdist.linux-armv7l/wheel 2023-03-23T10:23:24,788 running install 2023-03-23T10:23:24,848 running install_lib 2023-03-23T10:23:24,865 creating build/bdist.linux-armv7l 2023-03-23T10:23:24,866 creating build/bdist.linux-armv7l/wheel 2023-03-23T10:23:24,870 creating build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,873 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,878 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,883 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,887 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,892 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,897 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,902 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,906 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,911 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2023-03-23T10:23:24,916 creating build/bdist.linux-armv7l/wheel/iotdb 2023-03-23T10:23:24,919 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,921 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,925 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,929 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,933 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,937 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,942 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,945 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,949 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,953 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-03-23T10:23:24,958 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-03-23T10:23:24,962 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-03-23T10:23:24,970 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-03-23T10:23:24,974 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-03-23T10:23:24,977 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-03-23T10:23:24,982 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-03-23T10:23:24,984 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-03-23T10:23:24,988 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-03-23T10:23:24,992 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-03-23T10:23:25,009 copying build/lib/iotdb/thrift/rpc/TSIService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-03-23T10:23:25,031 running install_egg_info 2023-03-23T10:23:25,089 running egg_info 2023-03-23T10:23:25,099 writing apache_iotdb.egg-info/PKG-INFO 2023-03-23T10:23:25,104 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-03-23T10:23:25,108 writing requirements to apache_iotdb.egg-info/requires.txt 2023-03-23T10:23:25,111 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-03-23T10:23:25,135 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:25,141 adding license file 'LICENSE' 2023-03-23T10:23:25,150 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-03-23T10:23:25,153 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.5.1-py3.7.egg-info 2023-03-23T10:23:25,174 running install_scripts 2023-03-23T10:23:25,213 creating build/bdist.linux-armv7l/wheel/apache_iotdb-0.13.5.1.dist-info/WHEEL 2023-03-23T10:23:25,219 creating '/tmp/pip-wheel-_ba0ar1f/.tmp-9rpzfudq/apache_iotdb-0.13.5.1-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-03-23T10:23:25,227 adding 'iotdb/IoTDBContainer.py' 2023-03-23T10:23:25,238 adding 'iotdb/Session.py' 2023-03-23T10:23:25,242 adding 'iotdb/__init__.py' 2023-03-23T10:23:25,245 adding 'iotdb/thrift/__init__.py' 2023-03-23T10:23:25,274 adding 'iotdb/thrift/rpc/TSIService.py' 2023-03-23T10:23:25,283 adding 'iotdb/thrift/rpc/__init__.py' 2023-03-23T10:23:25,286 adding 'iotdb/thrift/rpc/constants.py' 2023-03-23T10:23:25,316 adding 'iotdb/thrift/rpc/ttypes.py' 2023-03-23T10:23:25,325 adding 'iotdb/utils/BitMap.py' 2023-03-23T10:23:25,329 adding 'iotdb/utils/Field.py' 2023-03-23T10:23:25,331 adding 'iotdb/utils/IoTDBConstants.py' 2023-03-23T10:23:25,336 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2023-03-23T10:23:25,340 adding 'iotdb/utils/NumpyTablet.py' 2023-03-23T10:23:25,343 adding 'iotdb/utils/RowRecord.py' 2023-03-23T10:23:25,346 adding 'iotdb/utils/SessionDataSet.py' 2023-03-23T10:23:25,349 adding 'iotdb/utils/Tablet.py' 2023-03-23T10:23:25,352 adding 'iotdb/utils/__init__.py' 2023-03-23T10:23:25,356 adding 'tests/__init__.py' 2023-03-23T10:23:25,360 adding 'tests/tablet_performance_comparison.py' 2023-03-23T10:23:25,364 adding 'tests/test_aligned_timeseries.py' 2023-03-23T10:23:25,367 adding 'tests/test_dataframe.py' 2023-03-23T10:23:25,370 adding 'tests/test_delete_data.py' 2023-03-23T10:23:25,373 adding 'tests/test_numpy_tablet.py' 2023-03-23T10:23:25,377 adding 'tests/test_session.py' 2023-03-23T10:23:25,381 adding 'tests/test_tablet.py' 2023-03-23T10:23:25,384 adding 'tests/test_todf.py' 2023-03-23T10:23:25,389 adding 'apache_iotdb-0.13.5.1.dist-info/LICENSE' 2023-03-23T10:23:25,394 adding 'apache_iotdb-0.13.5.1.dist-info/METADATA' 2023-03-23T10:23:25,396 adding 'apache_iotdb-0.13.5.1.dist-info/WHEEL' 2023-03-23T10:23:25,398 adding 'apache_iotdb-0.13.5.1.dist-info/top_level.txt' 2023-03-23T10:23:25,401 adding 'apache_iotdb-0.13.5.1.dist-info/RECORD' 2023-03-23T10:23:25,407 removing build/bdist.linux-armv7l/wheel 2023-03-23T10:23:25,431 /tmp/pip-build-env-w_apa7l6/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-03-23T10:23:25,431 warnings.warn(msg) 2023-03-23T10:23:25,562 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2023-03-23T10:23:25,580 Created wheel for apache-iotdb: filename=apache_iotdb-0.13.5.1-py3-none-any.whl size=79773 sha256=43316f1302a0f1a08a1842964fb611e34f317e908b76d1872954c09f2c5f5919 2023-03-23T10:23:25,582 Stored in directory: /tmp/pip-ephem-wheel-cache-lp8ulzf2/wheels/c9/07/82/d1fb6eca8c9b3aa0de9e879018a555027f35604a93bc5b89f3 2023-03-23T10:23:25,613 Successfully built apache-iotdb 2023-03-23T10:23:25,629 Removed build tracker: '/tmp/pip-build-tracker-f_jesudj'