From 32dc94174fa2fd0e6ab2c1f24784d78325f75337 Mon Sep 17 00:00:00 2001 From: bodrovis Date: Wed, 15 May 2024 14:41:37 +0300 Subject: [PATCH] Version 2.3.0 --- docs/additional_info/changelog.rst | 16 ++ docs/api/getting_started.rst | 21 ++ docs/api/keys.rst | 9 +- docs/api/translations.rst | 2 + lokalise/collections/base_collection.py | 8 + lokalise/request.py | 3 +- poetry.lock | 203 +++++++++--------- pyproject.toml | 2 +- .../test_all_branches_pagination.yaml | 37 ++-- .../cassettes/keys_test/test_keys_cursor.yaml | 68 ++++++ .../test_translations_pagination_cursor.yaml | 61 ++++++ tests/client/branches_test.py | 20 +- tests/client/keys_test.py | 24 +++ tests/client/translations_test.py | 22 ++ 14 files changed, 358 insertions(+), 138 deletions(-) create mode 100644 tests/cassettes/keys_test/test_keys_cursor.yaml create mode 100644 tests/cassettes/translations_test/test_translations_pagination_cursor.yaml diff --git a/docs/additional_info/changelog.rst b/docs/additional_info/changelog.rst index fbcd2ce..99fd0aa 100644 --- a/docs/additional_info/changelog.rst +++ b/docs/additional_info/changelog.rst @@ -3,6 +3,22 @@ Changelog ========= +2.3.0 (15-May-2024) +------------------- + +* Add support for `cursor pagination `_ for List keys and List translation endpoints: + +.. code-block:: python + + keys = client.keys(YOUR_PROJECT_ID, { + "limit": 2, # The number of items to fetch. Optional, default is 100 + "pagination": "cursor", + "cursor": "eyIxIjo0NDU5NjA2MX0=" # The starting cursor. Optional, string + }) + + keys.has_next_cursor() # => True or False + keys.next_cursor # => String or None + 2.2.0 (17-Apr-2024) ------------------- diff --git a/docs/api/getting_started.rst b/docs/api/getting_started.rst index b6c184e..5f802ce 100644 --- a/docs/api/getting_started.rst +++ b/docs/api/getting_started.rst @@ -144,6 +144,27 @@ For example: projects.has_next_page() # => False, no more pages available projects.has_prev_page() # => True, there is a previous page available +Cursor pagination +----------------- + +The `List Keys `_ and `List Translations `_ endpoints support cursor pagination, which is recommended for its faster performance compared to traditional "offset" pagination. By default, "offset" pagination is used, so you must explicitly set `pagination` to `"cursor"` to use cursor pagination. + +.. code-block:: python + + keys = client.keys(YOUR_PROJECT_ID, { + "limit": 2, # The number of items to fetch. Optional, default is 100 + "pagination": "cursor", + "cursor": "eyIxIjo0NDU5NjA2MX0=" # The starting cursor. Optional, string + }) + +After retrieving data from the Lokalise API, you can check for the availability of the next cursor and proceed accordingly: + +.. code-block:: python + + keys.has_next_cursor() # => True or False + keys.next_cursor # => String or None + + Branching --------- diff --git a/docs/api/keys.rst b/docs/api/keys.rst index 072c0da..8d86c21 100644 --- a/docs/api/keys.rst +++ b/docs/api/keys.rst @@ -12,12 +12,9 @@ Fetch all keys :param dict params: Request parameters :return: Collection of keys -Please note that this endpoint should not be treated as a content delivery network -for your language files. It means that you should not perform a new request to this endpoint -with every website/app visitor. Instead, fetch this endpoint from time to time, -store the result locally and serve your visitors with static files/your database content. -Alternatively, you may use our Amazon S3/Google CloudStorage integrations in -automatically upload your language files to a bucket of your choice. +This endpoint also supports cursor pagination which is now a recommended approach, especially for fetching large amounts of data. Please `learn more in the docs `_. + +Please note that this endpoint should not be treated as a content delivery network for your language files. It means that you should not perform a new request to this endpoint with every website/app visitor. Instead, fetch this endpoint from time to time, store the result locally and serve your visitors with static files/your database content. Alternatively, you may use our Amazon S3/Google CloudStorage integrations in automatically upload your language files to a bucket of your choice. Example: diff --git a/docs/api/translations.rst b/docs/api/translations.rst index adc9c91..b7a76f3 100644 --- a/docs/api/translations.rst +++ b/docs/api/translations.rst @@ -24,6 +24,8 @@ Example: }) translations.items[0].translation_id # => 220681321 +This endpoint also supports cursor pagination which is now a recommended approach, especially for fetching large amounts of data. Please `learn more in the docs `_. + Fetch a translation ------------------- diff --git a/lokalise/collections/base_collection.py b/lokalise/collections/base_collection.py index d1afc9f..4fb150c 100644 --- a/lokalise/collections/base_collection.py +++ b/lokalise/collections/base_collection.py @@ -56,6 +56,7 @@ def __init__(self, raw_data: Dict[str, Any]) -> None: self.page_count = int(pagination.get("x-pagination-page-count", 0)) self.limit = int(pagination.get("x-pagination-limit", 0)) self.current_page = int(pagination.get("x-pagination-page", 0)) + self.next_cursor = pagination.get("x-pagination-next-cursor", None) def is_last_page(self) -> bool: """Checks whether the current collection set is the last page. @@ -85,6 +86,13 @@ def has_prev_page(self) -> bool: """ return self.current_page > 1 + def has_next_cursor(self) -> bool: + """Checks whether the current collection set has the next cursor. + + :rtype: bool + """ + return self.next_cursor is not None + def __extract_common_attrs(self, raw_data: Dict) -> None: """Fetches common data from the response and sets the corresponding attributes. diff --git a/lokalise/request.py b/lokalise/request.py index 54fe5e2..adab7ff 100644 --- a/lokalise/request.py +++ b/lokalise/request.py @@ -20,7 +20,8 @@ "x-pagination-total-count", "x-pagination-page-count", "x-pagination-limit", - "x-pagination-page" + "x-pagination-page", + "x-pagination-next-cursor" ] diff --git a/poetry.lock b/poetry.lock index faaa124..8de0fe9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "astroid" -version = "3.1.0" +version = "3.2.0" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" files = [ - {file = "astroid-3.1.0-py3-none-any.whl", hash = "sha256:951798f922990137ac090c53af473db7ab4e70c770e6d7fae0cec59f74411819"}, - {file = "astroid-3.1.0.tar.gz", hash = "sha256:ac248253bfa4bd924a0de213707e7ebeeb3138abeb48d798784ead1e56d419d4"}, + {file = "astroid-3.2.0-py3-none-any.whl", hash = "sha256:16ee8ca5c75ac828783028cc1f967777f0e507c6886a295ad143e0f405b975a2"}, + {file = "astroid-3.2.0.tar.gz", hash = "sha256:f7f829f8506ade59f1b3c6c93d8fac5b1ebc721685fa9af23e9794daf1d450a3"}, ] [package.dependencies] @@ -152,63 +152,63 @@ files = [ [[package]] name = "coverage" -version = "7.4.4" +version = "7.5.1" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.4.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2"}, - {file = "coverage-7.4.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ccd341521be3d1b3daeb41960ae94a5e87abe2f46f17224ba5d6f2b8398016cf"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fa497a8ab37784fbb20ab699c246053ac294d13fc7eb40ec007a5043ec91f8"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b1a93009cb80730c9bca5d6d4665494b725b6e8e157c1cb7f2db5b4b122ea562"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:690db6517f09336559dc0b5f55342df62370a48f5469fabf502db2c6d1cffcd2"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8ce1415194b4a6bd0cdcc3a1dfbf58b63f910dcb7330fe15bdff542c56949f87"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b91cbc4b195444e7e258ba27ac33769c41b94967919f10037e6355e998af255c"}, - {file = "coverage-7.4.4-cp310-cp310-win32.whl", hash = "sha256:598825b51b81c808cb6f078dcb972f96af96b078faa47af7dfcdf282835baa8d"}, - {file = "coverage-7.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:09ef9199ed6653989ebbcaacc9b62b514bb63ea2f90256e71fea3ed74bd8ff6f"}, - {file = "coverage-7.4.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f9f50e7ef2a71e2fae92774c99170eb8304e3fdf9c8c3c7ae9bab3e7229c5cf"}, - {file = "coverage-7.4.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:623512f8ba53c422fcfb2ce68362c97945095b864cda94a92edbaf5994201083"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40209e141059b9370a2657c9b15607815359ab3ef9918f0196b6fccce8d3230f"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a2b2b78c78293782fd3767d53e6474582f62443d0504b1554370bde86cc8227"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:73bfb9c09951125d06ee473bed216e2c3742f530fc5acc1383883125de76d9cd"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1f384c3cc76aeedce208643697fb3e8437604b512255de6d18dae3f27655a384"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:54eb8d1bf7cacfbf2a3186019bcf01d11c666bd495ed18717162f7eb1e9dd00b"}, - {file = "coverage-7.4.4-cp311-cp311-win32.whl", hash = "sha256:cac99918c7bba15302a2d81f0312c08054a3359eaa1929c7e4b26ebe41e9b286"}, - {file = "coverage-7.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:b14706df8b2de49869ae03a5ccbc211f4041750cd4a66f698df89d44f4bd30ec"}, - {file = "coverage-7.4.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:201bef2eea65e0e9c56343115ba3814e896afe6d36ffd37bab783261db430f76"}, - {file = "coverage-7.4.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:41c9c5f3de16b903b610d09650e5e27adbfa7f500302718c9ffd1c12cf9d6818"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d898fe162d26929b5960e4e138651f7427048e72c853607f2b200909794ed978"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ea79bb50e805cd6ac058dfa3b5c8f6c040cb87fe83de10845857f5535d1db70"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce4b94265ca988c3f8e479e741693d143026632672e3ff924f25fab50518dd51"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:69eb372f7e2ece89f14751fbcbe470295d73ed41ecd37ca36ed2eb47512a6ab9"}, - {file = "coverage-7.4.4-cp312-cp312-win32.whl", hash = "sha256:137eb07173141545e07403cca94ab625cc1cc6bc4c1e97b6e3846270e7e1fea0"}, - {file = "coverage-7.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:d71eec7d83298f1af3326ce0ff1d0ea83c7cb98f72b577097f9083b20bdaf05e"}, - {file = "coverage-7.4.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d5ae728ff3b5401cc320d792866987e7e7e880e6ebd24433b70a33b643bb0384"}, - {file = "coverage-7.4.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cc4f1358cb0c78edef3ed237ef2c86056206bb8d9140e73b6b89fbcfcbdd40e1"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8130a2aa2acb8788e0b56938786c33c7c98562697bf9f4c7d6e8e5e3a0501e4a"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf271892d13e43bc2b51e6908ec9a6a5094a4df1d8af0bfc360088ee6c684409"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4cdc86d54b5da0df6d3d3a2f0b710949286094c3a6700c21e9015932b81447e"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ae71e7ddb7a413dd60052e90528f2f65270aad4b509563af6d03d53e979feafd"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:38dd60d7bf242c4ed5b38e094baf6401faa114fc09e9e6632374388a404f98e7"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa5b1c1bfc28384f1f53b69a023d789f72b2e0ab1b3787aae16992a7ca21056c"}, - {file = "coverage-7.4.4-cp38-cp38-win32.whl", hash = "sha256:dfa8fe35a0bb90382837b238fff375de15f0dcdb9ae68ff85f7a63649c98527e"}, - {file = "coverage-7.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2991665420a803495e0b90a79233c1433d6ed77ef282e8e152a324bbbc5e0c8"}, - {file = "coverage-7.4.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3b799445b9f7ee8bf299cfaed6f5b226c0037b74886a4e11515e569b36fe310d"}, - {file = "coverage-7.4.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b4d33f418f46362995f1e9d4f3a35a1b6322cb959c31d88ae56b0298e1c22357"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aadacf9a2f407a4688d700e4ebab33a7e2e408f2ca04dbf4aef17585389eff3e"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7c95949560050d04d46b919301826525597f07b33beba6187d04fa64d47ac82e"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5fc1de20b2d4a061b3df27ab9b7c7111e9a710f10dc2b84d33a4ab25065994ec"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c74880fc64d4958159fbd537a091d2a585448a8f8508bf248d72112723974cbd"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:742a76a12aa45b44d236815d282b03cfb1de3b4323f3e4ec933acfae08e54ade"}, - {file = "coverage-7.4.4-cp39-cp39-win32.whl", hash = "sha256:d89d7b2974cae412400e88f35d86af72208e1ede1a541954af5d944a8ba46c57"}, - {file = "coverage-7.4.4-cp39-cp39-win_amd64.whl", hash = "sha256:9ca28a302acb19b6af89e90f33ee3e1906961f94b54ea37de6737b7ca9d8827c"}, - {file = "coverage-7.4.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:b2c5edc4ac10a7ef6605a966c58929ec6c1bd0917fb8c15cb3363f65aa40e677"}, - {file = "coverage-7.4.4.tar.gz", hash = "sha256:c901df83d097649e257e803be22592aedfd5182f07b3cc87d640bbb9afd50f49"}, + {file = "coverage-7.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0884920835a033b78d1c73b6d3bbcda8161a900f38a488829a83982925f6c2e"}, + {file = "coverage-7.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:39afcd3d4339329c5f58de48a52f6e4e50f6578dd6099961cf22228feb25f38f"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a7b0ceee8147444347da6a66be737c9d78f3353b0681715b668b72e79203e4a"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a9ca3f2fae0088c3c71d743d85404cec8df9be818a005ea065495bedc33da35"}, + {file = "coverage-7.5.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd215c0c7d7aab005221608a3c2b46f58c0285a819565887ee0b718c052aa4e"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4bf0655ab60d754491004a5efd7f9cccefcc1081a74c9ef2da4735d6ee4a6223"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:61c4bf1ba021817de12b813338c9be9f0ad5b1e781b9b340a6d29fc13e7c1b5e"}, + {file = "coverage-7.5.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:db66fc317a046556a96b453a58eced5024af4582a8dbdc0c23ca4dbc0d5b3146"}, + {file = "coverage-7.5.1-cp310-cp310-win32.whl", hash = "sha256:b016ea6b959d3b9556cb401c55a37547135a587db0115635a443b2ce8f1c7228"}, + {file = "coverage-7.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:df4e745a81c110e7446b1cc8131bf986157770fa405fe90e15e850aaf7619bc8"}, + {file = "coverage-7.5.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:796a79f63eca8814ca3317a1ea443645c9ff0d18b188de470ed7ccd45ae79428"}, + {file = "coverage-7.5.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4fc84a37bfd98db31beae3c2748811a3fa72bf2007ff7902f68746d9757f3746"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6175d1a0559986c6ee3f7fccfc4a90ecd12ba0a383dcc2da30c2b9918d67d8a3"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fc81d5878cd6274ce971e0a3a18a8803c3fe25457165314271cf78e3aae3aa2"}, + {file = "coverage-7.5.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:556cf1a7cbc8028cb60e1ff0be806be2eded2daf8129b8811c63e2b9a6c43bca"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9981706d300c18d8b220995ad22627647be11a4276721c10911e0e9fa44c83e8"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d7fed867ee50edf1a0b4a11e8e5d0895150e572af1cd6d315d557758bfa9c057"}, + {file = "coverage-7.5.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ef48e2707fb320c8f139424a596f5b69955a85b178f15af261bab871873bb987"}, + {file = "coverage-7.5.1-cp311-cp311-win32.whl", hash = "sha256:9314d5678dcc665330df5b69c1e726a0e49b27df0461c08ca12674bcc19ef136"}, + {file = "coverage-7.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:5fa567e99765fe98f4e7d7394ce623e794d7cabb170f2ca2ac5a4174437e90dd"}, + {file = "coverage-7.5.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b6cf3764c030e5338e7f61f95bd21147963cf6aa16e09d2f74f1fa52013c1206"}, + {file = "coverage-7.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ec92012fefebee89a6b9c79bc39051a6cb3891d562b9270ab10ecfdadbc0c34"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:16db7f26000a07efcf6aea00316f6ac57e7d9a96501e990a36f40c965ec7a95d"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:beccf7b8a10b09c4ae543582c1319c6df47d78fd732f854ac68d518ee1fb97fa"}, + {file = "coverage-7.5.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8748731ad392d736cc9ccac03c9845b13bb07d020a33423fa5b3a36521ac6e4e"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7352b9161b33fd0b643ccd1f21f3a3908daaddf414f1c6cb9d3a2fd618bf2572"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:7a588d39e0925f6a2bff87154752481273cdb1736270642aeb3635cb9b4cad07"}, + {file = "coverage-7.5.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:68f962d9b72ce69ea8621f57551b2fa9c70509af757ee3b8105d4f51b92b41a7"}, + {file = "coverage-7.5.1-cp312-cp312-win32.whl", hash = "sha256:f152cbf5b88aaeb836127d920dd0f5e7edff5a66f10c079157306c4343d86c19"}, + {file = "coverage-7.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:5a5740d1fb60ddf268a3811bcd353de34eb56dc24e8f52a7f05ee513b2d4f596"}, + {file = "coverage-7.5.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e2213def81a50519d7cc56ed643c9e93e0247f5bbe0d1247d15fa520814a7cd7"}, + {file = "coverage-7.5.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5037f8fcc2a95b1f0e80585bd9d1ec31068a9bcb157d9750a172836e98bc7a90"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c3721c2c9e4c4953a41a26c14f4cef64330392a6d2d675c8b1db3b645e31f0e"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca498687ca46a62ae590253fba634a1fe9836bc56f626852fb2720f334c9e4e5"}, + {file = "coverage-7.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0cdcbc320b14c3e5877ee79e649677cb7d89ef588852e9583e6b24c2e5072661"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:57e0204b5b745594e5bc14b9b50006da722827f0b8c776949f1135677e88d0b8"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fe7502616b67b234482c3ce276ff26f39ffe88adca2acf0261df4b8454668b4"}, + {file = "coverage-7.5.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9e78295f4144f9dacfed4f92935fbe1780021247c2fabf73a819b17f0ccfff8d"}, + {file = "coverage-7.5.1-cp38-cp38-win32.whl", hash = "sha256:1434e088b41594baa71188a17533083eabf5609e8e72f16ce8c186001e6b8c41"}, + {file = "coverage-7.5.1-cp38-cp38-win_amd64.whl", hash = "sha256:0646599e9b139988b63704d704af8e8df7fa4cbc4a1f33df69d97f36cb0a38de"}, + {file = "coverage-7.5.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4cc37def103a2725bc672f84bd939a6fe4522310503207aae4d56351644682f1"}, + {file = "coverage-7.5.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fc0b4d8bfeabd25ea75e94632f5b6e047eef8adaed0c2161ada1e922e7f7cece"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d0a0f5e06881ecedfe6f3dd2f56dcb057b6dbeb3327fd32d4b12854df36bf26"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9735317685ba6ec7e3754798c8871c2f49aa5e687cc794a0b1d284b2389d1bd5"}, + {file = "coverage-7.5.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d21918e9ef11edf36764b93101e2ae8cc82aa5efdc7c5a4e9c6c35a48496d601"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c3e757949f268364b96ca894b4c342b41dc6f8f8b66c37878aacef5930db61be"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:79afb6197e2f7f60c4824dd4b2d4c2ec5801ceb6ba9ce5d2c3080e5660d51a4f"}, + {file = "coverage-7.5.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d1d0d98d95dd18fe29dc66808e1accf59f037d5716f86a501fc0256455219668"}, + {file = "coverage-7.5.1-cp39-cp39-win32.whl", hash = "sha256:1cc0fe9b0b3a8364093c53b0b4c0c2dd4bb23acbec4c9240b5f284095ccf7981"}, + {file = "coverage-7.5.1-cp39-cp39-win_amd64.whl", hash = "sha256:dde0070c40ea8bb3641e811c1cfbf18e265d024deff6de52c5950677a8fb1e0f"}, + {file = "coverage-7.5.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:6537e7c10cc47c595828b8a8be04c72144725c383c4702703ff4e42e44577312"}, + {file = "coverage-7.5.1.tar.gz", hash = "sha256:54de9ef3a9da981f7af93eafde4ede199e0846cd819eb27c88e2b712aae9708c"}, ] [package.dependencies] @@ -234,13 +234,13 @@ profile = ["gprof2dot (>=2022.7.29)"] [[package]] name = "exceptiongroup" -version = "1.2.0" +version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, ] [package.extras] @@ -394,38 +394,38 @@ files = [ [[package]] name = "mypy" -version = "1.9.0" +version = "1.10.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f8a67616990062232ee4c3952f41c779afac41405806042a8126fe96e098419f"}, - {file = "mypy-1.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d357423fa57a489e8c47b7c85dfb96698caba13d66e086b412298a1a0ea3b0ed"}, - {file = "mypy-1.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49c87c15aed320de9b438ae7b00c1ac91cd393c1b854c2ce538e2a72d55df150"}, - {file = "mypy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:48533cdd345c3c2e5ef48ba3b0d3880b257b423e7995dada04248725c6f77374"}, - {file = "mypy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:4d3dbd346cfec7cb98e6cbb6e0f3c23618af826316188d587d1c1bc34f0ede03"}, - {file = "mypy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:653265f9a2784db65bfca694d1edd23093ce49740b2244cde583aeb134c008f3"}, - {file = "mypy-1.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3a3c007ff3ee90f69cf0a15cbcdf0995749569b86b6d2f327af01fd1b8aee9dc"}, - {file = "mypy-1.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2418488264eb41f69cc64a69a745fad4a8f86649af4b1041a4c64ee61fc61129"}, - {file = "mypy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:68edad3dc7d70f2f17ae4c6c1b9471a56138ca22722487eebacfd1eb5321d612"}, - {file = "mypy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:85ca5fcc24f0b4aeedc1d02f93707bccc04733f21d41c88334c5482219b1ccb3"}, - {file = "mypy-1.9.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aceb1db093b04db5cd390821464504111b8ec3e351eb85afd1433490163d60cd"}, - {file = "mypy-1.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0235391f1c6f6ce487b23b9dbd1327b4ec33bb93934aa986efe8a9563d9349e6"}, - {file = "mypy-1.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d4d5ddc13421ba3e2e082a6c2d74c2ddb3979c39b582dacd53dd5d9431237185"}, - {file = "mypy-1.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:190da1ee69b427d7efa8aa0d5e5ccd67a4fb04038c380237a0d96829cb157913"}, - {file = "mypy-1.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:fe28657de3bfec596bbeef01cb219833ad9d38dd5393fc649f4b366840baefe6"}, - {file = "mypy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e54396d70be04b34f31d2edf3362c1edd023246c82f1730bbf8768c28db5361b"}, - {file = "mypy-1.9.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5e6061f44f2313b94f920e91b204ec600982961e07a17e0f6cd83371cb23f5c2"}, - {file = "mypy-1.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81a10926e5473c5fc3da8abb04119a1f5811a236dc3a38d92015cb1e6ba4cb9e"}, - {file = "mypy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b685154e22e4e9199fc95f298661deea28aaede5ae16ccc8cbb1045e716b3e04"}, - {file = "mypy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:5d741d3fc7c4da608764073089e5f58ef6352bedc223ff58f2f038c2c4698a89"}, - {file = "mypy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:587ce887f75dd9700252a3abbc9c97bbe165a4a630597845c61279cf32dfbf02"}, - {file = "mypy-1.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f88566144752999351725ac623471661c9d1cd8caa0134ff98cceeea181789f4"}, - {file = "mypy-1.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61758fabd58ce4b0720ae1e2fea5cfd4431591d6d590b197775329264f86311d"}, - {file = "mypy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e49499be624dead83927e70c756970a0bc8240e9f769389cdf5714b0784ca6bf"}, - {file = "mypy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:571741dc4194b4f82d344b15e8837e8c5fcc462d66d076748142327626a1b6e9"}, - {file = "mypy-1.9.0-py3-none-any.whl", hash = "sha256:a260627a570559181a9ea5de61ac6297aa5af202f06fd7ab093ce74e7181e43e"}, - {file = "mypy-1.9.0.tar.gz", hash = "sha256:3cc5da0127e6a478cddd906068496a97a7618a21ce9b54bde5bf7e539c7af974"}, + {file = "mypy-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:da1cbf08fb3b851ab3b9523a884c232774008267b1f83371ace57f412fe308c2"}, + {file = "mypy-1.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:12b6bfc1b1a66095ab413160a6e520e1dc076a28f3e22f7fb25ba3b000b4ef99"}, + {file = "mypy-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e36fb078cce9904c7989b9693e41cb9711e0600139ce3970c6ef814b6ebc2b2"}, + {file = "mypy-1.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2b0695d605ddcd3eb2f736cd8b4e388288c21e7de85001e9f85df9187f2b50f9"}, + {file = "mypy-1.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:cd777b780312ddb135bceb9bc8722a73ec95e042f911cc279e2ec3c667076051"}, + {file = "mypy-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3be66771aa5c97602f382230165b856c231d1277c511c9a8dd058be4784472e1"}, + {file = "mypy-1.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8b2cbaca148d0754a54d44121b5825ae71868c7592a53b7292eeb0f3fdae95ee"}, + {file = "mypy-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ec404a7cbe9fc0e92cb0e67f55ce0c025014e26d33e54d9e506a0f2d07fe5de"}, + {file = "mypy-1.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e22e1527dc3d4aa94311d246b59e47f6455b8729f4968765ac1eacf9a4760bc7"}, + {file = "mypy-1.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:a87dbfa85971e8d59c9cc1fcf534efe664d8949e4c0b6b44e8ca548e746a8d53"}, + {file = "mypy-1.10.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a781f6ad4bab20eef8b65174a57e5203f4be627b46291f4589879bf4e257b97b"}, + {file = "mypy-1.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b808e12113505b97d9023b0b5e0c0705a90571c6feefc6f215c1df9381256e30"}, + {file = "mypy-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f55583b12156c399dce2df7d16f8a5095291354f1e839c252ec6c0611e86e2e"}, + {file = "mypy-1.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4cf18f9d0efa1b16478c4c129eabec36148032575391095f73cae2e722fcf9d5"}, + {file = "mypy-1.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:bc6ac273b23c6b82da3bb25f4136c4fd42665f17f2cd850771cb600bdd2ebeda"}, + {file = "mypy-1.10.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9fd50226364cd2737351c79807775136b0abe084433b55b2e29181a4c3c878c0"}, + {file = "mypy-1.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f90cff89eea89273727d8783fef5d4a934be2fdca11b47def50cf5d311aff727"}, + {file = "mypy-1.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fcfc70599efde5c67862a07a1aaf50e55bce629ace26bb19dc17cece5dd31ca4"}, + {file = "mypy-1.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:075cbf81f3e134eadaf247de187bd604748171d6b79736fa9b6c9685b4083061"}, + {file = "mypy-1.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:3f298531bca95ff615b6e9f2fc0333aae27fa48052903a0ac90215021cdcfa4f"}, + {file = "mypy-1.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa7ef5244615a2523b56c034becde4e9e3f9b034854c93639adb667ec9ec2976"}, + {file = "mypy-1.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3236a4c8f535a0631f85f5fcdffba71c7feeef76a6002fcba7c1a8e57c8be1ec"}, + {file = "mypy-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a2b5cdbb5dd35aa08ea9114436e0d79aceb2f38e32c21684dcf8e24e1e92821"}, + {file = "mypy-1.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92f93b21c0fe73dc00abf91022234c79d793318b8a96faac147cd579c1671746"}, + {file = "mypy-1.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:28d0e038361b45f099cc086d9dd99c15ff14d0188f44ac883010e172ce86c38a"}, + {file = "mypy-1.10.0-py3-none-any.whl", hash = "sha256:f8c083976eb530019175aabadb60921e73b4f45736760826aa1689dda8208aee"}, + {file = "mypy-1.10.0.tar.gz", hash = "sha256:3d087fcbec056c4ee34974da493a826ce316947485cef3901f511848e687c131"}, ] [package.dependencies] @@ -463,28 +463,29 @@ files = [ [[package]] name = "platformdirs" -version = "4.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.2.2" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, - {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +type = ["mypy (>=1.8)"] [[package]] name = "pluggy" -version = "1.4.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ - {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, - {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] [package.extras] @@ -504,17 +505,17 @@ files = [ [[package]] name = "pylint" -version = "3.1.0" +version = "3.2.0" description = "python code static checker" optional = false python-versions = ">=3.8.0" files = [ - {file = "pylint-3.1.0-py3-none-any.whl", hash = "sha256:507a5b60953874766d8a366e8e8c7af63e058b26345cfcb5f91f89d987fd6b74"}, - {file = "pylint-3.1.0.tar.gz", hash = "sha256:6a69beb4a6f63debebaab0a3477ecd0f559aa726af4954fc948c51f7a2549e23"}, + {file = "pylint-3.2.0-py3-none-any.whl", hash = "sha256:9f20c05398520474dac03d7abb21ab93181f91d4c110e1e0b32bc0d016c34fa4"}, + {file = "pylint-3.2.0.tar.gz", hash = "sha256:ad8baf17c8ea5502f23ae38d7c1b7ec78bd865ce34af9a0b986282e2611a8ff2"}, ] [package.dependencies] -astroid = ">=3.1.0,<=3.2.0-dev0" +astroid = ">=3.2.0,<=3.3.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, @@ -700,13 +701,13 @@ files = [ [[package]] name = "tomlkit" -version = "0.12.4" +version = "0.12.5" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" files = [ - {file = "tomlkit-0.12.4-py3-none-any.whl", hash = "sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b"}, - {file = "tomlkit-0.12.4.tar.gz", hash = "sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3"}, + {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, + {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 81c7fc7..2a3b7be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "python-lokalise-api" -version = "2.2.0" +version = "2.3.0" description = "Official Python interface for the Lokalise API v2" authors = ["Ilya Krukowski "] readme = "README.md" diff --git a/tests/cassettes/branches_test/test_all_branches_pagination.yaml b/tests/cassettes/branches_test/test_all_branches_pagination.yaml index 70513e9..01062ef 100644 --- a/tests/cassettes/branches_test/test_all_branches_pagination.yaml +++ b/tests/cassettes/branches_test/test_all_branches_pagination.yaml @@ -4,39 +4,36 @@ interactions: headers: Accept: - application/json - Accept-Encoding: - - gzip, deflate Connection: - keep-alive User-Agent: - - python-lokalise-api plugin/0.0.1 + - python-lokalise-api plugin/2.1.1 x-api-token: - FILTERED method: GET - uri: https://api.lokalise.com/api2/projects/454087345e09f3e7e7eae3.57891254/branches?page=2&limit=1 + uri: https://api.lokalise.com/api2/projects/2273827860c1e2473eb195.11207948/branches?page=2&limit=1 response: body: - string: '{"project_id":"454087345e09f3e7e7eae3.57891254","branch":"master","branches":[{"branch_id":45845,"name":"master","created_at":"2019-12-30 - 12:56:07 (Etc\/UTC)","created_at_timestamp":1577710567,"created_by":20181,"created_by_email":"bodrovis@protonmail.com"}]}' + string: '{"project_id":"2273827860c1e2473eb195.11207948","branch":"master","branches":[{"branch_id":362586,"name":"demo","created_at":"2023-11-20 + 19:04:57 (Etc\/UTC)","created_at_timestamp":1700507097,"created_by":20181,"created_by_email":"bodrovis@protonmail.com"}]}' headers: - Access-Control-Allow-Headers: - - Content-Type - Access-Control-Allow-Origin: - - '*' Cache-Control: - - max-age=0, must-revalidate, no-cache, no-store, private + - max-age=-172799, must-revalidate, no-cache, no-store, private Connection: - keep-alive Content-Type: - application/json Date: - - Thu, 18 Jun 2020 11:18:41 GMT + - Wed, 15 May 2024 11:18:28 GMT Expires: - - Thu, 18 Jun 2020 11:18:41 GMT - Pragma: - - no-cache + - Fri, 17 May 2024 11:18:27 GMT + Referrer-Policy: + - origin Server: - nginx + Set-Cookie: + - PHPSESSID=deleted; expires=Tue, 16-May-2023 11:18:27 GMT; Max-Age=0; path=/; + httponly Strict-Transport-Security: - max-age=31536000 Transfer-Encoding: @@ -47,18 +44,20 @@ interactions: - nosniff X-Frame-Options: - deny + X-Lokalise-Process-Id: + - 6b47b661-500a-4115-af9b-543cdde665d2 X-Pagination-Limit: - '1' X-Pagination-Page: - '2' X-Pagination-Page-Count: - - '1' + - '4' X-Pagination-Total-Count: - - '1' + - '4' X-XSS-Protection: - 1; mode=block - content-length: - - '259' + pragma: + - no-cache status: code: 200 message: OK diff --git a/tests/cassettes/keys_test/test_keys_cursor.yaml b/tests/cassettes/keys_test/test_keys_cursor.yaml new file mode 100644 index 0000000..9205bc8 --- /dev/null +++ b/tests/cassettes/keys_test/test_keys_cursor.yaml @@ -0,0 +1,68 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Connection: + - keep-alive + User-Agent: + - python-lokalise-api plugin/2.1.1 + x-api-token: + - FILTERED + method: GET + uri: https://api.lokalise.com/api2/projects/2273827860c1e2473eb195.11207948/keys?disable_references=1&limit=2&pagination=cursor&cursor=eyIxIjo0NDU5NjA2MX0%3D + response: + body: + string: '{"project_id":"2273827860c1e2473eb195.11207948","branch":"master","keys":[{"key_id":94981678,"created_at":"2021-06-10 + 09:59:09 (Etc\/UTC)","created_at_timestamp":1623319149,"key_name":{"ios":"f986261c453f5e38fc1c390b4d903b63765aed86","android":"f986261c453f5e38fc1c390b4d903b63765aed86","web":"f986261c453f5e38fc1c390b4d903b63765aed86","other":"f986261c453f5e38fc1c390b4d903b63765aed86"},"filenames":{"ios":"","android":"","web":"messages.%LANG_ISO%.xlf","other":""},"description":"","platforms":["web"],"tags":[],"is_plural":false,"plural_name":"","is_hidden":false,"is_archived":true,"context":"ng2.template","base_words":2,"char_limit":0,"custom_attributes":"{\"datatype\": + \"html\", \"context-groups\": [{\"purpose\": \"location\", \"contexts\": [{\"value\": + \"src\/app\/home\/home.component.html\", \"context-type\": \"sourcefile\"}, + {\"value\": \"21\", \"context-type\": \"linenumber\"}]}]}","modified_at":"2022-12-15 + 13:15:58 (Etc\/UTC)","modified_at_timestamp":1671110158,"translations_modified_at":"2023-05-24 + 12:10:16 (Etc\/UTC)","translations_modified_at_timestamp":1684930216},{"key_id":255985710,"created_at":"2022-12-27 + 19:26:12 (Etc\/UTC)","created_at_timestamp":1672169172,"key_name":{"ios":"your_order","android":"your_order","web":"your_order","other":"your_order"},"filenames":{"ios":"","android":"%LANG_ISO%.xml","web":"%LANG_ISO%.json","other":""},"description":"","platforms":["android","web"],"tags":[],"is_plural":false,"plural_name":"","is_hidden":false,"is_archived":true,"context":"","base_words":3,"char_limit":0,"custom_attributes":"","modified_at":"2023-02-13 + 10:47:24 (Etc\/UTC)","modified_at_timestamp":1676285244,"translations_modified_at":"2023-05-24 + 12:10:16 (Etc\/UTC)","translations_modified_at_timestamp":1684930216}]}' + headers: + Cache-Control: + - max-age=-172800, must-revalidate, no-cache, no-store, private + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Wed, 15 May 2024 11:25:21 GMT + Expires: + - Fri, 17 May 2024 11:25:21 GMT + Referrer-Policy: + - origin + Server: + - nginx + Set-Cookie: + - PHPSESSID=deleted; expires=Tue, 16-May-2023 11:25:20 GMT; Max-Age=0; path=/; + httponly + Strict-Transport-Security: + - max-age=31536000 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - deny + X-Lokalise-Process-Id: + - 520fe42e-326d-4d46-8de2-c8973b1ccd51 + X-Pagination-Limit: + - '2' + X-Pagination-Next-Cursor: + - eyIxIjoyNTU5ODU3MTB9 + X-XSS-Protection: + - 1; mode=block + pragma: + - no-cache + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/translations_test/test_translations_pagination_cursor.yaml b/tests/cassettes/translations_test/test_translations_pagination_cursor.yaml new file mode 100644 index 0000000..7ce6416 --- /dev/null +++ b/tests/cassettes/translations_test/test_translations_pagination_cursor.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Connection: + - keep-alive + User-Agent: + - python-lokalise-api plugin/2.1.1 + x-api-token: + - FILTERED + method: GET + uri: https://api.lokalise.com/api2/projects/803826145ba90b42d5d860.46800099/translations?limit=2&disable_references=1&filter_untranslated=1&pagination=cursor&cursor=eyIxIjozMDQ1ODEyMTJ9 + response: + body: + string: '{"project_id":"803826145ba90b42d5d860.46800099","branch":"master","translations":[{"translation_id":304581213,"segment_number":1,"key_id":44596059,"language_iso":"sq","translation":"","modified_by":20181,"modified_by_email":"bodrovis@protonmail.com","modified_at":"2023-09-22 + 16:23:59 (Etc\/UTC)","modified_at_timestamp":1695399839,"is_reviewed":false,"reviewed_by":0,"is_unverified":true,"is_fuzzy":true,"words":0,"custom_translation_statuses":[],"task_id":null},{"translation_id":304581223,"segment_number":1,"key_id":44596060,"language_iso":"ar_001","translation":"{\"zero\":\"\",\"one\":\"\",\"two\":\"\",\"few\":\"\",\"many\":\"\",\"other\":\"\"}","modified_by":20181,"modified_by_email":"bodrovis@protonmail.com","modified_at":"2020-05-11 + 11:20:33 (Etc\/UTC)","modified_at_timestamp":1589196033,"is_reviewed":false,"reviewed_by":0,"is_unverified":true,"is_fuzzy":true,"words":0,"custom_translation_statuses":[],"task_id":null}]}' + headers: + Cache-Control: + - max-age=-172800, must-revalidate, no-cache, no-store, private + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Wed, 15 May 2024 11:30:19 GMT + Expires: + - Fri, 17 May 2024 11:30:19 GMT + Referrer-Policy: + - origin + Server: + - nginx + Set-Cookie: + - PHPSESSID=deleted; expires=Tue, 16-May-2023 11:30:18 GMT; Max-Age=0; path=/; + httponly + Strict-Transport-Security: + - max-age=31536000 + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - deny + X-Lokalise-Process-Id: + - 556a9602-6878-4a97-90ee-0271bf22793f + X-Pagination-Limit: + - '2' + X-Pagination-Next-Cursor: + - eyIxIjozMDQ1ODEyMjN9 + X-XSS-Protection: + - 1; mode=block + pragma: + - no-cache + status: + code: 200 + message: OK +version: 1 diff --git a/tests/client/branches_test.py b/tests/client/branches_test.py index 8ce17a8..c0767d2 100644 --- a/tests/client/branches_test.py +++ b/tests/client/branches_test.py @@ -5,6 +5,7 @@ import pytest PROJECT_ID = "454087345e09f3e7e7eae3.57891254" +PROJECT_ID2 = "2273827860c1e2473eb195.11207948" BRANCH_ID = 55312 NEW_BRANCH_ID = 66307 @@ -22,19 +23,18 @@ def test_all_branches(client): def test_all_branches_pagination(client): """Tests fetching of all branches with pagination params """ - branches = client.branches(PROJECT_ID, {"page": 2, "limit": 1}) - assert branches.project_id == PROJECT_ID - assert branches.items[0].branch_id == 45845 - # revise these tests once ITSD-854 is resolved + branches = client.branches(PROJECT_ID2, {"page": 2, "limit": 1}) + assert branches.project_id == PROJECT_ID2 + assert branches.items[0].branch_id == 362586 assert branches.current_page == 2 - assert branches.total_count == 1 - assert branches.page_count == 1 + assert branches.total_count == 4 + assert branches.page_count == 4 assert branches.limit == 1 - # assert branches.is_last_page() - # assert branches.is_first_page() - # assert not branches.has_next_page() - # assert not branches.has_prev_page() + assert not branches.is_last_page() + assert not branches.is_first_page() + assert branches.has_next_page() + assert branches.has_prev_page() @pytest.mark.vcr diff --git a/tests/client/keys_test.py b/tests/client/keys_test.py index 11608b2..42a4d4c 100644 --- a/tests/client/keys_test.py +++ b/tests/client/keys_test.py @@ -5,6 +5,7 @@ import pytest PROJECT_ID = "454087345e09f3e7e7eae3.57891254" +PROJECT_ID2 = "2273827860c1e2473eb195.11207948" KEY_ID = 34089721 @@ -29,7 +30,30 @@ def test_keys(client): assert not keys.is_first_page() assert keys.has_next_page() assert keys.has_prev_page() + assert not keys.has_next_cursor() + assert keys.next_cursor is None +@pytest.mark.vcr +def test_keys_cursor(client): + """Tests fetching of keys with cursor + """ + keys = client.keys(PROJECT_ID2, { + "disable_references": "1", + "limit": 2, + "pagination": "cursor", + "cursor": "eyIxIjo0NDU5NjA2MX0=" + }) + assert keys.project_id == PROJECT_ID2 + assert keys.items[0].key_id == 94981678 + assert keys.current_page == 0 + assert keys.total_count == 0 + assert keys.page_count == 0 + assert keys.limit == 2 + assert keys.next_cursor == "eyIxIjoyNTU5ODU3MTB9" + + assert keys.has_next_cursor() + assert not keys.has_next_page() + assert not keys.has_prev_page() @pytest.mark.vcr def test_create_keys(client): diff --git a/tests/client/translations_test.py b/tests/client/translations_test.py index 16f6bea..e6b49d6 100644 --- a/tests/client/translations_test.py +++ b/tests/client/translations_test.py @@ -36,12 +36,34 @@ def test_translations_pagination(client): assert translations.total_count == 21 assert translations.page_count == 5 assert translations.limit == 5 + assert translations.next_cursor is None assert not translations.is_last_page() + assert not translations.has_next_cursor() assert not translations.is_first_page() assert translations.has_next_page() assert translations.has_prev_page() +@pytest.mark.vcr +def test_translations_pagination_cursor(client): + """Tests fetching of all translations with pagination and cursor + """ + translations = client.translations(ANOTHER_PROJECT_ID, { + "limit": 2, + "disable_references": "1", + "filter_untranslated": 1, + "pagination": "cursor", + "cursor": "eyIxIjozMDQ1ODEyMTJ9" + }) + assert translations.project_id == ANOTHER_PROJECT_ID + assert translations.items[0].translation_id == 304581213 + assert translations.current_page == 0 + assert translations.total_count == 0 + assert translations.page_count == 0 + assert translations.limit == 2 + assert translations.next_cursor == "eyIxIjozMDQ1ODEyMjN9" + + assert translations.has_next_cursor() @pytest.mark.vcr def test_translation(client):