2024-01-05T20:36:42,500 Created temporary directory: /tmp/pip-build-tracker-gzzhb4wu 2024-01-05T20:36:42,501 Initialized build tracking at /tmp/pip-build-tracker-gzzhb4wu 2024-01-05T20:36:42,502 Created build tracker: /tmp/pip-build-tracker-gzzhb4wu 2024-01-05T20:36:42,502 Entered build tracker: /tmp/pip-build-tracker-gzzhb4wu 2024-01-05T20:36:42,503 Created temporary directory: /tmp/pip-wheel-i05oyk3r 2024-01-05T20:36:42,506 Created temporary directory: /tmp/pip-ephem-wheel-cache-zf_pzy_t 2024-01-05T20:36:42,529 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-01-05T20:36:42,532 2 location(s) to search for versions of apache-iotdb: 2024-01-05T20:36:42,532 * https://pypi.org/simple/apache-iotdb/ 2024-01-05T20:36:42,532 * https://www.piwheels.org/simple/apache-iotdb/ 2024-01-05T20:36:42,533 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2024-01-05T20:36:42,534 Getting page https://pypi.org/simple/apache-iotdb/ 2024-01-05T20:36:42,536 Found index url https://pypi.org/simple/ 2024-01-05T20:36:42,812 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2024-01-05T20:36:42,824 Found link https://files.pythonhosted.org/packages/76/14/d01b6281df00530c69bc8eae2074b9970bbe865a5e971b5cd2019e8b8250/apache-iotdb-0.9.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.0 2024-01-05T20:36:42,825 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/84/aa/fa9401ccadb89ddce7c2b8a03baee9dbb9913c52b5936d0ec7968cabf056/apache_iotdb-0.9.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,826 Found link https://files.pythonhosted.org/packages/01/fa/e65db378e4d8e07322ec175f37568bceb55ebb3c8397fa7b48e9f087c451/apache-iotdb-0.9.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.2 2024-01-05T20:36:42,826 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/43/8d/72fa03325e9281b613a0eabae9cc7c606ce0e8952bee0c3ca855e4579a1d/apache_iotdb-0.9.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,827 Found link https://files.pythonhosted.org/packages/34/95/030c2da665358de8ba950099b3b0397dca437fcde60d5d1730d0c451d5e3/apache-iotdb-0.9.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.3 2024-01-05T20:36:42,828 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/5c/d4/2e329baab32ad93730ba4b79df9b91f1d55d0d37428a5dbbe2dd4c9f3a9d/apache_iotdb-0.9.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,829 Found link https://files.pythonhosted.org/packages/1d/dc/138e08717f8c2e0e238f35d39b34af6cfc1c7a1332b6aa4689750f4fda26/apache-iotdb-0.10.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.0 2024-01-05T20:36:42,830 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c3/76/46884f04945b6f02bbec4e06d83fafc16f326ca0f9b35b8c0141018990c0/apache_iotdb-0.10.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,831 Found link https://files.pythonhosted.org/packages/f6/4d/b229b9f309431e8164c9cd893431009a57efcaa059f58c1091d222601da3/apache-iotdb-0.10.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.1 2024-01-05T20:36:42,831 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d6/87/2e003dcf87ffa8e73f48a62a107b989967e906670d905a05ae1c1349f396/apache_iotdb-0.10.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,832 Found link https://files.pythonhosted.org/packages/16/8b/2ec65fa81d5961bd927c02d6a209490bf325b2a164506cd3b12e846d7061/apache-iotdb-0.11.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.0 2024-01-05T20:36:42,833 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/47/c8/047703f7e8125b15361c766b90c6f1cbdbf797f84803f38b1732c1a386cb/apache_iotdb-0.11.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,834 Found link https://files.pythonhosted.org/packages/55/a1/ef100f67e0f26fbc1d19b84115b21de942e7b7e01803706d19f841ac06c1/apache-iotdb-0.11.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.1 2024-01-05T20:36:42,835 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/9f/dce2d782c8b64700539039ef5d66f5f7a781689538c0a176cf56099ec9d1/apache_iotdb-0.11.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,836 Found link https://files.pythonhosted.org/packages/69/d5/f1b9ff293fe02eb1f1cb3cba13b5d9a4b547415ab0045b2a8a3612249e12/apache-iotdb-0.11.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.2 2024-01-05T20:36:42,836 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/96/a5f0c63659cc8477c53d8a8321c07ea5a0bb2430abaaab477a6185bb43a1/apache_iotdb-0.11.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,837 Found link https://files.pythonhosted.org/packages/7d/cf/0d672a828527f59cdc66c078b0b8e356ca0a3191224a4363ce2256337d1c/apache-iotdb-0.11.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.3 2024-01-05T20:36:42,838 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d2/c7/6709b26341e59788d05a297182aa3f96c692e85421c169f657e92c3b4765/apache_iotdb-0.11.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,839 Found link https://files.pythonhosted.org/packages/00/a1/5b1b8a2754f4b25420d9a4461b5e2b8573bb89b43054f9303ea0558df0de/apache-iotdb-0.11.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.4 2024-01-05T20:36:42,840 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/48/f4/a21fd4495f93c428de788a477665f1815b257568469c38108666125fff4b/apache_iotdb-0.11.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,841 Found link https://files.pythonhosted.org/packages/9e/16/bb2ef45f62e9866f1be97f04e2c581247d3b145e5d8a01b7c143023c6c45/apache-iotdb-0.12.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.0 2024-01-05T20:36:42,841 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/32/e051c3ce387e54b1f036995e92ff352895cf01a51b170752e906a7d42364/apache_iotdb-0.12.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,842 Found link https://files.pythonhosted.org/packages/20/0c/b39e9f362fb0a1a43cb0a05a5b2d9163815f0048575e0c071bbaa50070b8/apache-iotdb-0.12.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.1 2024-01-05T20:36:42,843 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/55/cf/219a0c3cd17537cebf6e67deeaa77b57741c9b40bcddbb7f59ac9b828401/apache_iotdb-0.12.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,844 Found link https://files.pythonhosted.org/packages/fd/64/d83ceaaab941dd78df38cd8c35d27028a27724c2535f0e6f01a48472aa28/apache-iotdb-0.12.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.2 2024-01-05T20:36:42,845 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/0b/33/60af46cbc25d7ecf9722bf311295cb0acbf2841f6eb3e3af7433ac3e199d/apache_iotdb-0.12.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,846 Found link https://files.pythonhosted.org/packages/24/7c/81a9dcfd218d4654b03d9079578659d6201aa4f9e9ccba328c0742e8e9c1/apache-iotdb-0.12.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.3 2024-01-05T20:36:42,847 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/ae/e79cef98fa20cf977ea22b065fcff8d7b976922dd281f4a74a02b1a72b41/apache_iotdb-0.12.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,848 Found link https://files.pythonhosted.org/packages/9e/11/0d12f9b906b3aac1446c09e297bcdf3a0cdfb016aae1ec77effa214999de/apache-iotdb-0.12.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.4 2024-01-05T20:36:42,848 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/cb/34f5d9137086d912e4518d751eca1ac9a8b908706c4b3176ca32911fabd2/apache_iotdb-0.12.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,849 Found link https://files.pythonhosted.org/packages/8a/52/93503eac47c1561edc21431f7154b694afad9d461e2af0fea36966953c24/apache-iotdb-0.12.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.5 2024-01-05T20:36:42,850 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7a/30/1cd9bca76c1f4f9b4cd48d11f23103ade9c5a35410bbf0a8f5997bab51b0/apache_iotdb-0.12.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,851 Found link https://files.pythonhosted.org/packages/00/d9/19746ff8906cc2ac3c9326fbcbd244d2424f4aad5d7201843956d27dcb0b/apache-iotdb-0.12.6.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.6 2024-01-05T20:36:42,851 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/cf/7b/ab3acb96fd057e900f9aca1b030f4fb42caf4104000ab742ce19a1029b6f/apache_iotdb-0.12.6-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,852 Found link https://files.pythonhosted.org/packages/a6/cd/33de301e51132f8d0d79adc346d38685a6b871251846bad95b35ebf74ac9/apache-iotdb-0.13.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0 2024-01-05T20:36:42,853 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/71/c1/3684d3b6e6eddda5fbe994e123c6bc6569409994a44b5d3e4b130554802a/apache_iotdb-0.13.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,854 Found link https://files.pythonhosted.org/packages/7e/3e/40f0d900e04598036cc65ae437a2ee9f4aa149860d434a6f4b291460582c/apache-iotdb-0.13.0.post1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0.post1 2024-01-05T20:36:42,854 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7c/f2/ef6f589910f1b850ad665d4958e2a26b5249bddc81d5f29a711e21a79dc1/apache_iotdb-0.13.0.post1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,856 Found link https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.1 2024-01-05T20:36:42,856 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/b7/1d/3074d8ab58366c99783fe0ed853472a21d69dfd2b80ca001281d170833e2/apache_iotdb-0.13.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,857 Found link https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.2 2024-01-05T20:36:42,858 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/94/0c/3a7d8a238d7c8771453889f8f03f9ebcd418839306e64f4ddea8c0baee81/apache_iotdb-0.13.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,859 Found link https://files.pythonhosted.org/packages/30/a0/0153c56e1af8653bfdcf47423949dd6b23e53882c9009acc25e661a44dbe/apache-iotdb-0.13.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.3 2024-01-05T20:36:42,860 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/a0/51/7e8405405f7f0ef8eabab31b4860cb747a8acfa53e30f56939c115b53db9/apache_iotdb-0.13.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,861 Found link https://files.pythonhosted.org/packages/42/eb/3d7ac8d794238b75997ff3f55db6e02436bfa558a8df4ea21e58bf8db6fd/apache-iotdb-0.13.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5 2024-01-05T20:36:42,861 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/51/a3/9117edfd3d72a1d338b7cff8060e672dd7b39dfeb2ca0d6c22db51bf9b90/apache_iotdb-0.13.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,862 Found link https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5.1 2024-01-05T20:36:42,863 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/89/0a/816b8a85f6be9f8fe3534f79ea12341dad900b59ba0ac126835640a09db0/apache_iotdb-0.13.5.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,864 Found link https://files.pythonhosted.org/packages/bb/7d/24cefdcd57e96d496fd3492fc28b3d53da6ba0fc6ee69f99dddec1cf500c/apache-iotdb-0.14.0rc1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.14.0rc1 2024-01-05T20:36:42,864 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/6d/37/0e5a292ed1a695927cefec20d4ad01d3c7af78e691d5250f1646f318d4ef/apache_iotdb-0.14.0rc1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,865 Found link https://files.pythonhosted.org/packages/49/91/11702001bdc0af0266d5f4dd222b5f937684e8c08e5044735ade6748cd58/apache-iotdb-1.0.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.0 2024-01-05T20:36:42,866 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3d/57/3019d5cf51e6198d5b7ee9e3c07a15efa7487e8b280b4b71cc521a6651e3/apache_iotdb-1.0.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,867 Found link https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.1 2024-01-05T20:36:42,868 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/06/82/b658ff03f52072e1afde6bb9f1f1933427ef776a78e246965943fba552d8/apache_iotdb-1.0.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,869 Found link https://files.pythonhosted.org/packages/15/99/bf0d6eae0c005a4dcc88068be36ea3e5b4dcb26e50b6698b4bd814d052e9/apache-iotdb-1.1.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.0 2024-01-05T20:36:42,870 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3b/cd/72bfb3f3f3684bfe0c054dfd8c34fdb8a85f7572a6ec27b7a6ff99127516/apache_iotdb-1.1.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,871 Found link https://files.pythonhosted.org/packages/51/36/6e73e46e1d6b2d2272a5a1b369da16dd36a3120aa883ea86d2a9a85ce105/apache-iotdb-1.1.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.2 2024-01-05T20:36:42,872 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/74/d6/3ad8c98fc4321ba99120a231634801b6bf1eea9520e5aa5d153b6fab6f61/apache_iotdb-1.1.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,872 Found link https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.0 2024-01-05T20:36:42,873 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/b9/84d2d8e158ef2d5317f4f6ce0f14be616ec2b93c090fbf06a84e41d1cedd/apache_iotdb-1.2.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,874 Found link https://files.pythonhosted.org/packages/86/cd/f88e673287faf21660046a1ec14dc917a5e598f2145ea2f1da0767dae759/apache-iotdb-1.2.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.1 2024-01-05T20:36:42,874 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c6/a6/8f5f10ad95e5a2c2f54c78011ff2848a7b96860a439eeecdf136c3364795/apache_iotdb-1.2.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,875 Found link https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.0 2024-01-05T20:36:42,876 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/f3/83/1292d28c772d573c1c2d191a1bcec031c5ee48fc0e0549ab6e0046142519/apache_iotdb-1.3.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:42,877 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2024-01-05T20:36:42,878 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2024-01-05T20:36:42,879 Found index url https://www.piwheels.org/simple/ 2024-01-05T20:36:43,040 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2024-01-05T20:36:43,052 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.1-py3-none-any.whl#sha256=23c4b520884e408c124527f709ba7d5c14e606dec0ea24e8a8ff33d2098c849a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,053 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.0-py3-none-any.whl#sha256=e6253fd0619e108f72e54769a1fdec7500f43db062b603e1bed07ebb989698b2 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,053 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.2-py3-none-any.whl#sha256=47e1ea2a866155bd45db05471a074cd1b4bede6e798d2b6a63e218767c92ae12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,054 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.0-py3-none-any.whl#sha256=17b0261e5e0602df730baf1bdd055750c850a2fd0163d2ce09d0083dfcf169f4 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,054 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.1-py3-none-any.whl#sha256=9fc3d243ca97c88bd3ca1f5092686e3ab5c99a6e5206fd6a6c6fdaab15c796b6 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,055 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.0-py3-none-any.whl#sha256=85d0bb3ddb1c79359fec18e85c6d515dc3639752d77dea32c09c8afe0fefc906 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,056 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.14.0rc1-py3-none-any.whl#sha256=2f71e6b3443c4748717889729380082daa7bd8f9950d4c17909134372367bccc (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,057 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5.1-py3-none-any.whl#sha256=43316f1302a0f1a08a1842964fb611e34f317e908b76d1872954c09f2c5f5919 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,057 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5-py3-none-any.whl#sha256=e25dac25664b9ff8313cbb697f634269ef857ec9217d3256b893c43c8b0c151f (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,058 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.3-py3-none-any.whl#sha256=c3be87cabc4d19ad9fd999f524ac8547b971adb4a304bf8874fdb56a6ecca371 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,058 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.2-py3-none-any.whl#sha256=136811be5cdfe045bc349a8f6c0b07117600185c0c7ada8353610179adde27ae (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,059 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.1-py3-none-any.whl#sha256=22668867268f1ea89b8205cbda30d0578aaa5ccfff0b552396e7059a95d3781a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,060 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0.post1-py3-none-any.whl#sha256=d53cf02df2cc507d9caf48167c52d69e24abab9800430de3ff8abf8159bff63b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,060 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0-py3-none-any.whl#sha256=67b7429e60cdd5e1e3a808592a87a591c028af62de8e2fec2535b4a3105f21b7 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,061 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.6-py3-none-any.whl#sha256=a4f679df0053b74f83de861277de12e030eb8601063b172ec44789118ba11400 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,062 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.5-py3-none-any.whl#sha256=06bb080be5b0469037e68db56a7feb10da911a396a47d598598d8d8c50d07419 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,062 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.4-py3-none-any.whl#sha256=af5fa8000dd449fb6d98420287b2049b5e68d268fa1529fa96955b5fe7637c13 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,063 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.3-py3-none-any.whl#sha256=eb77b047b61a087b286e01afea6ee9761c9e687479a4e551be085d82612ed220 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,067 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.2-py3-none-any.whl#sha256=bb7605db211272947ba451cdad35a2b4f554167361f0c08acedbfb0723ac7ab8 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,068 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.1-py3-none-any.whl#sha256=bc5ddc6b683bf26a0b9a8c47ada13d29918503664e9e1c3fdefae73121f3a327 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,069 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.0-py3-none-any.whl#sha256=061d9407266b9d100113fa2d11890a8d5d56f8b496305c5864f08a9af35fcc12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,069 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.4-py3-none-any.whl#sha256=cf1ee85db62d31642b32742aba0a026a941b85cf4bb49ec48ef09b9e241f3bf5 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,070 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.3-py3-none-any.whl#sha256=55e9a0042694ba7fa482f733a1d548c0180bccf0e35e090b85d7b9050c95162b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,070 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.2-py3-none-any.whl#sha256=762d5b0c5f82869237d5375d2a8774f99654c3b693d6f77bf6e9decc78b7fd5d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,071 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.1-py3-none-any.whl#sha256=317a24e4870d587820f8d5be294e2e9a6ad09f70566ce4380506085c47b2fc0a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,071 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.0-py3-none-any.whl#sha256=4771e87dd8d933815206c063014beff8eff4c8025353723ac67603f49a119224 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,072 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.1-py3-none-any.whl#sha256=b4b13fa0d6ed86fbcc1231cad3d220ee81b38452e87fea655641720f803d4c1d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,072 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.0-py3-none-any.whl#sha256=388ade65f63cb37eef343e4f294cf3488b79894ff8061a7d9b2bf42277ded9de (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,073 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.3-py3-none-any.whl#sha256=b535b53a5182dc94116e67edb4a34c1efb007574273e2ff4ad72ebc3b4634326 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,073 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.2-py3-none-any.whl#sha256=b7fad95c7f041f18a621439aa3cd19fc79d76caa85a93967163566c10b7c6348 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,074 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.0-py3-none-any.whl#sha256=1feb6b731a9af26aac7a1e6fab74e85dd960562a1dca6e4c5c9d10234a570e82 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-01-05T20:36:43,075 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2024-01-05T20:36:43,076 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2024-01-05T20:36:43,102 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2024-01-05T20:36:43,122 Collecting apache-iotdb==1.3.0 2024-01-05T20:36:43,125 Created temporary directory: /tmp/pip-unpack-vn0_l1g_ 2024-01-05T20:36:43,341 Downloading apache-iotdb-1.3.0.tar.gz (88 kB) 2024-01-05T20:36:43,576 Added apache-iotdb==1.3.0 from https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz to build tracker '/tmp/pip-build-tracker-gzzhb4wu' 2024-01-05T20:36:43,581 Created temporary directory: /tmp/pip-build-env-885lctgg 2024-01-05T20:36:43,586 Installing build dependencies: started 2024-01-05T20:36:43,587 Running command pip subprocess to install build dependencies 2024-01-05T20:36:44,748 Using pip 23.3.1 from /home/piwheels/.local/lib/python3.11/site-packages/pip (python 3.11) 2024-01-05T20:36:45,295 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-01-05T20:36:46,737 Collecting setuptools>=40.8.0 2024-01-05T20:36:46,764 Using cached https://www.piwheels.org/simple/setuptools/setuptools-69.0.3-py3-none-any.whl (819 kB) 2024-01-05T20:36:46,987 Collecting wheel 2024-01-05T20:36:47,001 Using cached https://www.piwheels.org/simple/wheel/wheel-0.42.0-py3-none-any.whl (65 kB) 2024-01-05T20:36:49,709 Installing collected packages: wheel, setuptools 2024-01-05T20:36:49,941 Creating /tmp/pip-build-env-885lctgg/overlay/local/bin 2024-01-05T20:36:49,944 changing mode of /tmp/pip-build-env-885lctgg/overlay/local/bin/wheel to 755 2024-01-05T20:36:52,228 Successfully installed setuptools-69.0.3 wheel-0.42.0 2024-01-05T20:36:52,494 [notice] A new release of pip is available: 23.3.1 -> 23.3.2 2024-01-05T20:36:52,495 [notice] To update, run: python3 -m pip install --upgrade pip 2024-01-05T20:36:52,771 Installing build dependencies: finished with status 'done' 2024-01-05T20:36:52,775 Getting requirements to build wheel: started 2024-01-05T20:36:52,776 Running command Getting requirements to build wheel 2024-01-05T20:36:53,236 2024-01-05T20:36:53,251 # Apache IoTDB 2024-01-05T20:36:53,252 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2024-01-05T20:36:53,252 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-01-05T20:36:53,253 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-01-05T20:36:53,254 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-01-05T20:36:53,254 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-01-05T20:36:53,255 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-01-05T20:36:53,255 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-01-05T20:36:53,257 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-01-05T20:36:53,257 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-01-05T20:36:53,258 architecture, high performance and rich feature set together with its deep integration with 2024-01-05T20:36:53,258 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-01-05T20:36:53,259 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-01-05T20:36:53,260 ## Python Native API 2024-01-05T20:36:53,261 ### Requirements 2024-01-05T20:36:53,263 You have to install thrift (>=0.13) before using the package. 2024-01-05T20:36:53,265 ### How to use (Example) 2024-01-05T20:36:53,266 First, download the latest package: `pip3 install apache-iotdb` 2024-01-05T20:36:53,267 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2024-01-05T20:36:53,268 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2024-01-05T20:36:53,269 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-01-05T20:36:53,270 (you need to add `import iotdb` in the head of the file) 2024-01-05T20:36:53,271 Or: 2024-01-05T20:36:53,272 ```python 2024-01-05T20:36:53,273 from iotdb.Session import Session 2024-01-05T20:36:53,274 ip = "127.0.0.1" 2024-01-05T20:36:53,275 port_ = "6667" 2024-01-05T20:36:53,276 username_ = "root" 2024-01-05T20:36:53,276 password_ = "root" 2024-01-05T20:36:53,277 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:53,277 session.open(False) 2024-01-05T20:36:53,278 zone = session.get_time_zone() 2024-01-05T20:36:53,278 session.close() 2024-01-05T20:36:53,279 ``` 2024-01-05T20:36:53,280 ### Initialization 2024-01-05T20:36:53,282 * Initialize a Session 2024-01-05T20:36:53,283 ```python 2024-01-05T20:36:53,284 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-01-05T20:36:53,284 ``` 2024-01-05T20:36:53,285 * Open a session, with a parameter to specify whether to enable RPC compression 2024-01-05T20:36:53,286 ```python 2024-01-05T20:36:53,287 session.open(enable_rpc_compression=False) 2024-01-05T20:36:53,287 ``` 2024-01-05T20:36:53,289 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-01-05T20:36:53,290 * Close a Session 2024-01-05T20:36:53,292 ```python 2024-01-05T20:36:53,292 session.close() 2024-01-05T20:36:53,293 ``` 2024-01-05T20:36:53,294 ### Data Definition Interface (DDL Interface) 2024-01-05T20:36:53,296 #### DATABASE Management 2024-01-05T20:36:53,297 * CREATE DATABASE 2024-01-05T20:36:53,299 ```python 2024-01-05T20:36:53,299 session.set_storage_group(group_name) 2024-01-05T20:36:53,300 ``` 2024-01-05T20:36:53,301 * Delete one or several databases 2024-01-05T20:36:53,302 ```python 2024-01-05T20:36:53,303 session.delete_storage_group(group_name) 2024-01-05T20:36:53,304 session.delete_storage_groups(group_name_lst) 2024-01-05T20:36:53,304 ``` 2024-01-05T20:36:53,305 #### Timeseries Management 2024-01-05T20:36:53,307 * Create one or multiple timeseries 2024-01-05T20:36:53,308 ```python 2024-01-05T20:36:53,308 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-01-05T20:36:53,308 props=None, tags=None, attributes=None, alias=None) 2024-01-05T20:36:53,310 session.create_multi_time_series( 2024-01-05T20:36:53,310 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-01-05T20:36:53,311 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-01-05T20:36:53,311 ) 2024-01-05T20:36:53,312 ``` 2024-01-05T20:36:53,312 * Create aligned timeseries 2024-01-05T20:36:53,313 ```python 2024-01-05T20:36:53,314 session.create_aligned_time_series( 2024-01-05T20:36:53,314 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-01-05T20:36:53,315 ) 2024-01-05T20:36:53,315 ``` 2024-01-05T20:36:53,316 Attention: Alias of measurements are **not supported** currently. 2024-01-05T20:36:53,317 * Delete one or several timeseries 2024-01-05T20:36:53,318 ```python 2024-01-05T20:36:53,319 session.delete_time_series(paths_list) 2024-01-05T20:36:53,319 ``` 2024-01-05T20:36:53,321 * Check whether the specific timeseries exists 2024-01-05T20:36:53,322 ```python 2024-01-05T20:36:53,322 session.check_time_series_exists(path) 2024-01-05T20:36:53,323 ``` 2024-01-05T20:36:53,324 ### Data Manipulation Interface (DML Interface) 2024-01-05T20:36:53,325 #### Insert 2024-01-05T20:36:53,326 It is recommended to use insertTablet to help improve write efficiency. 2024-01-05T20:36:53,327 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-01-05T20:36:53,328 * **Better Write Performance** 2024-01-05T20:36:53,328 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-01-05T20:36:53,330 We have two implementations of Tablet in Python API. 2024-01-05T20:36:53,331 * Normal Tablet 2024-01-05T20:36:53,333 ```python 2024-01-05T20:36:53,333 values_ = [ 2024-01-05T20:36:53,334 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:53,335 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:53,335 [False, 100, 1, 188.1, 688.25, "test03"], 2024-01-05T20:36:53,336 [True, 0, 0, 0, 6.25, "test04"], 2024-01-05T20:36:53,336 ] 2024-01-05T20:36:53,337 timestamps_ = [1, 2, 3, 4] 2024-01-05T20:36:53,337 tablet_ = Tablet( 2024-01-05T20:36:53,338 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:53,339 ) 2024-01-05T20:36:53,339 session.insert_tablet(tablet_) 2024-01-05T20:36:53,341 values_ = [ 2024-01-05T20:36:53,341 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:53,342 [True, None, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:53,342 [False, 100, None, 188.1, 688.25, "test03"], 2024-01-05T20:36:53,343 [True, 0, 0, 0, None, None], 2024-01-05T20:36:53,344 ] 2024-01-05T20:36:53,345 timestamps_ = [16, 17, 18, 19] 2024-01-05T20:36:53,345 tablet_ = Tablet( 2024-01-05T20:36:53,346 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:53,347 ) 2024-01-05T20:36:53,347 session.insert_tablet(tablet_) 2024-01-05T20:36:53,348 ``` 2024-01-05T20:36:53,349 * Numpy Tablet 2024-01-05T20:36:53,350 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-01-05T20:36:53,350 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-01-05T20:36:53,352 **Notice** 2024-01-05T20:36:53,352 1. time and value columns in Tablet are ndarray. 2024-01-05T20:36:53,353 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-01-05T20:36:53,354 (if not, the default dtypes are also ok). 2024-01-05T20:36:53,355 ```python 2024-01-05T20:36:53,356 import numpy as np 2024-01-05T20:36:53,356 data_types_ = [ 2024-01-05T20:36:53,357 TSDataType.BOOLEAN, 2024-01-05T20:36:53,357 TSDataType.INT32, 2024-01-05T20:36:53,358 TSDataType.INT64, 2024-01-05T20:36:53,358 TSDataType.FLOAT, 2024-01-05T20:36:53,359 TSDataType.DOUBLE, 2024-01-05T20:36:53,360 TSDataType.TEXT, 2024-01-05T20:36:53,360 ] 2024-01-05T20:36:53,361 np_values_ = [ 2024-01-05T20:36:53,361 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:53,362 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:53,362 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:53,362 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:53,363 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:53,363 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:53,364 ] 2024-01-05T20:36:53,364 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:53,365 np_tablet_ = NumpyTablet( 2024-01-05T20:36:53,365 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-01-05T20:36:53,366 ) 2024-01-05T20:36:53,366 session.insert_tablet(np_tablet_) 2024-01-05T20:36:53,367 # insert one numpy tablet with none into the database. 2024-01-05T20:36:53,368 np_values_ = [ 2024-01-05T20:36:53,368 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:53,369 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:53,370 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:53,370 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:53,371 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:53,372 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:53,372 ] 2024-01-05T20:36:53,373 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:53,374 np_bitmaps_ = [] 2024-01-05T20:36:53,374 for i in range(len(measurements_)): 2024-01-05T20:36:53,375 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-01-05T20:36:53,376 np_bitmaps_[0].mark(0) 2024-01-05T20:36:53,376 np_bitmaps_[1].mark(1) 2024-01-05T20:36:53,377 np_bitmaps_[2].mark(2) 2024-01-05T20:36:53,377 np_bitmaps_[4].mark(3) 2024-01-05T20:36:53,378 np_bitmaps_[5].mark(3) 2024-01-05T20:36:53,379 np_tablet_with_none = NumpyTablet( 2024-01-05T20:36:53,379 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-01-05T20:36:53,380 ) 2024-01-05T20:36:53,380 session.insert_tablet(np_tablet_with_none) 2024-01-05T20:36:53,381 ``` 2024-01-05T20:36:53,382 * Insert multiple Tablets 2024-01-05T20:36:53,383 ```python 2024-01-05T20:36:53,384 session.insert_tablets(tablet_lst) 2024-01-05T20:36:53,384 ``` 2024-01-05T20:36:53,385 * Insert a Record 2024-01-05T20:36:53,386 ```python 2024-01-05T20:36:53,387 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-01-05T20:36:53,387 ``` 2024-01-05T20:36:53,389 * Insert multiple Records 2024-01-05T20:36:53,390 ```python 2024-01-05T20:36:53,390 session.insert_records( 2024-01-05T20:36:53,391 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-01-05T20:36:53,392 ) 2024-01-05T20:36:53,392 ``` 2024-01-05T20:36:53,393 * Insert multiple Records that belong to the same device. 2024-01-05T20:36:53,394 With type info the server has no need to do type inference, which leads a better performance 2024-01-05T20:36:53,396 ```python 2024-01-05T20:36:53,396 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-01-05T20:36:53,397 ``` 2024-01-05T20:36:53,398 #### Insert with type inference 2024-01-05T20:36:53,399 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2024-01-05T20:36:53,401 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-01-05T20:36:53,402 ```python 2024-01-05T20:36:53,402 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-01-05T20:36:53,403 ``` 2024-01-05T20:36:53,403 #### Insert of Aligned Timeseries 2024-01-05T20:36:53,404 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-01-05T20:36:53,405 * insert_aligned_record 2024-01-05T20:36:53,406 * insert_aligned_records 2024-01-05T20:36:53,406 * insert_aligned_records_of_one_device 2024-01-05T20:36:53,407 * insert_aligned_tablet 2024-01-05T20:36:53,407 * insert_aligned_tablets 2024-01-05T20:36:53,408 ### IoTDB-SQL Interface 2024-01-05T20:36:53,409 * Execute query statement 2024-01-05T20:36:53,410 ```python 2024-01-05T20:36:53,411 session.execute_query_statement(sql) 2024-01-05T20:36:53,411 ``` 2024-01-05T20:36:53,413 * Execute non query statement 2024-01-05T20:36:53,414 ```python 2024-01-05T20:36:53,415 session.execute_non_query_statement(sql) 2024-01-05T20:36:53,416 ``` 2024-01-05T20:36:53,417 * Execute statement 2024-01-05T20:36:53,419 ```python 2024-01-05T20:36:53,420 session.execute_statement(sql) 2024-01-05T20:36:53,420 ``` 2024-01-05T20:36:53,422 ### Device Template 2024-01-05T20:36:53,423 #### Create Device Template 2024-01-05T20:36:53,424 The step for creating a metadata template is as follows 2024-01-05T20:36:53,424 1. Create the template class 2024-01-05T20:36:53,425 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-01-05T20:36:53,426 3. Execute create device template function 2024-01-05T20:36:53,428 ```python 2024-01-05T20:36:53,428 template = Template(name=template_name, share_time=True) 2024-01-05T20:36:53,431 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-01-05T20:36:53,431 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-01-05T20:36:53,432 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-01-05T20:36:53,434 i_node_gps.add_child(m_node_x) 2024-01-05T20:36:53,435 i_node_v.add_child(m_node_x) 2024-01-05T20:36:53,437 template.add_template(i_node_gps) 2024-01-05T20:36:53,438 template.add_template(i_node_v) 2024-01-05T20:36:53,439 template.add_template(m_node_x) 2024-01-05T20:36:53,441 session.create_schema_template(template) 2024-01-05T20:36:53,442 ``` 2024-01-05T20:36:53,442 #### Modify Device Template nodes 2024-01-05T20:36:53,443 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-01-05T20:36:53,444 * add node in template 2024-01-05T20:36:53,445 ```python 2024-01-05T20:36:53,446 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-01-05T20:36:53,447 ``` 2024-01-05T20:36:53,448 * delete node in template 2024-01-05T20:36:53,449 ```python 2024-01-05T20:36:53,450 session.delete_node_in_template(template_name, path) 2024-01-05T20:36:53,450 ``` 2024-01-05T20:36:53,452 #### Set Device Template 2024-01-05T20:36:53,453 ```python 2024-01-05T20:36:53,454 session.set_schema_template(template_name, prefix_path) 2024-01-05T20:36:53,455 ``` 2024-01-05T20:36:53,457 #### Uset Device Template 2024-01-05T20:36:53,458 ```python 2024-01-05T20:36:53,459 session.unset_schema_template(template_name, prefix_path) 2024-01-05T20:36:53,460 ``` 2024-01-05T20:36:53,462 #### Show Device Template 2024-01-05T20:36:53,463 * Show all device templates 2024-01-05T20:36:53,463 ```python 2024-01-05T20:36:53,465 session.show_all_templates() 2024-01-05T20:36:53,465 ``` 2024-01-05T20:36:53,466 * Count all nodes in templates 2024-01-05T20:36:53,467 ```python 2024-01-05T20:36:53,467 session.count_measurements_in_template(template_name) 2024-01-05T20:36:53,468 ``` 2024-01-05T20:36:53,470 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-01-05T20:36:53,470 ```python 2024-01-05T20:36:53,471 session.count_measurements_in_template(template_name, path) 2024-01-05T20:36:53,472 ``` 2024-01-05T20:36:53,473 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-01-05T20:36:53,474 ```python 2024-01-05T20:36:53,475 session.is_path_exist_in_template(template_name, path) 2024-01-05T20:36:53,476 ``` 2024-01-05T20:36:53,477 * Show nodes under in device template 2024-01-05T20:36:53,477 ```python 2024-01-05T20:36:53,478 session.show_measurements_in_template(template_name) 2024-01-05T20:36:53,479 ``` 2024-01-05T20:36:53,480 * Show the path prefix where a device template is set 2024-01-05T20:36:53,480 ```python 2024-01-05T20:36:53,481 session.show_paths_template_set_on(template_name) 2024-01-05T20:36:53,481 ``` 2024-01-05T20:36:53,483 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-01-05T20:36:53,483 ```python 2024-01-05T20:36:53,484 session.show_paths_template_using_on(template_name) 2024-01-05T20:36:53,484 ``` 2024-01-05T20:36:53,486 #### Drop Device Template 2024-01-05T20:36:53,486 Delete an existing metadata template,dropping an already set template is not supported 2024-01-05T20:36:53,487 ```python 2024-01-05T20:36:53,487 session.drop_schema_template("template_python") 2024-01-05T20:36:53,488 ``` 2024-01-05T20:36:53,491 ### Pandas Support 2024-01-05T20:36:53,493 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-01-05T20:36:53,493 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-01-05T20:36:53,495 Example: 2024-01-05T20:36:53,496 ```python 2024-01-05T20:36:53,497 from iotdb.Session import Session 2024-01-05T20:36:53,498 ip = "127.0.0.1" 2024-01-05T20:36:53,499 port_ = "6667" 2024-01-05T20:36:53,499 username_ = "root" 2024-01-05T20:36:53,500 password_ = "root" 2024-01-05T20:36:53,500 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:53,501 session.open(False) 2024-01-05T20:36:53,502 result = session.execute_query_statement("SELECT * FROM root.*") 2024-01-05T20:36:53,503 # Transform to Pandas Dataset 2024-01-05T20:36:53,503 df = result.todf() 2024-01-05T20:36:53,504 session.close() 2024-01-05T20:36:53,505 # Now you can work with the dataframe 2024-01-05T20:36:53,506 df = ... 2024-01-05T20:36:53,506 ``` 2024-01-05T20:36:53,507 ### IoTDB Testcontainer 2024-01-05T20:36:53,508 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2024-01-05T20:36:53,509 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-01-05T20:36:53,510 ```python 2024-01-05T20:36:53,510 class MyTestCase(unittest.TestCase): 2024-01-05T20:36:53,511 def test_something(self): 2024-01-05T20:36:53,512 with IoTDBContainer() as c: 2024-01-05T20:36:53,512 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-01-05T20:36:53,513 session.open(False) 2024-01-05T20:36:53,513 result = session.execute_query_statement("SHOW TIMESERIES") 2024-01-05T20:36:53,514 print(result) 2024-01-05T20:36:53,514 session.close() 2024-01-05T20:36:53,515 ``` 2024-01-05T20:36:53,516 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2024-01-05T20:36:53,518 ### IoTDB DBAPI 2024-01-05T20:36:53,519 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-01-05T20:36:53,519 interface for accessing databases in Python. 2024-01-05T20:36:53,520 #### Examples 2024-01-05T20:36:53,520 + Initialization 2024-01-05T20:36:53,521 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-01-05T20:36:53,521 ```python 2024-01-05T20:36:53,522 from iotdb.dbapi import connect 2024-01-05T20:36:53,522 ip = "127.0.0.1" 2024-01-05T20:36:53,523 port_ = "6667" 2024-01-05T20:36:53,523 username_ = "root" 2024-01-05T20:36:53,524 password_ = "root" 2024-01-05T20:36:53,524 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-01-05T20:36:53,524 cursor = conn.cursor() 2024-01-05T20:36:53,525 ``` 2024-01-05T20:36:53,525 + simple SQL statement execution 2024-01-05T20:36:53,525 ```python 2024-01-05T20:36:53,526 cursor.execute("SELECT * FROM root.*") 2024-01-05T20:36:53,526 for row in cursor.fetchall(): 2024-01-05T20:36:53,527 print(row) 2024-01-05T20:36:53,527 ``` 2024-01-05T20:36:53,528 + execute SQL with parameter 2024-01-05T20:36:53,529 IoTDB DBAPI supports pyformat style parameters 2024-01-05T20:36:53,529 ```python 2024-01-05T20:36:53,530 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-01-05T20:36:53,530 for row in cursor.fetchall(): 2024-01-05T20:36:53,530 print(row) 2024-01-05T20:36:53,531 ``` 2024-01-05T20:36:53,532 + execute SQL with parameter sequences 2024-01-05T20:36:53,532 ```python 2024-01-05T20:36:53,533 seq_of_parameters = [ 2024-01-05T20:36:53,533 {"timestamp": 1, "temperature": 1}, 2024-01-05T20:36:53,534 {"timestamp": 2, "temperature": 2}, 2024-01-05T20:36:53,534 {"timestamp": 3, "temperature": 3}, 2024-01-05T20:36:53,534 {"timestamp": 4, "temperature": 4}, 2024-01-05T20:36:53,535 {"timestamp": 5, "temperature": 5}, 2024-01-05T20:36:53,535 ] 2024-01-05T20:36:53,536 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-01-05T20:36:53,536 cursor.executemany(sql,seq_of_parameters) 2024-01-05T20:36:53,537 ``` 2024-01-05T20:36:53,538 + close the connection and cursor 2024-01-05T20:36:53,539 ```python 2024-01-05T20:36:53,539 cursor.close() 2024-01-05T20:36:53,540 conn.close() 2024-01-05T20:36:53,540 ``` 2024-01-05T20:36:53,541 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-01-05T20:36:53,541 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-01-05T20:36:53,542 This part is still being improved. 2024-01-05T20:36:53,543 Please do not use it in the production environment! 2024-01-05T20:36:53,543 #### Mapping of the metadata 2024-01-05T20:36:53,544 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-01-05T20:36:53,544 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-01-05T20:36:53,545 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-01-05T20:36:53,545 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-01-05T20:36:53,546 The metadata in the IoTDB are: 2024-01-05T20:36:53,547 1. Database 2024-01-05T20:36:53,547 2. Path 2024-01-05T20:36:53,548 3. Entity 2024-01-05T20:36:53,549 4. Measurement 2024-01-05T20:36:53,550 The metadata in the SQLAlchemy are: 2024-01-05T20:36:53,550 1. Schema 2024-01-05T20:36:53,551 2. Table 2024-01-05T20:36:53,551 3. Column 2024-01-05T20:36:53,552 The mapping relationship between them is: 2024-01-05T20:36:53,554 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-01-05T20:36:53,554 | -------------------- | ---------------------------------------------- | 2024-01-05T20:36:53,555 | Schema | Database | 2024-01-05T20:36:53,556 | Table | Path ( from database to entity ) + Entity | 2024-01-05T20:36:53,556 | Column | Measurement | 2024-01-05T20:36:53,557 The following figure shows the relationship between the two more intuitively: 2024-01-05T20:36:53,558 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-01-05T20:36:53,558 #### Data type mapping 2024-01-05T20:36:53,559 | data type in IoTDB | data type in SQLAlchemy | 2024-01-05T20:36:53,559 |--------------------|-------------------------| 2024-01-05T20:36:53,560 | BOOLEAN | Boolean | 2024-01-05T20:36:53,560 | INT32 | Integer | 2024-01-05T20:36:53,560 | INT64 | BigInteger | 2024-01-05T20:36:53,561 | FLOAT | Float | 2024-01-05T20:36:53,561 | DOUBLE | Float | 2024-01-05T20:36:53,561 | TEXT | Text | 2024-01-05T20:36:53,562 | LONG | BigInteger | 2024-01-05T20:36:53,562 #### Example 2024-01-05T20:36:53,563 + execute statement 2024-01-05T20:36:53,564 ```python 2024-01-05T20:36:53,564 from sqlalchemy import create_engine 2024-01-05T20:36:53,565 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:53,566 connect = engine.connect() 2024-01-05T20:36:53,566 result = connect.execute("SELECT ** FROM root") 2024-01-05T20:36:53,566 for row in result.fetchall(): 2024-01-05T20:36:53,567 print(row) 2024-01-05T20:36:53,567 ``` 2024-01-05T20:36:53,569 + ORM (now only simple queries are supported) 2024-01-05T20:36:53,570 ```python 2024-01-05T20:36:53,570 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-01-05T20:36:53,571 from sqlalchemy.ext.declarative import declarative_base 2024-01-05T20:36:53,571 from sqlalchemy.orm import sessionmaker 2024-01-05T20:36:53,572 metadata = MetaData( 2024-01-05T20:36:53,573 schema='root.factory' 2024-01-05T20:36:53,573 ) 2024-01-05T20:36:53,574 Base = declarative_base(metadata=metadata) 2024-01-05T20:36:53,575 class Device(Base): 2024-01-05T20:36:53,576 __tablename__ = "room2.device1" 2024-01-05T20:36:53,576 Time = Column(BigInteger, primary_key=True) 2024-01-05T20:36:53,577 temperature = Column(Float) 2024-01-05T20:36:53,577 status = Column(Float) 2024-01-05T20:36:53,579 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:53,580 DbSession = sessionmaker(bind=engine) 2024-01-05T20:36:53,580 session = DbSession() 2024-01-05T20:36:53,581 res = session.query(Device.status).filter(Device.temperature > 1) 2024-01-05T20:36:53,582 for row in res: 2024-01-05T20:36:53,583 print(row) 2024-01-05T20:36:53,583 ``` 2024-01-05T20:36:53,585 ## Developers 2024-01-05T20:36:53,586 ### Introduction 2024-01-05T20:36:53,587 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2024-01-05T20:36:53,589 ### Prerequisites 2024-01-05T20:36:53,590 Python3.7 or later is preferred. 2024-01-05T20:36:53,591 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2024-01-05T20:36:53,592 ``` 2024-01-05T20:36:53,592 http://thrift.apache.org/docs/install/ 2024-01-05T20:36:53,593 ``` 2024-01-05T20:36:53,594 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-01-05T20:36:53,594 ```shell 2024-01-05T20:36:53,595 pip install -r requirements_dev.txt 2024-01-05T20:36:53,595 ``` 2024-01-05T20:36:53,597 ### Compile the thrift library and Debug 2024-01-05T20:36:53,597 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-01-05T20:36:53,598 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-01-05T20:36:53,598 This folder is ignored from git and should **never be pushed to git!** 2024-01-05T20:36:53,599 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-01-05T20:36:53,601 ### Session Client & Example 2024-01-05T20:36:53,601 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2024-01-05T20:36:53,602 Or, another simple example: 2024-01-05T20:36:53,603 ```python 2024-01-05T20:36:53,604 from iotdb.Session import Session 2024-01-05T20:36:53,604 ip = "127.0.0.1" 2024-01-05T20:36:53,605 port_ = "6667" 2024-01-05T20:36:53,605 username_ = "root" 2024-01-05T20:36:53,606 password_ = "root" 2024-01-05T20:36:53,606 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:53,606 session.open(False) 2024-01-05T20:36:53,607 zone = session.get_time_zone() 2024-01-05T20:36:53,607 session.close() 2024-01-05T20:36:53,608 ``` 2024-01-05T20:36:53,609 ### Tests 2024-01-05T20:36:53,610 Please add your custom tests in `tests` folder. 2024-01-05T20:36:53,611 To run all defined tests just type `pytest .` in the root folder. 2024-01-05T20:36:53,612 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2024-01-05T20:36:53,614 ### Futher Tools 2024-01-05T20:36:53,615 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-01-05T20:36:53,615 Both can be run by `black .` or `flake8 .` respectively. 2024-01-05T20:36:53,617 ## Releasing 2024-01-05T20:36:53,619 To do a release just ensure that you have the right set of generated thrift files. 2024-01-05T20:36:53,619 Then run linting and auto-formatting. 2024-01-05T20:36:53,619 Then, ensure that all tests work (via `pytest .`). 2024-01-05T20:36:53,620 Then you are good to go to do a release! 2024-01-05T20:36:53,622 ### Preparing your environment 2024-01-05T20:36:53,623 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-01-05T20:36:53,625 ### Doing the Release 2024-01-05T20:36:53,626 There is a convenient script `release.sh` to do all steps for a release. 2024-01-05T20:36:53,626 Namely, these are 2024-01-05T20:36:53,627 * Remove all transient directories from last release (if exists) 2024-01-05T20:36:53,628 * (Re-)generate all generated sources via mvn 2024-01-05T20:36:53,628 * Run Linting (flake8) 2024-01-05T20:36:53,629 * Run Tests via pytest 2024-01-05T20:36:53,629 * Build 2024-01-05T20:36:53,630 * Release to pypi 2024-01-05T20:36:53,631 /tmp/pip-build-env-885lctgg/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2024-01-05T20:36:53,632 warnings.warn(msg) 2024-01-05T20:36:53,633 running egg_info 2024-01-05T20:36:53,633 writing apache_iotdb.egg-info/PKG-INFO 2024-01-05T20:36:53,634 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-01-05T20:36:53,634 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-01-05T20:36:53,635 writing requirements to apache_iotdb.egg-info/requires.txt 2024-01-05T20:36:53,635 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-01-05T20:36:53,636 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:53,637 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:53,638 Getting requirements to build wheel: finished with status 'done' 2024-01-05T20:36:53,648 Created temporary directory: /tmp/pip-modern-metadata-u8cj5tpn 2024-01-05T20:36:53,650 Preparing metadata (pyproject.toml): started 2024-01-05T20:36:53,652 Running command Preparing metadata (pyproject.toml) 2024-01-05T20:36:54,107 2024-01-05T20:36:54,117 # Apache IoTDB 2024-01-05T20:36:54,118 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2024-01-05T20:36:54,119 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-01-05T20:36:54,119 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-01-05T20:36:54,120 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-01-05T20:36:54,121 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-01-05T20:36:54,121 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-01-05T20:36:54,122 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-01-05T20:36:54,124 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-01-05T20:36:54,124 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-01-05T20:36:54,125 architecture, high performance and rich feature set together with its deep integration with 2024-01-05T20:36:54,125 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-01-05T20:36:54,126 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-01-05T20:36:54,127 ## Python Native API 2024-01-05T20:36:54,128 ### Requirements 2024-01-05T20:36:54,130 You have to install thrift (>=0.13) before using the package. 2024-01-05T20:36:54,132 ### How to use (Example) 2024-01-05T20:36:54,133 First, download the latest package: `pip3 install apache-iotdb` 2024-01-05T20:36:54,134 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2024-01-05T20:36:54,135 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2024-01-05T20:36:54,137 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-01-05T20:36:54,138 (you need to add `import iotdb` in the head of the file) 2024-01-05T20:36:54,139 Or: 2024-01-05T20:36:54,140 ```python 2024-01-05T20:36:54,140 from iotdb.Session import Session 2024-01-05T20:36:54,141 ip = "127.0.0.1" 2024-01-05T20:36:54,142 port_ = "6667" 2024-01-05T20:36:54,142 username_ = "root" 2024-01-05T20:36:54,143 password_ = "root" 2024-01-05T20:36:54,143 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:54,144 session.open(False) 2024-01-05T20:36:54,144 zone = session.get_time_zone() 2024-01-05T20:36:54,144 session.close() 2024-01-05T20:36:54,145 ``` 2024-01-05T20:36:54,146 ### Initialization 2024-01-05T20:36:54,147 * Initialize a Session 2024-01-05T20:36:54,147 ```python 2024-01-05T20:36:54,148 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-01-05T20:36:54,148 ``` 2024-01-05T20:36:54,149 * Open a session, with a parameter to specify whether to enable RPC compression 2024-01-05T20:36:54,150 ```python 2024-01-05T20:36:54,151 session.open(enable_rpc_compression=False) 2024-01-05T20:36:54,151 ``` 2024-01-05T20:36:54,152 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-01-05T20:36:54,153 * Close a Session 2024-01-05T20:36:54,154 ```python 2024-01-05T20:36:54,154 session.close() 2024-01-05T20:36:54,155 ``` 2024-01-05T20:36:54,155 ### Data Definition Interface (DDL Interface) 2024-01-05T20:36:54,156 #### DATABASE Management 2024-01-05T20:36:54,157 * CREATE DATABASE 2024-01-05T20:36:54,158 ```python 2024-01-05T20:36:54,158 session.set_storage_group(group_name) 2024-01-05T20:36:54,159 ``` 2024-01-05T20:36:54,160 * Delete one or several databases 2024-01-05T20:36:54,161 ```python 2024-01-05T20:36:54,161 session.delete_storage_group(group_name) 2024-01-05T20:36:54,162 session.delete_storage_groups(group_name_lst) 2024-01-05T20:36:54,162 ``` 2024-01-05T20:36:54,163 #### Timeseries Management 2024-01-05T20:36:54,164 * Create one or multiple timeseries 2024-01-05T20:36:54,165 ```python 2024-01-05T20:36:54,166 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-01-05T20:36:54,166 props=None, tags=None, attributes=None, alias=None) 2024-01-05T20:36:54,167 session.create_multi_time_series( 2024-01-05T20:36:54,168 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-01-05T20:36:54,168 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-01-05T20:36:54,169 ) 2024-01-05T20:36:54,169 ``` 2024-01-05T20:36:54,171 * Create aligned timeseries 2024-01-05T20:36:54,172 ```python 2024-01-05T20:36:54,172 session.create_aligned_time_series( 2024-01-05T20:36:54,173 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-01-05T20:36:54,173 ) 2024-01-05T20:36:54,174 ``` 2024-01-05T20:36:54,175 Attention: Alias of measurements are **not supported** currently. 2024-01-05T20:36:54,176 * Delete one or several timeseries 2024-01-05T20:36:54,177 ```python 2024-01-05T20:36:54,178 session.delete_time_series(paths_list) 2024-01-05T20:36:54,178 ``` 2024-01-05T20:36:54,179 * Check whether the specific timeseries exists 2024-01-05T20:36:54,181 ```python 2024-01-05T20:36:54,181 session.check_time_series_exists(path) 2024-01-05T20:36:54,182 ``` 2024-01-05T20:36:54,183 ### Data Manipulation Interface (DML Interface) 2024-01-05T20:36:54,184 #### Insert 2024-01-05T20:36:54,185 It is recommended to use insertTablet to help improve write efficiency. 2024-01-05T20:36:54,186 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-01-05T20:36:54,187 * **Better Write Performance** 2024-01-05T20:36:54,188 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-01-05T20:36:54,189 We have two implementations of Tablet in Python API. 2024-01-05T20:36:54,190 * Normal Tablet 2024-01-05T20:36:54,191 ```python 2024-01-05T20:36:54,192 values_ = [ 2024-01-05T20:36:54,192 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:54,192 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:54,193 [False, 100, 1, 188.1, 688.25, "test03"], 2024-01-05T20:36:54,193 [True, 0, 0, 0, 6.25, "test04"], 2024-01-05T20:36:54,194 ] 2024-01-05T20:36:54,194 timestamps_ = [1, 2, 3, 4] 2024-01-05T20:36:54,195 tablet_ = Tablet( 2024-01-05T20:36:54,195 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:54,196 ) 2024-01-05T20:36:54,196 session.insert_tablet(tablet_) 2024-01-05T20:36:54,197 values_ = [ 2024-01-05T20:36:54,197 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:54,198 [True, None, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:54,198 [False, 100, None, 188.1, 688.25, "test03"], 2024-01-05T20:36:54,199 [True, 0, 0, 0, None, None], 2024-01-05T20:36:54,199 ] 2024-01-05T20:36:54,200 timestamps_ = [16, 17, 18, 19] 2024-01-05T20:36:54,200 tablet_ = Tablet( 2024-01-05T20:36:54,201 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:54,201 ) 2024-01-05T20:36:54,202 session.insert_tablet(tablet_) 2024-01-05T20:36:54,202 ``` 2024-01-05T20:36:54,203 * Numpy Tablet 2024-01-05T20:36:54,204 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-01-05T20:36:54,204 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-01-05T20:36:54,205 **Notice** 2024-01-05T20:36:54,206 1. time and value columns in Tablet are ndarray. 2024-01-05T20:36:54,206 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-01-05T20:36:54,207 (if not, the default dtypes are also ok). 2024-01-05T20:36:54,208 ```python 2024-01-05T20:36:54,208 import numpy as np 2024-01-05T20:36:54,209 data_types_ = [ 2024-01-05T20:36:54,210 TSDataType.BOOLEAN, 2024-01-05T20:36:54,210 TSDataType.INT32, 2024-01-05T20:36:54,211 TSDataType.INT64, 2024-01-05T20:36:54,211 TSDataType.FLOAT, 2024-01-05T20:36:54,212 TSDataType.DOUBLE, 2024-01-05T20:36:54,212 TSDataType.TEXT, 2024-01-05T20:36:54,213 ] 2024-01-05T20:36:54,213 np_values_ = [ 2024-01-05T20:36:54,214 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:54,214 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:54,215 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:54,215 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:54,216 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:54,216 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:54,217 ] 2024-01-05T20:36:54,218 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:54,218 np_tablet_ = NumpyTablet( 2024-01-05T20:36:54,219 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-01-05T20:36:54,219 ) 2024-01-05T20:36:54,220 session.insert_tablet(np_tablet_) 2024-01-05T20:36:54,221 # insert one numpy tablet with none into the database. 2024-01-05T20:36:54,222 np_values_ = [ 2024-01-05T20:36:54,222 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:54,223 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:54,224 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:54,224 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:54,225 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:54,226 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:54,226 ] 2024-01-05T20:36:54,227 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:54,227 np_bitmaps_ = [] 2024-01-05T20:36:54,228 for i in range(len(measurements_)): 2024-01-05T20:36:54,228 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-01-05T20:36:54,229 np_bitmaps_[0].mark(0) 2024-01-05T20:36:54,229 np_bitmaps_[1].mark(1) 2024-01-05T20:36:54,230 np_bitmaps_[2].mark(2) 2024-01-05T20:36:54,230 np_bitmaps_[4].mark(3) 2024-01-05T20:36:54,230 np_bitmaps_[5].mark(3) 2024-01-05T20:36:54,231 np_tablet_with_none = NumpyTablet( 2024-01-05T20:36:54,231 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-01-05T20:36:54,232 ) 2024-01-05T20:36:54,232 session.insert_tablet(np_tablet_with_none) 2024-01-05T20:36:54,233 ``` 2024-01-05T20:36:54,233 * Insert multiple Tablets 2024-01-05T20:36:54,234 ```python 2024-01-05T20:36:54,235 session.insert_tablets(tablet_lst) 2024-01-05T20:36:54,235 ``` 2024-01-05T20:36:54,236 * Insert a Record 2024-01-05T20:36:54,237 ```python 2024-01-05T20:36:54,237 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-01-05T20:36:54,238 ``` 2024-01-05T20:36:54,239 * Insert multiple Records 2024-01-05T20:36:54,239 ```python 2024-01-05T20:36:54,240 session.insert_records( 2024-01-05T20:36:54,240 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-01-05T20:36:54,241 ) 2024-01-05T20:36:54,242 ``` 2024-01-05T20:36:54,243 * Insert multiple Records that belong to the same device. 2024-01-05T20:36:54,243 With type info the server has no need to do type inference, which leads a better performance 2024-01-05T20:36:54,245 ```python 2024-01-05T20:36:54,245 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-01-05T20:36:54,246 ``` 2024-01-05T20:36:54,247 #### Insert with type inference 2024-01-05T20:36:54,248 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2024-01-05T20:36:54,249 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-01-05T20:36:54,250 ```python 2024-01-05T20:36:54,251 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-01-05T20:36:54,251 ``` 2024-01-05T20:36:54,252 #### Insert of Aligned Timeseries 2024-01-05T20:36:54,253 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-01-05T20:36:54,255 * insert_aligned_record 2024-01-05T20:36:54,255 * insert_aligned_records 2024-01-05T20:36:54,256 * insert_aligned_records_of_one_device 2024-01-05T20:36:54,256 * insert_aligned_tablet 2024-01-05T20:36:54,257 * insert_aligned_tablets 2024-01-05T20:36:54,259 ### IoTDB-SQL Interface 2024-01-05T20:36:54,260 * Execute query statement 2024-01-05T20:36:54,261 ```python 2024-01-05T20:36:54,261 session.execute_query_statement(sql) 2024-01-05T20:36:54,262 ``` 2024-01-05T20:36:54,263 * Execute non query statement 2024-01-05T20:36:54,264 ```python 2024-01-05T20:36:54,265 session.execute_non_query_statement(sql) 2024-01-05T20:36:54,265 ``` 2024-01-05T20:36:54,267 * Execute statement 2024-01-05T20:36:54,268 ```python 2024-01-05T20:36:54,268 session.execute_statement(sql) 2024-01-05T20:36:54,269 ``` 2024-01-05T20:36:54,270 ### Device Template 2024-01-05T20:36:54,270 #### Create Device Template 2024-01-05T20:36:54,271 The step for creating a metadata template is as follows 2024-01-05T20:36:54,272 1. Create the template class 2024-01-05T20:36:54,272 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-01-05T20:36:54,273 3. Execute create device template function 2024-01-05T20:36:54,274 ```python 2024-01-05T20:36:54,275 template = Template(name=template_name, share_time=True) 2024-01-05T20:36:54,276 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-01-05T20:36:54,276 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-01-05T20:36:54,276 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-01-05T20:36:54,277 i_node_gps.add_child(m_node_x) 2024-01-05T20:36:54,278 i_node_v.add_child(m_node_x) 2024-01-05T20:36:54,279 template.add_template(i_node_gps) 2024-01-05T20:36:54,279 template.add_template(i_node_v) 2024-01-05T20:36:54,280 template.add_template(m_node_x) 2024-01-05T20:36:54,280 session.create_schema_template(template) 2024-01-05T20:36:54,281 ``` 2024-01-05T20:36:54,281 #### Modify Device Template nodes 2024-01-05T20:36:54,282 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-01-05T20:36:54,282 * add node in template 2024-01-05T20:36:54,283 ```python 2024-01-05T20:36:54,283 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-01-05T20:36:54,284 ``` 2024-01-05T20:36:54,285 * delete node in template 2024-01-05T20:36:54,285 ```python 2024-01-05T20:36:54,286 session.delete_node_in_template(template_name, path) 2024-01-05T20:36:54,286 ``` 2024-01-05T20:36:54,287 #### Set Device Template 2024-01-05T20:36:54,287 ```python 2024-01-05T20:36:54,288 session.set_schema_template(template_name, prefix_path) 2024-01-05T20:36:54,288 ``` 2024-01-05T20:36:54,289 #### Uset Device Template 2024-01-05T20:36:54,290 ```python 2024-01-05T20:36:54,290 session.unset_schema_template(template_name, prefix_path) 2024-01-05T20:36:54,291 ``` 2024-01-05T20:36:54,292 #### Show Device Template 2024-01-05T20:36:54,292 * Show all device templates 2024-01-05T20:36:54,293 ```python 2024-01-05T20:36:54,293 session.show_all_templates() 2024-01-05T20:36:54,294 ``` 2024-01-05T20:36:54,295 * Count all nodes in templates 2024-01-05T20:36:54,295 ```python 2024-01-05T20:36:54,296 session.count_measurements_in_template(template_name) 2024-01-05T20:36:54,296 ``` 2024-01-05T20:36:54,298 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-01-05T20:36:54,299 ```python 2024-01-05T20:36:54,299 session.count_measurements_in_template(template_name, path) 2024-01-05T20:36:54,300 ``` 2024-01-05T20:36:54,301 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-01-05T20:36:54,302 ```python 2024-01-05T20:36:54,303 session.is_path_exist_in_template(template_name, path) 2024-01-05T20:36:54,303 ``` 2024-01-05T20:36:54,304 * Show nodes under in device template 2024-01-05T20:36:54,305 ```python 2024-01-05T20:36:54,305 session.show_measurements_in_template(template_name) 2024-01-05T20:36:54,306 ``` 2024-01-05T20:36:54,307 * Show the path prefix where a device template is set 2024-01-05T20:36:54,307 ```python 2024-01-05T20:36:54,308 session.show_paths_template_set_on(template_name) 2024-01-05T20:36:54,309 ``` 2024-01-05T20:36:54,310 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-01-05T20:36:54,310 ```python 2024-01-05T20:36:54,311 session.show_paths_template_using_on(template_name) 2024-01-05T20:36:54,312 ``` 2024-01-05T20:36:54,313 #### Drop Device Template 2024-01-05T20:36:54,313 Delete an existing metadata template,dropping an already set template is not supported 2024-01-05T20:36:54,314 ```python 2024-01-05T20:36:54,314 session.drop_schema_template("template_python") 2024-01-05T20:36:54,315 ``` 2024-01-05T20:36:54,317 ### Pandas Support 2024-01-05T20:36:54,318 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-01-05T20:36:54,319 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-01-05T20:36:54,320 Example: 2024-01-05T20:36:54,321 ```python 2024-01-05T20:36:54,322 from iotdb.Session import Session 2024-01-05T20:36:54,323 ip = "127.0.0.1" 2024-01-05T20:36:54,323 port_ = "6667" 2024-01-05T20:36:54,324 username_ = "root" 2024-01-05T20:36:54,324 password_ = "root" 2024-01-05T20:36:54,324 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:54,325 session.open(False) 2024-01-05T20:36:54,325 result = session.execute_query_statement("SELECT * FROM root.*") 2024-01-05T20:36:54,326 # Transform to Pandas Dataset 2024-01-05T20:36:54,327 df = result.todf() 2024-01-05T20:36:54,328 session.close() 2024-01-05T20:36:54,329 # Now you can work with the dataframe 2024-01-05T20:36:54,329 df = ... 2024-01-05T20:36:54,330 ``` 2024-01-05T20:36:54,331 ### IoTDB Testcontainer 2024-01-05T20:36:54,332 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2024-01-05T20:36:54,333 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-01-05T20:36:54,333 ```python 2024-01-05T20:36:54,334 class MyTestCase(unittest.TestCase): 2024-01-05T20:36:54,335 def test_something(self): 2024-01-05T20:36:54,336 with IoTDBContainer() as c: 2024-01-05T20:36:54,336 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-01-05T20:36:54,337 session.open(False) 2024-01-05T20:36:54,337 result = session.execute_query_statement("SHOW TIMESERIES") 2024-01-05T20:36:54,337 print(result) 2024-01-05T20:36:54,338 session.close() 2024-01-05T20:36:54,339 ``` 2024-01-05T20:36:54,340 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2024-01-05T20:36:54,341 ### IoTDB DBAPI 2024-01-05T20:36:54,343 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-01-05T20:36:54,343 interface for accessing databases in Python. 2024-01-05T20:36:54,344 #### Examples 2024-01-05T20:36:54,345 + Initialization 2024-01-05T20:36:54,346 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-01-05T20:36:54,346 ```python 2024-01-05T20:36:54,347 from iotdb.dbapi import connect 2024-01-05T20:36:54,348 ip = "127.0.0.1" 2024-01-05T20:36:54,348 port_ = "6667" 2024-01-05T20:36:54,349 username_ = "root" 2024-01-05T20:36:54,350 password_ = "root" 2024-01-05T20:36:54,350 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-01-05T20:36:54,351 cursor = conn.cursor() 2024-01-05T20:36:54,352 ``` 2024-01-05T20:36:54,352 + simple SQL statement execution 2024-01-05T20:36:54,353 ```python 2024-01-05T20:36:54,354 cursor.execute("SELECT * FROM root.*") 2024-01-05T20:36:54,354 for row in cursor.fetchall(): 2024-01-05T20:36:54,355 print(row) 2024-01-05T20:36:54,355 ``` 2024-01-05T20:36:54,356 + execute SQL with parameter 2024-01-05T20:36:54,357 IoTDB DBAPI supports pyformat style parameters 2024-01-05T20:36:54,358 ```python 2024-01-05T20:36:54,359 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-01-05T20:36:54,359 for row in cursor.fetchall(): 2024-01-05T20:36:54,360 print(row) 2024-01-05T20:36:54,360 ``` 2024-01-05T20:36:54,362 + execute SQL with parameter sequences 2024-01-05T20:36:54,362 ```python 2024-01-05T20:36:54,363 seq_of_parameters = [ 2024-01-05T20:36:54,363 {"timestamp": 1, "temperature": 1}, 2024-01-05T20:36:54,364 {"timestamp": 2, "temperature": 2}, 2024-01-05T20:36:54,365 {"timestamp": 3, "temperature": 3}, 2024-01-05T20:36:54,365 {"timestamp": 4, "temperature": 4}, 2024-01-05T20:36:54,365 {"timestamp": 5, "temperature": 5}, 2024-01-05T20:36:54,366 ] 2024-01-05T20:36:54,366 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-01-05T20:36:54,367 cursor.executemany(sql,seq_of_parameters) 2024-01-05T20:36:54,367 ``` 2024-01-05T20:36:54,368 + close the connection and cursor 2024-01-05T20:36:54,368 ```python 2024-01-05T20:36:54,369 cursor.close() 2024-01-05T20:36:54,369 conn.close() 2024-01-05T20:36:54,370 ``` 2024-01-05T20:36:54,370 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-01-05T20:36:54,371 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-01-05T20:36:54,371 This part is still being improved. 2024-01-05T20:36:54,372 Please do not use it in the production environment! 2024-01-05T20:36:54,372 #### Mapping of the metadata 2024-01-05T20:36:54,373 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-01-05T20:36:54,373 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-01-05T20:36:54,374 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-01-05T20:36:54,374 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-01-05T20:36:54,375 The metadata in the IoTDB are: 2024-01-05T20:36:54,376 1. Database 2024-01-05T20:36:54,377 2. Path 2024-01-05T20:36:54,378 3. Entity 2024-01-05T20:36:54,378 4. Measurement 2024-01-05T20:36:54,379 The metadata in the SQLAlchemy are: 2024-01-05T20:36:54,380 1. Schema 2024-01-05T20:36:54,381 2. Table 2024-01-05T20:36:54,382 3. Column 2024-01-05T20:36:54,383 The mapping relationship between them is: 2024-01-05T20:36:54,384 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-01-05T20:36:54,384 | -------------------- | ---------------------------------------------- | 2024-01-05T20:36:54,385 | Schema | Database | 2024-01-05T20:36:54,385 | Table | Path ( from database to entity ) + Entity | 2024-01-05T20:36:54,386 | Column | Measurement | 2024-01-05T20:36:54,387 The following figure shows the relationship between the two more intuitively: 2024-01-05T20:36:54,388 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-01-05T20:36:54,389 #### Data type mapping 2024-01-05T20:36:54,390 | data type in IoTDB | data type in SQLAlchemy | 2024-01-05T20:36:54,390 |--------------------|-------------------------| 2024-01-05T20:36:54,391 | BOOLEAN | Boolean | 2024-01-05T20:36:54,391 | INT32 | Integer | 2024-01-05T20:36:54,392 | INT64 | BigInteger | 2024-01-05T20:36:54,392 | FLOAT | Float | 2024-01-05T20:36:54,393 | DOUBLE | Float | 2024-01-05T20:36:54,393 | TEXT | Text | 2024-01-05T20:36:54,394 | LONG | BigInteger | 2024-01-05T20:36:54,395 #### Example 2024-01-05T20:36:54,396 + execute statement 2024-01-05T20:36:54,397 ```python 2024-01-05T20:36:54,397 from sqlalchemy import create_engine 2024-01-05T20:36:54,398 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:54,399 connect = engine.connect() 2024-01-05T20:36:54,400 result = connect.execute("SELECT ** FROM root") 2024-01-05T20:36:54,401 for row in result.fetchall(): 2024-01-05T20:36:54,401 print(row) 2024-01-05T20:36:54,402 ``` 2024-01-05T20:36:54,404 + ORM (now only simple queries are supported) 2024-01-05T20:36:54,405 ```python 2024-01-05T20:36:54,406 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-01-05T20:36:54,406 from sqlalchemy.ext.declarative import declarative_base 2024-01-05T20:36:54,407 from sqlalchemy.orm import sessionmaker 2024-01-05T20:36:54,408 metadata = MetaData( 2024-01-05T20:36:54,409 schema='root.factory' 2024-01-05T20:36:54,410 ) 2024-01-05T20:36:54,410 Base = declarative_base(metadata=metadata) 2024-01-05T20:36:54,413 class Device(Base): 2024-01-05T20:36:54,413 __tablename__ = "room2.device1" 2024-01-05T20:36:54,414 Time = Column(BigInteger, primary_key=True) 2024-01-05T20:36:54,414 temperature = Column(Float) 2024-01-05T20:36:54,415 status = Column(Float) 2024-01-05T20:36:54,417 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:54,419 DbSession = sessionmaker(bind=engine) 2024-01-05T20:36:54,419 session = DbSession() 2024-01-05T20:36:54,420 res = session.query(Device.status).filter(Device.temperature > 1) 2024-01-05T20:36:54,422 for row in res: 2024-01-05T20:36:54,423 print(row) 2024-01-05T20:36:54,424 ``` 2024-01-05T20:36:54,426 ## Developers 2024-01-05T20:36:54,427 ### Introduction 2024-01-05T20:36:54,429 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2024-01-05T20:36:54,431 ### Prerequisites 2024-01-05T20:36:54,433 Python3.7 or later is preferred. 2024-01-05T20:36:54,434 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2024-01-05T20:36:54,436 ``` 2024-01-05T20:36:54,437 http://thrift.apache.org/docs/install/ 2024-01-05T20:36:54,438 ``` 2024-01-05T20:36:54,439 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-01-05T20:36:54,440 ```shell 2024-01-05T20:36:54,441 pip install -r requirements_dev.txt 2024-01-05T20:36:54,441 ``` 2024-01-05T20:36:54,444 ### Compile the thrift library and Debug 2024-01-05T20:36:54,445 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-01-05T20:36:54,446 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-01-05T20:36:54,447 This folder is ignored from git and should **never be pushed to git!** 2024-01-05T20:36:54,448 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-01-05T20:36:54,451 ### Session Client & Example 2024-01-05T20:36:54,453 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2024-01-05T20:36:54,455 Or, another simple example: 2024-01-05T20:36:54,456 ```python 2024-01-05T20:36:54,457 from iotdb.Session import Session 2024-01-05T20:36:54,459 ip = "127.0.0.1" 2024-01-05T20:36:54,460 port_ = "6667" 2024-01-05T20:36:54,460 username_ = "root" 2024-01-05T20:36:54,461 password_ = "root" 2024-01-05T20:36:54,462 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:54,462 session.open(False) 2024-01-05T20:36:54,463 zone = session.get_time_zone() 2024-01-05T20:36:54,464 session.close() 2024-01-05T20:36:54,465 ``` 2024-01-05T20:36:54,468 ### Tests 2024-01-05T20:36:54,470 Please add your custom tests in `tests` folder. 2024-01-05T20:36:54,472 To run all defined tests just type `pytest .` in the root folder. 2024-01-05T20:36:54,474 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2024-01-05T20:36:54,477 ### Futher Tools 2024-01-05T20:36:54,478 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-01-05T20:36:54,479 Both can be run by `black .` or `flake8 .` respectively. 2024-01-05T20:36:54,481 ## Releasing 2024-01-05T20:36:54,483 To do a release just ensure that you have the right set of generated thrift files. 2024-01-05T20:36:54,483 Then run linting and auto-formatting. 2024-01-05T20:36:54,484 Then, ensure that all tests work (via `pytest .`). 2024-01-05T20:36:54,484 Then you are good to go to do a release! 2024-01-05T20:36:54,486 ### Preparing your environment 2024-01-05T20:36:54,488 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-01-05T20:36:54,490 ### Doing the Release 2024-01-05T20:36:54,491 There is a convenient script `release.sh` to do all steps for a release. 2024-01-05T20:36:54,492 Namely, these are 2024-01-05T20:36:54,493 * Remove all transient directories from last release (if exists) 2024-01-05T20:36:54,493 * (Re-)generate all generated sources via mvn 2024-01-05T20:36:54,494 * Run Linting (flake8) 2024-01-05T20:36:54,494 * Run Tests via pytest 2024-01-05T20:36:54,495 * Build 2024-01-05T20:36:54,496 * Release to pypi 2024-01-05T20:36:54,498 /tmp/pip-build-env-885lctgg/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2024-01-05T20:36:54,498 warnings.warn(msg) 2024-01-05T20:36:54,500 running dist_info 2024-01-05T20:36:54,500 creating /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info 2024-01-05T20:36:54,501 writing /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/PKG-INFO 2024-01-05T20:36:54,502 writing dependency_links to /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/dependency_links.txt 2024-01-05T20:36:54,502 writing entry points to /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/entry_points.txt 2024-01-05T20:36:54,503 writing requirements to /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/requires.txt 2024-01-05T20:36:54,503 writing top-level names to /tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/top_level.txt 2024-01-05T20:36:54,504 writing manifest file '/tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:54,505 reading manifest file '/tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:54,505 writing manifest file '/tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:54,506 creating '/tmp/pip-modern-metadata-u8cj5tpn/apache_iotdb-1.3.0.dist-info' 2024-01-05T20:36:54,508 Preparing metadata (pyproject.toml): finished with status 'done' 2024-01-05T20:36:54,514 Source in /tmp/pip-wheel-i05oyk3r/apache-iotdb_ae94affb8dcb477f8ce10c8d846a316e has version 1.3.0, which satisfies requirement apache-iotdb==1.3.0 from https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz 2024-01-05T20:36:54,515 Removed apache-iotdb==1.3.0 from https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz from build tracker '/tmp/pip-build-tracker-gzzhb4wu' 2024-01-05T20:36:54,524 Created temporary directory: /tmp/pip-unpack-jlfq3j3a 2024-01-05T20:36:54,525 Created temporary directory: /tmp/pip-unpack-rfdgaupr 2024-01-05T20:36:54,537 Building wheels for collected packages: apache-iotdb 2024-01-05T20:36:54,542 Created temporary directory: /tmp/pip-wheel-x_sfta62 2024-01-05T20:36:54,542 Destination directory: /tmp/pip-wheel-x_sfta62 2024-01-05T20:36:54,544 Building wheel for apache-iotdb (pyproject.toml): started 2024-01-05T20:36:54,546 Running command Building wheel for apache-iotdb (pyproject.toml) 2024-01-05T20:36:54,970 2024-01-05T20:36:54,980 # Apache IoTDB 2024-01-05T20:36:54,981 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2024-01-05T20:36:54,981 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-01-05T20:36:54,982 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-01-05T20:36:54,982 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-01-05T20:36:54,983 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-01-05T20:36:54,983 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-01-05T20:36:54,984 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-01-05T20:36:54,985 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-01-05T20:36:54,986 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-01-05T20:36:54,986 architecture, high performance and rich feature set together with its deep integration with 2024-01-05T20:36:54,987 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-01-05T20:36:54,987 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-01-05T20:36:54,988 ## Python Native API 2024-01-05T20:36:54,989 ### Requirements 2024-01-05T20:36:54,990 You have to install thrift (>=0.13) before using the package. 2024-01-05T20:36:54,992 ### How to use (Example) 2024-01-05T20:36:54,993 First, download the latest package: `pip3 install apache-iotdb` 2024-01-05T20:36:54,994 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2024-01-05T20:36:54,995 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2024-01-05T20:36:54,996 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-01-05T20:36:54,997 (you need to add `import iotdb` in the head of the file) 2024-01-05T20:36:54,998 Or: 2024-01-05T20:36:54,999 ```python 2024-01-05T20:36:55,000 from iotdb.Session import Session 2024-01-05T20:36:55,001 ip = "127.0.0.1" 2024-01-05T20:36:55,001 port_ = "6667" 2024-01-05T20:36:55,002 username_ = "root" 2024-01-05T20:36:55,002 password_ = "root" 2024-01-05T20:36:55,003 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:55,004 session.open(False) 2024-01-05T20:36:55,004 zone = session.get_time_zone() 2024-01-05T20:36:55,005 session.close() 2024-01-05T20:36:55,005 ``` 2024-01-05T20:36:55,006 ### Initialization 2024-01-05T20:36:55,007 * Initialize a Session 2024-01-05T20:36:55,008 ```python 2024-01-05T20:36:55,008 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-01-05T20:36:55,009 ``` 2024-01-05T20:36:55,010 * Open a session, with a parameter to specify whether to enable RPC compression 2024-01-05T20:36:55,011 ```python 2024-01-05T20:36:55,011 session.open(enable_rpc_compression=False) 2024-01-05T20:36:55,012 ``` 2024-01-05T20:36:55,012 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-01-05T20:36:55,013 * Close a Session 2024-01-05T20:36:55,014 ```python 2024-01-05T20:36:55,015 session.close() 2024-01-05T20:36:55,016 ``` 2024-01-05T20:36:55,017 ### Data Definition Interface (DDL Interface) 2024-01-05T20:36:55,018 #### DATABASE Management 2024-01-05T20:36:55,019 * CREATE DATABASE 2024-01-05T20:36:55,020 ```python 2024-01-05T20:36:55,020 session.set_storage_group(group_name) 2024-01-05T20:36:55,021 ``` 2024-01-05T20:36:55,022 * Delete one or several databases 2024-01-05T20:36:55,022 ```python 2024-01-05T20:36:55,023 session.delete_storage_group(group_name) 2024-01-05T20:36:55,024 session.delete_storage_groups(group_name_lst) 2024-01-05T20:36:55,024 ``` 2024-01-05T20:36:55,025 #### Timeseries Management 2024-01-05T20:36:55,026 * Create one or multiple timeseries 2024-01-05T20:36:55,027 ```python 2024-01-05T20:36:55,027 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-01-05T20:36:55,028 props=None, tags=None, attributes=None, alias=None) 2024-01-05T20:36:55,029 session.create_multi_time_series( 2024-01-05T20:36:55,029 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-01-05T20:36:55,030 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-01-05T20:36:55,030 ) 2024-01-05T20:36:55,031 ``` 2024-01-05T20:36:55,032 * Create aligned timeseries 2024-01-05T20:36:55,033 ```python 2024-01-05T20:36:55,034 session.create_aligned_time_series( 2024-01-05T20:36:55,034 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-01-05T20:36:55,035 ) 2024-01-05T20:36:55,036 ``` 2024-01-05T20:36:55,038 Attention: Alias of measurements are **not supported** currently. 2024-01-05T20:36:55,040 * Delete one or several timeseries 2024-01-05T20:36:55,041 ```python 2024-01-05T20:36:55,041 session.delete_time_series(paths_list) 2024-01-05T20:36:55,042 ``` 2024-01-05T20:36:55,043 * Check whether the specific timeseries exists 2024-01-05T20:36:55,044 ```python 2024-01-05T20:36:55,044 session.check_time_series_exists(path) 2024-01-05T20:36:55,045 ``` 2024-01-05T20:36:55,046 ### Data Manipulation Interface (DML Interface) 2024-01-05T20:36:55,047 #### Insert 2024-01-05T20:36:55,048 It is recommended to use insertTablet to help improve write efficiency. 2024-01-05T20:36:55,049 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-01-05T20:36:55,050 * **Better Write Performance** 2024-01-05T20:36:55,050 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-01-05T20:36:55,052 We have two implementations of Tablet in Python API. 2024-01-05T20:36:55,053 * Normal Tablet 2024-01-05T20:36:55,054 ```python 2024-01-05T20:36:55,055 values_ = [ 2024-01-05T20:36:55,055 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:55,056 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:55,056 [False, 100, 1, 188.1, 688.25, "test03"], 2024-01-05T20:36:55,057 [True, 0, 0, 0, 6.25, "test04"], 2024-01-05T20:36:55,057 ] 2024-01-05T20:36:55,058 timestamps_ = [1, 2, 3, 4] 2024-01-05T20:36:55,058 tablet_ = Tablet( 2024-01-05T20:36:55,059 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:55,060 ) 2024-01-05T20:36:55,060 session.insert_tablet(tablet_) 2024-01-05T20:36:55,061 values_ = [ 2024-01-05T20:36:55,061 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-01-05T20:36:55,062 [True, None, 11111, 1.25, 101.0, "test02"], 2024-01-05T20:36:55,062 [False, 100, None, 188.1, 688.25, "test03"], 2024-01-05T20:36:55,063 [True, 0, 0, 0, None, None], 2024-01-05T20:36:55,064 ] 2024-01-05T20:36:55,064 timestamps_ = [16, 17, 18, 19] 2024-01-05T20:36:55,065 tablet_ = Tablet( 2024-01-05T20:36:55,065 device_id, measurements_, data_types_, values_, timestamps_ 2024-01-05T20:36:55,066 ) 2024-01-05T20:36:55,066 session.insert_tablet(tablet_) 2024-01-05T20:36:55,067 ``` 2024-01-05T20:36:55,068 * Numpy Tablet 2024-01-05T20:36:55,069 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-01-05T20:36:55,069 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-01-05T20:36:55,070 **Notice** 2024-01-05T20:36:55,071 1. time and value columns in Tablet are ndarray. 2024-01-05T20:36:55,071 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-01-05T20:36:55,072 (if not, the default dtypes are also ok). 2024-01-05T20:36:55,073 ```python 2024-01-05T20:36:55,073 import numpy as np 2024-01-05T20:36:55,074 data_types_ = [ 2024-01-05T20:36:55,074 TSDataType.BOOLEAN, 2024-01-05T20:36:55,075 TSDataType.INT32, 2024-01-05T20:36:55,075 TSDataType.INT64, 2024-01-05T20:36:55,076 TSDataType.FLOAT, 2024-01-05T20:36:55,076 TSDataType.DOUBLE, 2024-01-05T20:36:55,077 TSDataType.TEXT, 2024-01-05T20:36:55,078 ] 2024-01-05T20:36:55,078 np_values_ = [ 2024-01-05T20:36:55,079 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:55,079 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:55,080 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:55,081 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:55,081 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:55,082 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:55,083 ] 2024-01-05T20:36:55,083 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:55,084 np_tablet_ = NumpyTablet( 2024-01-05T20:36:55,084 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-01-05T20:36:55,085 ) 2024-01-05T20:36:55,085 session.insert_tablet(np_tablet_) 2024-01-05T20:36:55,086 # insert one numpy tablet with none into the database. 2024-01-05T20:36:55,087 np_values_ = [ 2024-01-05T20:36:55,087 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-01-05T20:36:55,088 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-01-05T20:36:55,088 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-01-05T20:36:55,089 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-01-05T20:36:55,089 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-01-05T20:36:55,090 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-01-05T20:36:55,090 ] 2024-01-05T20:36:55,091 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-01-05T20:36:55,092 np_bitmaps_ = [] 2024-01-05T20:36:55,092 for i in range(len(measurements_)): 2024-01-05T20:36:55,093 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-01-05T20:36:55,093 np_bitmaps_[0].mark(0) 2024-01-05T20:36:55,094 np_bitmaps_[1].mark(1) 2024-01-05T20:36:55,094 np_bitmaps_[2].mark(2) 2024-01-05T20:36:55,095 np_bitmaps_[4].mark(3) 2024-01-05T20:36:55,096 np_bitmaps_[5].mark(3) 2024-01-05T20:36:55,096 np_tablet_with_none = NumpyTablet( 2024-01-05T20:36:55,097 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-01-05T20:36:55,097 ) 2024-01-05T20:36:55,098 session.insert_tablet(np_tablet_with_none) 2024-01-05T20:36:55,098 ``` 2024-01-05T20:36:55,099 * Insert multiple Tablets 2024-01-05T20:36:55,100 ```python 2024-01-05T20:36:55,101 session.insert_tablets(tablet_lst) 2024-01-05T20:36:55,101 ``` 2024-01-05T20:36:55,102 * Insert a Record 2024-01-05T20:36:55,103 ```python 2024-01-05T20:36:55,104 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-01-05T20:36:55,104 ``` 2024-01-05T20:36:55,105 * Insert multiple Records 2024-01-05T20:36:55,106 ```python 2024-01-05T20:36:55,107 session.insert_records( 2024-01-05T20:36:55,107 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-01-05T20:36:55,108 ) 2024-01-05T20:36:55,108 ``` 2024-01-05T20:36:55,109 * Insert multiple Records that belong to the same device. 2024-01-05T20:36:55,110 With type info the server has no need to do type inference, which leads a better performance 2024-01-05T20:36:55,111 ```python 2024-01-05T20:36:55,111 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-01-05T20:36:55,112 ``` 2024-01-05T20:36:55,113 #### Insert with type inference 2024-01-05T20:36:55,114 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2024-01-05T20:36:55,115 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-01-05T20:36:55,116 ```python 2024-01-05T20:36:55,116 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-01-05T20:36:55,117 ``` 2024-01-05T20:36:55,118 #### Insert of Aligned Timeseries 2024-01-05T20:36:55,119 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-01-05T20:36:55,121 * insert_aligned_record 2024-01-05T20:36:55,121 * insert_aligned_records 2024-01-05T20:36:55,122 * insert_aligned_records_of_one_device 2024-01-05T20:36:55,123 * insert_aligned_tablet 2024-01-05T20:36:55,124 * insert_aligned_tablets 2024-01-05T20:36:55,126 ### IoTDB-SQL Interface 2024-01-05T20:36:55,127 * Execute query statement 2024-01-05T20:36:55,128 ```python 2024-01-05T20:36:55,129 session.execute_query_statement(sql) 2024-01-05T20:36:55,129 ``` 2024-01-05T20:36:55,131 * Execute non query statement 2024-01-05T20:36:55,132 ```python 2024-01-05T20:36:55,132 session.execute_non_query_statement(sql) 2024-01-05T20:36:55,133 ``` 2024-01-05T20:36:55,134 * Execute statement 2024-01-05T20:36:55,135 ```python 2024-01-05T20:36:55,135 session.execute_statement(sql) 2024-01-05T20:36:55,136 ``` 2024-01-05T20:36:55,137 ### Device Template 2024-01-05T20:36:55,137 #### Create Device Template 2024-01-05T20:36:55,138 The step for creating a metadata template is as follows 2024-01-05T20:36:55,139 1. Create the template class 2024-01-05T20:36:55,139 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-01-05T20:36:55,140 3. Execute create device template function 2024-01-05T20:36:55,141 ```python 2024-01-05T20:36:55,141 template = Template(name=template_name, share_time=True) 2024-01-05T20:36:55,142 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-01-05T20:36:55,143 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-01-05T20:36:55,144 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-01-05T20:36:55,145 i_node_gps.add_child(m_node_x) 2024-01-05T20:36:55,146 i_node_v.add_child(m_node_x) 2024-01-05T20:36:55,147 template.add_template(i_node_gps) 2024-01-05T20:36:55,147 template.add_template(i_node_v) 2024-01-05T20:36:55,148 template.add_template(m_node_x) 2024-01-05T20:36:55,149 session.create_schema_template(template) 2024-01-05T20:36:55,149 ``` 2024-01-05T20:36:55,150 #### Modify Device Template nodes 2024-01-05T20:36:55,150 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-01-05T20:36:55,150 * add node in template 2024-01-05T20:36:55,151 ```python 2024-01-05T20:36:55,151 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-01-05T20:36:55,152 ``` 2024-01-05T20:36:55,153 * delete node in template 2024-01-05T20:36:55,153 ```python 2024-01-05T20:36:55,154 session.delete_node_in_template(template_name, path) 2024-01-05T20:36:55,154 ``` 2024-01-05T20:36:55,155 #### Set Device Template 2024-01-05T20:36:55,156 ```python 2024-01-05T20:36:55,156 session.set_schema_template(template_name, prefix_path) 2024-01-05T20:36:55,157 ``` 2024-01-05T20:36:55,158 #### Uset Device Template 2024-01-05T20:36:55,158 ```python 2024-01-05T20:36:55,159 session.unset_schema_template(template_name, prefix_path) 2024-01-05T20:36:55,159 ``` 2024-01-05T20:36:55,160 #### Show Device Template 2024-01-05T20:36:55,160 * Show all device templates 2024-01-05T20:36:55,161 ```python 2024-01-05T20:36:55,161 session.show_all_templates() 2024-01-05T20:36:55,162 ``` 2024-01-05T20:36:55,162 * Count all nodes in templates 2024-01-05T20:36:55,163 ```python 2024-01-05T20:36:55,164 session.count_measurements_in_template(template_name) 2024-01-05T20:36:55,164 ``` 2024-01-05T20:36:55,165 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-01-05T20:36:55,166 ```python 2024-01-05T20:36:55,166 session.count_measurements_in_template(template_name, path) 2024-01-05T20:36:55,167 ``` 2024-01-05T20:36:55,168 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-01-05T20:36:55,168 ```python 2024-01-05T20:36:55,169 session.is_path_exist_in_template(template_name, path) 2024-01-05T20:36:55,170 ``` 2024-01-05T20:36:55,171 * Show nodes under in device template 2024-01-05T20:36:55,171 ```python 2024-01-05T20:36:55,172 session.show_measurements_in_template(template_name) 2024-01-05T20:36:55,173 ``` 2024-01-05T20:36:55,174 * Show the path prefix where a device template is set 2024-01-05T20:36:55,174 ```python 2024-01-05T20:36:55,175 session.show_paths_template_set_on(template_name) 2024-01-05T20:36:55,175 ``` 2024-01-05T20:36:55,177 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-01-05T20:36:55,177 ```python 2024-01-05T20:36:55,178 session.show_paths_template_using_on(template_name) 2024-01-05T20:36:55,178 ``` 2024-01-05T20:36:55,179 #### Drop Device Template 2024-01-05T20:36:55,180 Delete an existing metadata template,dropping an already set template is not supported 2024-01-05T20:36:55,180 ```python 2024-01-05T20:36:55,181 session.drop_schema_template("template_python") 2024-01-05T20:36:55,182 ``` 2024-01-05T20:36:55,183 ### Pandas Support 2024-01-05T20:36:55,185 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-01-05T20:36:55,185 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-01-05T20:36:55,187 Example: 2024-01-05T20:36:55,188 ```python 2024-01-05T20:36:55,188 from iotdb.Session import Session 2024-01-05T20:36:55,189 ip = "127.0.0.1" 2024-01-05T20:36:55,190 port_ = "6667" 2024-01-05T20:36:55,191 username_ = "root" 2024-01-05T20:36:55,191 password_ = "root" 2024-01-05T20:36:55,192 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:55,192 session.open(False) 2024-01-05T20:36:55,193 result = session.execute_query_statement("SELECT * FROM root.*") 2024-01-05T20:36:55,194 # Transform to Pandas Dataset 2024-01-05T20:36:55,194 df = result.todf() 2024-01-05T20:36:55,195 session.close() 2024-01-05T20:36:55,196 # Now you can work with the dataframe 2024-01-05T20:36:55,196 df = ... 2024-01-05T20:36:55,196 ``` 2024-01-05T20:36:55,197 ### IoTDB Testcontainer 2024-01-05T20:36:55,198 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2024-01-05T20:36:55,199 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-01-05T20:36:55,200 ```python 2024-01-05T20:36:55,200 class MyTestCase(unittest.TestCase): 2024-01-05T20:36:55,201 def test_something(self): 2024-01-05T20:36:55,202 with IoTDBContainer() as c: 2024-01-05T20:36:55,203 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-01-05T20:36:55,203 session.open(False) 2024-01-05T20:36:55,204 result = session.execute_query_statement("SHOW TIMESERIES") 2024-01-05T20:36:55,204 print(result) 2024-01-05T20:36:55,205 session.close() 2024-01-05T20:36:55,205 ``` 2024-01-05T20:36:55,206 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2024-01-05T20:36:55,207 ### IoTDB DBAPI 2024-01-05T20:36:55,208 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-01-05T20:36:55,209 interface for accessing databases in Python. 2024-01-05T20:36:55,210 #### Examples 2024-01-05T20:36:55,211 + Initialization 2024-01-05T20:36:55,211 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-01-05T20:36:55,212 ```python 2024-01-05T20:36:55,212 from iotdb.dbapi import connect 2024-01-05T20:36:55,213 ip = "127.0.0.1" 2024-01-05T20:36:55,214 port_ = "6667" 2024-01-05T20:36:55,214 username_ = "root" 2024-01-05T20:36:55,215 password_ = "root" 2024-01-05T20:36:55,215 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-01-05T20:36:55,216 cursor = conn.cursor() 2024-01-05T20:36:55,216 ``` 2024-01-05T20:36:55,217 + simple SQL statement execution 2024-01-05T20:36:55,217 ```python 2024-01-05T20:36:55,218 cursor.execute("SELECT * FROM root.*") 2024-01-05T20:36:55,218 for row in cursor.fetchall(): 2024-01-05T20:36:55,219 print(row) 2024-01-05T20:36:55,219 ``` 2024-01-05T20:36:55,220 + execute SQL with parameter 2024-01-05T20:36:55,221 IoTDB DBAPI supports pyformat style parameters 2024-01-05T20:36:55,222 ```python 2024-01-05T20:36:55,222 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-01-05T20:36:55,223 for row in cursor.fetchall(): 2024-01-05T20:36:55,223 print(row) 2024-01-05T20:36:55,224 ``` 2024-01-05T20:36:55,225 + execute SQL with parameter sequences 2024-01-05T20:36:55,225 ```python 2024-01-05T20:36:55,226 seq_of_parameters = [ 2024-01-05T20:36:55,226 {"timestamp": 1, "temperature": 1}, 2024-01-05T20:36:55,227 {"timestamp": 2, "temperature": 2}, 2024-01-05T20:36:55,227 {"timestamp": 3, "temperature": 3}, 2024-01-05T20:36:55,228 {"timestamp": 4, "temperature": 4}, 2024-01-05T20:36:55,228 {"timestamp": 5, "temperature": 5}, 2024-01-05T20:36:55,229 ] 2024-01-05T20:36:55,230 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-01-05T20:36:55,230 cursor.executemany(sql,seq_of_parameters) 2024-01-05T20:36:55,231 ``` 2024-01-05T20:36:55,232 + close the connection and cursor 2024-01-05T20:36:55,232 ```python 2024-01-05T20:36:55,233 cursor.close() 2024-01-05T20:36:55,233 conn.close() 2024-01-05T20:36:55,233 ``` 2024-01-05T20:36:55,234 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-01-05T20:36:55,235 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-01-05T20:36:55,235 This part is still being improved. 2024-01-05T20:36:55,236 Please do not use it in the production environment! 2024-01-05T20:36:55,236 #### Mapping of the metadata 2024-01-05T20:36:55,236 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-01-05T20:36:55,237 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-01-05T20:36:55,237 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-01-05T20:36:55,238 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-01-05T20:36:55,239 The metadata in the IoTDB are: 2024-01-05T20:36:55,240 1. Database 2024-01-05T20:36:55,240 2. Path 2024-01-05T20:36:55,241 3. Entity 2024-01-05T20:36:55,241 4. Measurement 2024-01-05T20:36:55,242 The metadata in the SQLAlchemy are: 2024-01-05T20:36:55,243 1. Schema 2024-01-05T20:36:55,243 2. Table 2024-01-05T20:36:55,244 3. Column 2024-01-05T20:36:55,245 The mapping relationship between them is: 2024-01-05T20:36:55,245 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-01-05T20:36:55,246 | -------------------- | ---------------------------------------------- | 2024-01-05T20:36:55,246 | Schema | Database | 2024-01-05T20:36:55,247 | Table | Path ( from database to entity ) + Entity | 2024-01-05T20:36:55,247 | Column | Measurement | 2024-01-05T20:36:55,248 The following figure shows the relationship between the two more intuitively: 2024-01-05T20:36:55,250 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-01-05T20:36:55,251 #### Data type mapping 2024-01-05T20:36:55,251 | data type in IoTDB | data type in SQLAlchemy | 2024-01-05T20:36:55,252 |--------------------|-------------------------| 2024-01-05T20:36:55,252 | BOOLEAN | Boolean | 2024-01-05T20:36:55,253 | INT32 | Integer | 2024-01-05T20:36:55,253 | INT64 | BigInteger | 2024-01-05T20:36:55,254 | FLOAT | Float | 2024-01-05T20:36:55,255 | DOUBLE | Float | 2024-01-05T20:36:55,255 | TEXT | Text | 2024-01-05T20:36:55,256 | LONG | BigInteger | 2024-01-05T20:36:55,256 #### Example 2024-01-05T20:36:55,257 + execute statement 2024-01-05T20:36:55,258 ```python 2024-01-05T20:36:55,259 from sqlalchemy import create_engine 2024-01-05T20:36:55,260 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:55,260 connect = engine.connect() 2024-01-05T20:36:55,261 result = connect.execute("SELECT ** FROM root") 2024-01-05T20:36:55,262 for row in result.fetchall(): 2024-01-05T20:36:55,262 print(row) 2024-01-05T20:36:55,263 ``` 2024-01-05T20:36:55,264 + ORM (now only simple queries are supported) 2024-01-05T20:36:55,265 ```python 2024-01-05T20:36:55,265 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-01-05T20:36:55,266 from sqlalchemy.ext.declarative import declarative_base 2024-01-05T20:36:55,266 from sqlalchemy.orm import sessionmaker 2024-01-05T20:36:55,267 metadata = MetaData( 2024-01-05T20:36:55,268 schema='root.factory' 2024-01-05T20:36:55,268 ) 2024-01-05T20:36:55,269 Base = declarative_base(metadata=metadata) 2024-01-05T20:36:55,270 class Device(Base): 2024-01-05T20:36:55,271 __tablename__ = "room2.device1" 2024-01-05T20:36:55,271 Time = Column(BigInteger, primary_key=True) 2024-01-05T20:36:55,272 temperature = Column(Float) 2024-01-05T20:36:55,272 status = Column(Float) 2024-01-05T20:36:55,273 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-01-05T20:36:55,274 DbSession = sessionmaker(bind=engine) 2024-01-05T20:36:55,275 session = DbSession() 2024-01-05T20:36:55,275 res = session.query(Device.status).filter(Device.temperature > 1) 2024-01-05T20:36:55,276 for row in res: 2024-01-05T20:36:55,277 print(row) 2024-01-05T20:36:55,277 ``` 2024-01-05T20:36:55,278 ## Developers 2024-01-05T20:36:55,279 ### Introduction 2024-01-05T20:36:55,280 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2024-01-05T20:36:55,282 ### Prerequisites 2024-01-05T20:36:55,283 Python3.7 or later is preferred. 2024-01-05T20:36:55,284 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2024-01-05T20:36:55,285 ``` 2024-01-05T20:36:55,285 http://thrift.apache.org/docs/install/ 2024-01-05T20:36:55,285 ``` 2024-01-05T20:36:55,286 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-01-05T20:36:55,287 ```shell 2024-01-05T20:36:55,287 pip install -r requirements_dev.txt 2024-01-05T20:36:55,288 ``` 2024-01-05T20:36:55,290 ### Compile the thrift library and Debug 2024-01-05T20:36:55,290 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-01-05T20:36:55,291 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-01-05T20:36:55,292 This folder is ignored from git and should **never be pushed to git!** 2024-01-05T20:36:55,293 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-01-05T20:36:55,295 ### Session Client & Example 2024-01-05T20:36:55,296 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2024-01-05T20:36:55,297 Or, another simple example: 2024-01-05T20:36:55,298 ```python 2024-01-05T20:36:55,299 from iotdb.Session import Session 2024-01-05T20:36:55,300 ip = "127.0.0.1" 2024-01-05T20:36:55,300 port_ = "6667" 2024-01-05T20:36:55,301 username_ = "root" 2024-01-05T20:36:55,301 password_ = "root" 2024-01-05T20:36:55,302 session = Session(ip, port_, username_, password_) 2024-01-05T20:36:55,302 session.open(False) 2024-01-05T20:36:55,303 zone = session.get_time_zone() 2024-01-05T20:36:55,303 session.close() 2024-01-05T20:36:55,304 ``` 2024-01-05T20:36:55,306 ### Tests 2024-01-05T20:36:55,307 Please add your custom tests in `tests` folder. 2024-01-05T20:36:55,308 To run all defined tests just type `pytest .` in the root folder. 2024-01-05T20:36:55,310 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2024-01-05T20:36:55,312 ### Futher Tools 2024-01-05T20:36:55,313 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-01-05T20:36:55,313 Both can be run by `black .` or `flake8 .` respectively. 2024-01-05T20:36:55,315 ## Releasing 2024-01-05T20:36:55,317 To do a release just ensure that you have the right set of generated thrift files. 2024-01-05T20:36:55,317 Then run linting and auto-formatting. 2024-01-05T20:36:55,318 Then, ensure that all tests work (via `pytest .`). 2024-01-05T20:36:55,318 Then you are good to go to do a release! 2024-01-05T20:36:55,320 ### Preparing your environment 2024-01-05T20:36:55,321 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-01-05T20:36:55,323 ### Doing the Release 2024-01-05T20:36:55,323 There is a convenient script `release.sh` to do all steps for a release. 2024-01-05T20:36:55,324 Namely, these are 2024-01-05T20:36:55,325 * Remove all transient directories from last release (if exists) 2024-01-05T20:36:55,325 * (Re-)generate all generated sources via mvn 2024-01-05T20:36:55,325 * Run Linting (flake8) 2024-01-05T20:36:55,326 * Run Tests via pytest 2024-01-05T20:36:55,326 * Build 2024-01-05T20:36:55,327 * Release to pypi 2024-01-05T20:36:55,328 /tmp/pip-build-env-885lctgg/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2024-01-05T20:36:55,329 warnings.warn(msg) 2024-01-05T20:36:55,330 running bdist_wheel 2024-01-05T20:36:55,330 running build 2024-01-05T20:36:55,331 running build_py 2024-01-05T20:36:55,331 creating build 2024-01-05T20:36:55,331 creating build/lib 2024-01-05T20:36:55,332 creating build/lib/iotdb 2024-01-05T20:36:55,332 copying iotdb/__init__.py -> build/lib/iotdb 2024-01-05T20:36:55,333 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2024-01-05T20:36:55,333 copying iotdb/SessionPool.py -> build/lib/iotdb 2024-01-05T20:36:55,333 copying iotdb/Session.py -> build/lib/iotdb 2024-01-05T20:36:55,334 creating build/lib/tests 2024-01-05T20:36:55,334 copying tests/tablet_performance_comparison.py -> build/lib/tests 2024-01-05T20:36:55,335 copying tests/test_aligned_timeseries.py -> build/lib/tests 2024-01-05T20:36:55,335 copying tests/__init__.py -> build/lib/tests 2024-01-05T20:36:55,336 copying tests/test_session_pool.py -> build/lib/tests 2024-01-05T20:36:55,337 copying tests/test_numpy_tablet.py -> build/lib/tests 2024-01-05T20:36:55,338 copying tests/test_todf.py -> build/lib/tests 2024-01-05T20:36:55,340 copying tests/test_session.py -> build/lib/tests 2024-01-05T20:36:55,341 copying tests/test_tablet.py -> build/lib/tests 2024-01-05T20:36:55,341 copying tests/test_dataframe.py -> build/lib/tests 2024-01-05T20:36:55,342 copying tests/test_delete_data.py -> build/lib/tests 2024-01-05T20:36:55,342 copying tests/test_template.py -> build/lib/tests 2024-01-05T20:36:55,343 copying tests/test_one_device.py -> build/lib/tests 2024-01-05T20:36:55,343 creating build/lib/iotdb/utils 2024-01-05T20:36:55,344 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,344 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,345 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,345 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,346 copying iotdb/utils/IoTDBConnectionException.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,347 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,349 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,350 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,351 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,351 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2024-01-05T20:36:55,352 creating build/lib/iotdb/tsfile 2024-01-05T20:36:55,353 copying iotdb/tsfile/__init__.py -> build/lib/iotdb/tsfile 2024-01-05T20:36:55,353 creating build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,354 copying iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,354 copying iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,355 copying iotdb/sqlalchemy/__init__.py -> build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,356 copying iotdb/sqlalchemy/IoTDBDialect.py -> build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,357 copying iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/lib/iotdb/sqlalchemy 2024-01-05T20:36:55,357 creating build/lib/iotdb/template 2024-01-05T20:36:55,359 copying iotdb/template/__init__.py -> build/lib/iotdb/template 2024-01-05T20:36:55,359 copying iotdb/template/Template.py -> build/lib/iotdb/template 2024-01-05T20:36:55,360 copying iotdb/template/TemplateNode.py -> build/lib/iotdb/template 2024-01-05T20:36:55,361 copying iotdb/template/TemplateQueryType.py -> build/lib/iotdb/template 2024-01-05T20:36:55,362 copying iotdb/template/InternalNode.py -> build/lib/iotdb/template 2024-01-05T20:36:55,363 copying iotdb/template/MeasurementNode.py -> build/lib/iotdb/template 2024-01-05T20:36:55,363 creating build/lib/iotdb/thrift 2024-01-05T20:36:55,364 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2024-01-05T20:36:55,364 creating build/lib/iotdb/dbapi 2024-01-05T20:36:55,365 copying iotdb/dbapi/__init__.py -> build/lib/iotdb/dbapi 2024-01-05T20:36:55,366 copying iotdb/dbapi/Exceptions.py -> build/lib/iotdb/dbapi 2024-01-05T20:36:55,366 copying iotdb/dbapi/Cursor.py -> build/lib/iotdb/dbapi 2024-01-05T20:36:55,367 copying iotdb/dbapi/Connection.py -> build/lib/iotdb/dbapi 2024-01-05T20:36:55,368 creating build/lib/iotdb/tsfile/utils 2024-01-05T20:36:55,368 copying iotdb/tsfile/utils/__init__.py -> build/lib/iotdb/tsfile/utils 2024-01-05T20:36:55,369 copying iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/lib/iotdb/tsfile/utils 2024-01-05T20:36:55,370 copying iotdb/tsfile/utils/Pair.py -> build/lib/iotdb/tsfile/utils 2024-01-05T20:36:55,370 creating build/lib/iotdb/tsfile/common 2024-01-05T20:36:55,370 copying iotdb/tsfile/common/__init__.py -> build/lib/iotdb/tsfile/common 2024-01-05T20:36:55,371 creating build/lib/iotdb/tsfile/common/constant 2024-01-05T20:36:55,372 copying iotdb/tsfile/common/constant/TsFileConstant.py -> build/lib/iotdb/tsfile/common/constant 2024-01-05T20:36:55,372 copying iotdb/tsfile/common/constant/__init__.py -> build/lib/iotdb/tsfile/common/constant 2024-01-05T20:36:55,373 creating build/lib/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,373 copying iotdb/sqlalchemy/tests/__init__.py -> build/lib/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,373 copying iotdb/sqlalchemy/tests/test_dialect.py -> build/lib/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,374 creating build/lib/iotdb/thrift/rpc 2024-01-05T20:36:55,375 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2024-01-05T20:36:55,375 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2024-01-05T20:36:55,376 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2024-01-05T20:36:55,376 copying iotdb/thrift/rpc/IClientRPCService.py -> build/lib/iotdb/thrift/rpc 2024-01-05T20:36:55,377 creating build/lib/iotdb/thrift/common 2024-01-05T20:36:55,378 copying iotdb/thrift/common/__init__.py -> build/lib/iotdb/thrift/common 2024-01-05T20:36:55,378 copying iotdb/thrift/common/constants.py -> build/lib/iotdb/thrift/common 2024-01-05T20:36:55,379 copying iotdb/thrift/common/ttypes.py -> build/lib/iotdb/thrift/common 2024-01-05T20:36:55,379 creating build/lib/iotdb/dbapi/tests 2024-01-05T20:36:55,380 copying iotdb/dbapi/tests/__init__.py -> build/lib/iotdb/dbapi/tests 2024-01-05T20:36:55,380 copying iotdb/dbapi/tests/test_connection.py -> build/lib/iotdb/dbapi/tests 2024-01-05T20:36:55,381 copying iotdb/dbapi/tests/test_cursor.py -> build/lib/iotdb/dbapi/tests 2024-01-05T20:36:55,397 installing to build/bdist.linux-armv7l/wheel 2024-01-05T20:36:55,398 running install 2024-01-05T20:36:55,422 running install_lib 2024-01-05T20:36:55,429 creating build/bdist.linux-armv7l 2024-01-05T20:36:55,429 creating build/bdist.linux-armv7l/wheel 2024-01-05T20:36:55,431 creating build/bdist.linux-armv7l/wheel/iotdb 2024-01-05T20:36:55,433 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,434 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,436 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,438 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,440 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,442 copying build/lib/iotdb/utils/IoTDBConnectionException.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,444 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,446 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,449 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,451 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,453 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-01-05T20:36:55,455 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-01-05T20:36:55,457 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-01-05T20:36:55,458 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-01-05T20:36:55,459 copying build/lib/iotdb/tsfile/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-01-05T20:36:55,461 copying build/lib/iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-01-05T20:36:55,463 copying build/lib/iotdb/tsfile/utils/Pair.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-01-05T20:36:55,465 copying build/lib/iotdb/tsfile/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-01-05T20:36:55,467 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-01-05T20:36:55,469 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-01-05T20:36:55,470 copying build/lib/iotdb/tsfile/common/constant/TsFileConstant.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-01-05T20:36:55,472 copying build/lib/iotdb/tsfile/common/constant/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-01-05T20:36:55,474 copying build/lib/iotdb/tsfile/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-01-05T20:36:55,476 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-01-05T20:36:55,478 copying build/lib/iotdb/SessionPool.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-01-05T20:36:55,481 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,482 copying build/lib/iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,484 copying build/lib/iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,486 copying build/lib/iotdb/sqlalchemy/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,488 copying build/lib/iotdb/sqlalchemy/IoTDBDialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,491 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,492 copying build/lib/iotdb/sqlalchemy/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,494 copying build/lib/iotdb/sqlalchemy/tests/test_dialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-01-05T20:36:55,496 copying build/lib/iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-01-05T20:36:55,498 creating build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,499 copying build/lib/iotdb/template/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,502 copying build/lib/iotdb/template/Template.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,504 copying build/lib/iotdb/template/TemplateNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,506 copying build/lib/iotdb/template/TemplateQueryType.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,508 copying build/lib/iotdb/template/InternalNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,510 copying build/lib/iotdb/template/MeasurementNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-01-05T20:36:55,513 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-01-05T20:36:55,514 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-01-05T20:36:55,516 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-01-05T20:36:55,517 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-01-05T20:36:55,520 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-01-05T20:36:55,522 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-01-05T20:36:55,529 copying build/lib/iotdb/thrift/rpc/IClientRPCService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-01-05T20:36:55,538 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-01-05T20:36:55,539 copying build/lib/iotdb/thrift/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-01-05T20:36:55,541 copying build/lib/iotdb/thrift/common/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-01-05T20:36:55,544 copying build/lib/iotdb/thrift/common/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-01-05T20:36:55,548 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-01-05T20:36:55,553 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-01-05T20:36:55,554 copying build/lib/iotdb/dbapi/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-01-05T20:36:55,556 copying build/lib/iotdb/dbapi/Exceptions.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-01-05T20:36:55,559 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-01-05T20:36:55,560 copying build/lib/iotdb/dbapi/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-01-05T20:36:55,563 copying build/lib/iotdb/dbapi/tests/test_connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-01-05T20:36:55,565 copying build/lib/iotdb/dbapi/tests/test_cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-01-05T20:36:55,567 copying build/lib/iotdb/dbapi/Cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-01-05T20:36:55,570 copying build/lib/iotdb/dbapi/Connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-01-05T20:36:55,573 creating build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,574 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,577 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,579 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,581 copying build/lib/tests/test_session_pool.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,584 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,586 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,589 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,592 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,594 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,597 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,599 copying build/lib/tests/test_template.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,602 copying build/lib/tests/test_one_device.py -> build/bdist.linux-armv7l/wheel/tests 2024-01-05T20:36:55,604 running install_egg_info 2024-01-05T20:36:55,615 running egg_info 2024-01-05T20:36:55,620 writing apache_iotdb.egg-info/PKG-INFO 2024-01-05T20:36:55,624 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-01-05T20:36:55,625 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-01-05T20:36:55,627 writing requirements to apache_iotdb.egg-info/requires.txt 2024-01-05T20:36:55,628 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-01-05T20:36:55,647 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:55,654 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-01-05T20:36:55,656 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.0-py3.11.egg-info 2024-01-05T20:36:55,669 running install_scripts 2024-01-05T20:36:55,687 creating build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.0.dist-info/WHEEL 2024-01-05T20:36:55,690 creating '/tmp/pip-wheel-x_sfta62/.tmp-vyfm6js_/apache_iotdb-1.3.0-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2024-01-05T20:36:55,694 adding 'iotdb/IoTDBContainer.py' 2024-01-05T20:36:55,701 adding 'iotdb/Session.py' 2024-01-05T20:36:55,704 adding 'iotdb/SessionPool.py' 2024-01-05T20:36:55,705 adding 'iotdb/__init__.py' 2024-01-05T20:36:55,708 adding 'iotdb/dbapi/Connection.py' 2024-01-05T20:36:55,710 adding 'iotdb/dbapi/Cursor.py' 2024-01-05T20:36:55,712 adding 'iotdb/dbapi/Exceptions.py' 2024-01-05T20:36:55,713 adding 'iotdb/dbapi/__init__.py' 2024-01-05T20:36:55,715 adding 'iotdb/dbapi/tests/__init__.py' 2024-01-05T20:36:55,717 adding 'iotdb/dbapi/tests/test_connection.py' 2024-01-05T20:36:55,719 adding 'iotdb/dbapi/tests/test_cursor.py' 2024-01-05T20:36:55,722 adding 'iotdb/sqlalchemy/IoTDBDialect.py' 2024-01-05T20:36:55,724 adding 'iotdb/sqlalchemy/IoTDBIdentifierPreparer.py' 2024-01-05T20:36:55,726 adding 'iotdb/sqlalchemy/IoTDBSQLCompiler.py' 2024-01-05T20:36:55,728 adding 'iotdb/sqlalchemy/IoTDBTypeCompiler.py' 2024-01-05T20:36:55,730 adding 'iotdb/sqlalchemy/__init__.py' 2024-01-05T20:36:55,732 adding 'iotdb/sqlalchemy/tests/__init__.py' 2024-01-05T20:36:55,734 adding 'iotdb/sqlalchemy/tests/test_dialect.py' 2024-01-05T20:36:55,736 adding 'iotdb/template/InternalNode.py' 2024-01-05T20:36:55,738 adding 'iotdb/template/MeasurementNode.py' 2024-01-05T20:36:55,740 adding 'iotdb/template/Template.py' 2024-01-05T20:36:55,741 adding 'iotdb/template/TemplateNode.py' 2024-01-05T20:36:55,743 adding 'iotdb/template/TemplateQueryType.py' 2024-01-05T20:36:55,745 adding 'iotdb/template/__init__.py' 2024-01-05T20:36:55,747 adding 'iotdb/thrift/__init__.py' 2024-01-05T20:36:55,749 adding 'iotdb/thrift/common/__init__.py' 2024-01-05T20:36:55,751 adding 'iotdb/thrift/common/constants.py' 2024-01-05T20:36:55,756 adding 'iotdb/thrift/common/ttypes.py' 2024-01-05T20:36:55,771 adding 'iotdb/thrift/rpc/IClientRPCService.py' 2024-01-05T20:36:55,775 adding 'iotdb/thrift/rpc/__init__.py' 2024-01-05T20:36:55,777 adding 'iotdb/thrift/rpc/constants.py' 2024-01-05T20:36:55,790 adding 'iotdb/thrift/rpc/ttypes.py' 2024-01-05T20:36:55,794 adding 'iotdb/tsfile/__init__.py' 2024-01-05T20:36:55,796 adding 'iotdb/tsfile/common/__init__.py' 2024-01-05T20:36:55,798 adding 'iotdb/tsfile/common/constant/TsFileConstant.py' 2024-01-05T20:36:55,800 adding 'iotdb/tsfile/common/constant/__init__.py' 2024-01-05T20:36:55,802 adding 'iotdb/tsfile/utils/Pair.py' 2024-01-05T20:36:55,804 adding 'iotdb/tsfile/utils/ReadWriteIOUtils.py' 2024-01-05T20:36:55,806 adding 'iotdb/tsfile/utils/__init__.py' 2024-01-05T20:36:55,808 adding 'iotdb/utils/BitMap.py' 2024-01-05T20:36:55,810 adding 'iotdb/utils/Field.py' 2024-01-05T20:36:55,812 adding 'iotdb/utils/IoTDBConnectionException.py' 2024-01-05T20:36:55,813 adding 'iotdb/utils/IoTDBConstants.py' 2024-01-05T20:36:55,816 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2024-01-05T20:36:55,818 adding 'iotdb/utils/NumpyTablet.py' 2024-01-05T20:36:55,820 adding 'iotdb/utils/RowRecord.py' 2024-01-05T20:36:55,821 adding 'iotdb/utils/SessionDataSet.py' 2024-01-05T20:36:55,823 adding 'iotdb/utils/Tablet.py' 2024-01-05T20:36:55,824 adding 'iotdb/utils/__init__.py' 2024-01-05T20:36:55,825 adding 'tests/__init__.py' 2024-01-05T20:36:55,827 adding 'tests/tablet_performance_comparison.py' 2024-01-05T20:36:55,829 adding 'tests/test_aligned_timeseries.py' 2024-01-05T20:36:55,830 adding 'tests/test_dataframe.py' 2024-01-05T20:36:55,832 adding 'tests/test_delete_data.py' 2024-01-05T20:36:55,834 adding 'tests/test_numpy_tablet.py' 2024-01-05T20:36:55,835 adding 'tests/test_one_device.py' 2024-01-05T20:36:55,837 adding 'tests/test_session.py' 2024-01-05T20:36:55,838 adding 'tests/test_session_pool.py' 2024-01-05T20:36:55,840 adding 'tests/test_tablet.py' 2024-01-05T20:36:55,841 adding 'tests/test_template.py' 2024-01-05T20:36:55,843 adding 'tests/test_todf.py' 2024-01-05T20:36:55,845 adding 'apache_iotdb-1.3.0.dist-info/METADATA' 2024-01-05T20:36:55,847 adding 'apache_iotdb-1.3.0.dist-info/WHEEL' 2024-01-05T20:36:55,848 adding 'apache_iotdb-1.3.0.dist-info/entry_points.txt' 2024-01-05T20:36:55,849 adding 'apache_iotdb-1.3.0.dist-info/top_level.txt' 2024-01-05T20:36:55,850 adding 'apache_iotdb-1.3.0.dist-info/RECORD' 2024-01-05T20:36:55,853 removing build/bdist.linux-armv7l/wheel 2024-01-05T20:36:55,962 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2024-01-05T20:36:55,970 Created wheel for apache-iotdb: filename=apache_iotdb-1.3.0-py3-none-any.whl size=127592 sha256=ca1a253e48a497e1827121b7ceaf6a1bbebfc2add7c7932550384d3c424d4276 2024-01-05T20:36:55,972 Stored in directory: /tmp/pip-ephem-wheel-cache-zf_pzy_t/wheels/7b/5e/77/9021ec602ff9cfaa816b42265064678f0c2ee5bcdb0ab50ab9 2024-01-05T20:36:55,988 Successfully built apache-iotdb 2024-01-05T20:36:55,995 Removed build tracker: '/tmp/pip-build-tracker-gzzhb4wu'