From dc553c823639494cb454c7e4ad6926c104d5b918 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 18:25:43 -0400 Subject: [PATCH 1/9] add openapi config file and set name of package in it --- config.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 config.yaml diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..5ee5a99 --- /dev/null +++ b/config.yaml @@ -0,0 +1,2 @@ +packageName: kagi_client +projectName: kagi-client From 7656f20d58fd046361e394cca50b01b9402c9066 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 18:26:03 -0400 Subject: [PATCH 2/9] add `make generate` command and have it use the config file --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..edf01bf --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +SPEC_URL := https://kagi.redocly.app/_spec/openapi.yaml + +generate: + openapi-generator-cli generate \ + -i $(SPEC_URL) \ + -g python \ + -o . \ + -c config.yaml From 92e959e5560b78e9d4f71985b114e7ae10c05827 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 18:26:29 -0400 Subject: [PATCH 3/9] generate --- .github/workflows/python.yml | 4 +- .gitlab-ci.yml | 2 +- .openapi-generator/FILES | 78 +++++++------------ .openapi-generator/VERSION | 2 +- .travis.yml | 2 +- README.md | 24 +++--- docs/ErrorDetail.md | 2 +- docs/ErrorEnvelope.md | 2 +- docs/ExtractApi.md | 18 ++--- docs/ExtractRequest.md | 2 +- docs/ExtractResponse.md | 2 +- docs/Meta.md | 2 +- docs/PageInput.md | 2 +- docs/PageOutput.md | 2 +- docs/Search200Response.md | 2 +- docs/Search200ResponseData.md | 2 +- docs/SearchApi.md | 18 ++--- docs/SearchRequest.md | 2 +- docs/SearchRequestExtract.md | 2 +- docs/SearchRequestFilters.md | 2 +- docs/SearchRequestLens.md | 2 +- docs/SearchRequestPersonalizations.md | 2 +- ...archRequestPersonalizationsDomainsInner.md | 2 +- ...archRequestPersonalizationsRegexesInner.md | 2 +- docs/SearchResult.md | 2 +- docs/SearchResultImage.md | 2 +- git_push.sh | 4 +- pyproject.toml | 8 +- setup.py | 4 +- tox.ini | 2 +- 30 files changed, 91 insertions(+), 111 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b17065b..758cda1 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -3,7 +3,7 @@ # # ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: openapi_client Python package +name: kagi_client Python package on: [push, pull_request] @@ -31,4 +31,4 @@ jobs: pip install -r test-requirements.txt - name: Test with pytest run: | - pytest --cov=openapi_client + pytest --cov=kagi_client diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c03684..729d6cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ stages: script: - pip install -r requirements.txt - pip install -r test-requirements.txt - - pytest --cov=openapi_client + - pytest --cov=kagi_client pytest-3.10: extends: .pytest diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index cce0926..6223f15 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -24,59 +24,39 @@ docs/SearchRequestPersonalizationsRegexesInner.md docs/SearchResult.md docs/SearchResultImage.md git_push.sh -openapi_client/__init__.py -openapi_client/api/__init__.py -openapi_client/api/extract_api.py -openapi_client/api/search_api.py -openapi_client/api_client.py -openapi_client/api_response.py -openapi_client/configuration.py -openapi_client/exceptions.py -openapi_client/models/__init__.py -openapi_client/models/error_detail.py -openapi_client/models/error_envelope.py -openapi_client/models/extract_request.py -openapi_client/models/extract_response.py -openapi_client/models/meta.py -openapi_client/models/page_input.py -openapi_client/models/page_output.py -openapi_client/models/search200_response.py -openapi_client/models/search200_response_data.py -openapi_client/models/search_request.py -openapi_client/models/search_request_extract.py -openapi_client/models/search_request_filters.py -openapi_client/models/search_request_lens.py -openapi_client/models/search_request_personalizations.py -openapi_client/models/search_request_personalizations_domains_inner.py -openapi_client/models/search_request_personalizations_regexes_inner.py -openapi_client/models/search_result.py -openapi_client/models/search_result_image.py -openapi_client/py.typed -openapi_client/rest.py +kagi_client/__init__.py +kagi_client/api/__init__.py +kagi_client/api/extract_api.py +kagi_client/api/search_api.py +kagi_client/api_client.py +kagi_client/api_response.py +kagi_client/configuration.py +kagi_client/exceptions.py +kagi_client/models/__init__.py +kagi_client/models/error_detail.py +kagi_client/models/error_envelope.py +kagi_client/models/extract_request.py +kagi_client/models/extract_response.py +kagi_client/models/meta.py +kagi_client/models/page_input.py +kagi_client/models/page_output.py +kagi_client/models/search200_response.py +kagi_client/models/search200_response_data.py +kagi_client/models/search_request.py +kagi_client/models/search_request_extract.py +kagi_client/models/search_request_filters.py +kagi_client/models/search_request_lens.py +kagi_client/models/search_request_personalizations.py +kagi_client/models/search_request_personalizations_domains_inner.py +kagi_client/models/search_request_personalizations_regexes_inner.py +kagi_client/models/search_result.py +kagi_client/models/search_result_image.py +kagi_client/py.typed +kagi_client/rest.py pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_error_detail.py -test/test_error_envelope.py -test/test_extract_api.py -test/test_extract_request.py -test/test_extract_response.py -test/test_meta.py -test/test_page_input.py -test/test_page_output.py -test/test_search200_response.py -test/test_search200_response_data.py -test/test_search_api.py -test/test_search_request.py -test/test_search_request_extract.py -test/test_search_request_filters.py -test/test_search_request_lens.py -test/test_search_request_personalizations.py -test/test_search_request_personalizations_domains_inner.py -test/test_search_request_personalizations_regexes_inner.py -test/test_search_result.py -test/test_search_result_image.py tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index f7962df..696eaac 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.22.0-SNAPSHOT +7.22.0 diff --git a/.travis.yml b/.travis.yml index a58e1c9..c987764 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" # command to run tests -script: pytest --cov=openapi_client +script: pytest --cov=kagi_client diff --git a/README.md b/README.md index a43f841..d35b570 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# openapi-client +# kagi-client The Kagi API provides programmatic access to data that powers our search results & more. Get started on the [API Dashboard](https://kagi.com/api) to set up billing, manage API keys, and more. @@ -41,7 +41,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1 - Package version: 1.0.0 -- Generator version: 7.22.0-SNAPSHOT +- Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://kagi.com/support](https://kagi.com/support) @@ -55,13 +55,13 @@ Python 3.10+ If the python package is hosted on a repository, you can install directly using: ```sh -pip install git+https://github.com/kagisearch/kagi-openapi-python.git +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kagisearch/kagi-openapi-python.git`) +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) Then import the package: ```python -import openapi_client +import kagi_client ``` ### Setuptools @@ -75,7 +75,7 @@ python setup.py install --user Then import the package: ```python -import openapi_client +import kagi_client ``` ### Tests @@ -88,13 +88,13 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import openapi_client -from openapi_client.rest import ApiException +import kagi_client +from kagi_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://kagi.com/api/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( host = "https://kagi.com/api/v1" ) @@ -104,15 +104,15 @@ configuration = openapi_client.Configuration( # satisfies your auth use case. # Configure Bearer authorization: kagi -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with openapi_client.ApiClient(configuration) as api_client: +with kagi_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = openapi_client.ExtractApi(api_client) + api_instance = kagi_client.ExtractApi(api_client) extract_request = {"pages":[{"url":"https://example.com/article1"},{"url":"https://example.com/article2"}],"timeout":1.337,"format":"json"} # ExtractRequest | try: diff --git a/docs/ErrorDetail.md b/docs/ErrorDetail.md index e30569a..873cfe3 100644 --- a/docs/ErrorDetail.md +++ b/docs/ErrorDetail.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.error_detail import ErrorDetail +from kagi_client.models.error_detail import ErrorDetail # TODO update the JSON string below json = "{}" diff --git a/docs/ErrorEnvelope.md b/docs/ErrorEnvelope.md index ef70c67..cd2426e 100644 --- a/docs/ErrorEnvelope.md +++ b/docs/ErrorEnvelope.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.error_envelope import ErrorEnvelope +from kagi_client.models.error_envelope import ErrorEnvelope # TODO update the JSON string below json = "{}" diff --git a/docs/ExtractApi.md b/docs/ExtractApi.md index 6427b27..164c7d6 100644 --- a/docs/ExtractApi.md +++ b/docs/ExtractApi.md @@ -1,4 +1,4 @@ -# openapi_client.ExtractApi +# kagi_client.ExtractApi All URIs are relative to *https://kagi.com/api/v1* @@ -21,15 +21,15 @@ and the extracted content is returned in the response. * Bearer Authentication (kagi): ```python -import openapi_client -from openapi_client.models.extract_request import ExtractRequest -from openapi_client.models.extract_response import ExtractResponse -from openapi_client.rest import ApiException +import kagi_client +from kagi_client.models.extract_request import ExtractRequest +from kagi_client.models.extract_response import ExtractResponse +from kagi_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://kagi.com/api/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( host = "https://kagi.com/api/v1" ) @@ -39,14 +39,14 @@ configuration = openapi_client.Configuration( # satisfies your auth use case. # Configure Bearer authorization: kagi -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with openapi_client.ApiClient(configuration) as api_client: +with kagi_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = openapi_client.ExtractApi(api_client) + api_instance = kagi_client.ExtractApi(api_client) extract_request = {"pages":[{"url":"https://example.com/article1"},{"url":"https://example.com/article2"}],"timeout":1.337,"format":"json"} # ExtractRequest | try: diff --git a/docs/ExtractRequest.md b/docs/ExtractRequest.md index 378f5bc..f1f3b18 100644 --- a/docs/ExtractRequest.md +++ b/docs/ExtractRequest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.extract_request import ExtractRequest +from kagi_client.models.extract_request import ExtractRequest # TODO update the JSON string below json = "{}" diff --git a/docs/ExtractResponse.md b/docs/ExtractResponse.md index 3b80b81..a0c735b 100644 --- a/docs/ExtractResponse.md +++ b/docs/ExtractResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.extract_response import ExtractResponse +from kagi_client.models.extract_response import ExtractResponse # TODO update the JSON string below json = "{}" diff --git a/docs/Meta.md b/docs/Meta.md index 301ec2b..1971339 100644 --- a/docs/Meta.md +++ b/docs/Meta.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.meta import Meta +from kagi_client.models.meta import Meta # TODO update the JSON string below json = "{}" diff --git a/docs/PageInput.md b/docs/PageInput.md index 8ea05c5..9d658b0 100644 --- a/docs/PageInput.md +++ b/docs/PageInput.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.page_input import PageInput +from kagi_client.models.page_input import PageInput # TODO update the JSON string below json = "{}" diff --git a/docs/PageOutput.md b/docs/PageOutput.md index b6e41ea..574028c 100644 --- a/docs/PageOutput.md +++ b/docs/PageOutput.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.page_output import PageOutput +from kagi_client.models.page_output import PageOutput # TODO update the JSON string below json = "{}" diff --git a/docs/Search200Response.md b/docs/Search200Response.md index 8c4fa09..907aada 100644 --- a/docs/Search200Response.md +++ b/docs/Search200Response.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search200_response import Search200Response +from kagi_client.models.search200_response import Search200Response # TODO update the JSON string below json = "{}" diff --git a/docs/Search200ResponseData.md b/docs/Search200ResponseData.md index 576bf08..248902c 100644 --- a/docs/Search200ResponseData.md +++ b/docs/Search200ResponseData.md @@ -28,7 +28,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search200_response_data import Search200ResponseData +from kagi_client.models.search200_response_data import Search200ResponseData # TODO update the JSON string below json = "{}" diff --git a/docs/SearchApi.md b/docs/SearchApi.md index 80e25ec..3bf4544 100644 --- a/docs/SearchApi.md +++ b/docs/SearchApi.md @@ -1,4 +1,4 @@ -# openapi_client.SearchApi +# kagi_client.SearchApi All URIs are relative to *https://kagi.com/api/v1* @@ -17,15 +17,15 @@ Perform a web search * Bearer Authentication (kagi): ```python -import openapi_client -from openapi_client.models.search200_response import Search200Response -from openapi_client.models.search_request import SearchRequest -from openapi_client.rest import ApiException +import kagi_client +from kagi_client.models.search200_response import Search200Response +from kagi_client.models.search_request import SearchRequest +from kagi_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://kagi.com/api/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( host = "https://kagi.com/api/v1" ) @@ -35,14 +35,14 @@ configuration = openapi_client.Configuration( # satisfies your auth use case. # Configure Bearer authorization: kagi -configuration = openapi_client.Configuration( +configuration = kagi_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with openapi_client.ApiClient(configuration) as api_client: +with kagi_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = openapi_client.SearchApi(api_client) + api_instance = kagi_client.SearchApi(api_client) search_request = {"query":"steve jobs","workflow":"search"} # SearchRequest | try: diff --git a/docs/SearchRequest.md b/docs/SearchRequest.md index dc7ba55..df5c8b3 100644 --- a/docs/SearchRequest.md +++ b/docs/SearchRequest.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request import SearchRequest +from kagi_client.models.search_request import SearchRequest # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestExtract.md b/docs/SearchRequestExtract.md index 756b8eb..a46d3ec 100644 --- a/docs/SearchRequestExtract.md +++ b/docs/SearchRequestExtract.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_extract import SearchRequestExtract +from kagi_client.models.search_request_extract import SearchRequestExtract # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestFilters.md b/docs/SearchRequestFilters.md index 28f38be..7784fb6 100644 --- a/docs/SearchRequestFilters.md +++ b/docs/SearchRequestFilters.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_filters import SearchRequestFilters +from kagi_client.models.search_request_filters import SearchRequestFilters # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestLens.md b/docs/SearchRequestLens.md index 5641b53..2668bde 100644 --- a/docs/SearchRequestLens.md +++ b/docs/SearchRequestLens.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_lens import SearchRequestLens +from kagi_client.models.search_request_lens import SearchRequestLens # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestPersonalizations.md b/docs/SearchRequestPersonalizations.md index 80b221c..997a368 100644 --- a/docs/SearchRequestPersonalizations.md +++ b/docs/SearchRequestPersonalizations.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_personalizations import SearchRequestPersonalizations +from kagi_client.models.search_request_personalizations import SearchRequestPersonalizations # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestPersonalizationsDomainsInner.md b/docs/SearchRequestPersonalizationsDomainsInner.md index 5459186..d4d6c0c 100644 --- a/docs/SearchRequestPersonalizationsDomainsInner.md +++ b/docs/SearchRequestPersonalizationsDomainsInner.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_personalizations_domains_inner import SearchRequestPersonalizationsDomainsInner +from kagi_client.models.search_request_personalizations_domains_inner import SearchRequestPersonalizationsDomainsInner # TODO update the JSON string below json = "{}" diff --git a/docs/SearchRequestPersonalizationsRegexesInner.md b/docs/SearchRequestPersonalizationsRegexesInner.md index a9d4806..436a6bf 100644 --- a/docs/SearchRequestPersonalizationsRegexesInner.md +++ b/docs/SearchRequestPersonalizationsRegexesInner.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_request_personalizations_regexes_inner import SearchRequestPersonalizationsRegexesInner +from kagi_client.models.search_request_personalizations_regexes_inner import SearchRequestPersonalizationsRegexesInner # TODO update the JSON string below json = "{}" diff --git a/docs/SearchResult.md b/docs/SearchResult.md index 6a900f2..38f0f5d 100644 --- a/docs/SearchResult.md +++ b/docs/SearchResult.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_result import SearchResult +from kagi_client.models.search_result import SearchResult # TODO update the JSON string below json = "{}" diff --git a/docs/SearchResultImage.md b/docs/SearchResultImage.md index 9081c96..d9db306 100644 --- a/docs/SearchResultImage.md +++ b/docs/SearchResultImage.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from openapi_client.models.search_result_image import SearchResultImage +from kagi_client.models.search_result_image import SearchResultImage # TODO update the JSON string below json = "{}" diff --git a/git_push.sh b/git_push.sh index 94fca37..f53a75d 100644 --- a/git_push.sh +++ b/git_push.sh @@ -14,12 +14,12 @@ if [ "$git_host" = "" ]; then fi if [ "$git_user_id" = "" ]; then - git_user_id="kagisearch" + git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="kagi-openapi-python" + git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/pyproject.toml b/pyproject.toml index 8dc4c4d..f4786d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "openapi_client" +name = "kagi_client" version = "1.0.0" description = "Kagi API" authors = [ @@ -18,7 +18,7 @@ dependencies = [ ] [project.urls] -Repository = "https://github.com/kagisearch/kagi-openapi-python" +Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" [tool.poetry] requires-poetry = ">=2.0" @@ -41,7 +41,7 @@ extension-pkg-whitelist = "pydantic" [tool.mypy] files = [ - "openapi_client", + "kagi_client", #"test", # auto-generated tests "tests", # hand-written tests ] @@ -79,7 +79,7 @@ disallow_any_generics = true [[tool.mypy.overrides]] module = [ - "openapi_client.configuration", + "kagi_client.configuration", ] warn_unused_ignores = true strict_equality = true diff --git a/setup.py b/setup.py index c018b0b..4fa2774 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -NAME = "openapi-client" +NAME = "kagi-client" VERSION = "1.0.0" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ @@ -45,5 +45,5 @@ long_description="""\ The Kagi API provides programmatic access to data that powers our search results & more. Get started on the [API Dashboard](https://kagi.com/api) to set up billing, manage API keys, and more. ### Official Client Libraries We offer the following libraries you can use to interact with the Kagi API. These are generated from an OpenAPI spec. If you have a language you would like to use and it's not in the list, send us a message and we will add it to the list if it is supported. Or you can use the [spec](https://kagi.redocly.app/_spec/openapi.yaml?download) to build your own custom library. - [Golang](https://github.com/kagisearch/kagi-openapi-golang) - [Python](https://github.com/kagisearch/kagi-openapi-python) - [TypeScript](https://github.com/kagisearch/kagi-openapi-typescript) - [Rust](https://github.com/kagisearch/kagi-openapi-rust) ### API Status **The v1 API is currently in preview to early access testers.** Our existing API, the \"v0\" beta API, is being replaced with a new version that will be available publicly soon. As changes are made, we will be updating the documentation below when the new features become available. See the [Support and Community](https://help.kagi.com/kagi/support-and-community/) section for details. ### Pricing See our [API Pricing](https://kagi.com/api/pricing) page for standard rates. ### GitHub Discussions This is the preferred venue for bug reports and feature requests. - [Bug Reports](https://github.com/kagisearch/kagi-docs/issues/new/choose) - [Q&A Forum](https://github.com/kagisearch/kagi-docs/discussions/categories/q-a?discussions_q=category%3AQ%26A+label%3Aproduct%3Akagi_search_api) - [API Feature Requests](https://github.com/kagisearch/kagi-docs/discussions/categories/kagi-search-api-feature-requests-ideas) ### Discord Join our [Discord](https://kagi.com/discord)! Good for quick questions or chatting about things you've made with our APIs! """, # noqa: E501 - package_data={"openapi_client": ["py.typed"]}, + package_data={"kagi_client": ["py.typed"]}, ) diff --git a/tox.ini b/tox.ini index 1a9028b..6dd08b5 100644 --- a/tox.ini +++ b/tox.ini @@ -6,4 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - pytest --cov=openapi_client + pytest --cov=kagi_client From f71daa9ef71c2780472a84716698515428e7b370 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 19:09:50 -0400 Subject: [PATCH 4/9] add userid and repo id --- README.md | 4 ++-- config.yaml | 2 ++ git_push.sh | 4 ++-- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d35b570..af763a7 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,9 @@ Python 3.10+ If the python package is hosted on a repository, you can install directly using: ```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +pip install git+https://github.com/kagisearch/kagi-openapi-python.git ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kagisearch/kagi-openapi-python.git`) Then import the package: ```python diff --git a/config.yaml b/config.yaml index 5ee5a99..06493c9 100644 --- a/config.yaml +++ b/config.yaml @@ -1,2 +1,4 @@ packageName: kagi_client projectName: kagi-client +gitUserId: kagisearch +gitRepoId: kagi-openapi-python diff --git a/git_push.sh b/git_push.sh index f53a75d..94fca37 100644 --- a/git_push.sh +++ b/git_push.sh @@ -14,12 +14,12 @@ if [ "$git_host" = "" ]; then fi if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" + git_user_id="kagisearch" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" + git_repo_id="kagi-openapi-python" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi diff --git a/pyproject.toml b/pyproject.toml index f4786d6..12a4c10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ ] [project.urls] -Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +Repository = "https://github.com/kagisearch/kagi-openapi-python" [tool.poetry] requires-poetry = ">=2.0" From cc8c7faa7beed54e03281323c383eb0f7a472712 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 19:24:35 -0400 Subject: [PATCH 5/9] set version to 1.0.0rc1 as prerelease --- README.md | 2 +- config.yaml | 1 + pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af763a7..95449d6 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Join our [Discord](https://kagi.com/discord)! Good for quick questions or chatti This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1 -- Package version: 1.0.0 +- Package version: 1.0.0rc1 - Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://kagi.com/support](https://kagi.com/support) diff --git a/config.yaml b/config.yaml index 06493c9..ce047c7 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,5 @@ packageName: kagi_client projectName: kagi-client +packageVersion: 1.0.0rc1 gitUserId: kagisearch gitRepoId: kagi-openapi-python diff --git a/pyproject.toml b/pyproject.toml index 12a4c10..2443daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kagi_client" -version = "1.0.0" +version = "1.0.0rc1" description = "Kagi API" authors = [ {name = "API Support",email = "support@kagi.com"}, diff --git a/setup.py b/setup.py index 4fa2774..81c9a8e 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "kagi-client" -VERSION = "1.0.0" +VERSION = "1.0.0rc1" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", From b79c47cef2115864df7d24adbdd892f2479df3f5 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 19:34:12 -0400 Subject: [PATCH 6/9] add pypi instructions to readme through mustache to use with openapi --- Makefile | 3 ++- README.md | 19 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index edf01bf..919bb71 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,5 @@ generate: -i $(SPEC_URL) \ -g python \ -o . \ - -c config.yaml + -c config.yaml \ + -t templates/ diff --git a/README.md b/README.md index 95449d6..fc90957 100644 --- a/README.md +++ b/README.md @@ -50,28 +50,27 @@ For more information, please visit [https://kagi.com/support](https://kagi.com/s Python 3.10+ ## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: +### PyPI ```sh -pip install git+https://github.com/kagisearch/kagi-openapi-python.git +pip install kagi-client ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kagisearch/kagi-openapi-python.git`) + +> **Note:** If you're installing a prerelease version, add the `--pre` flag: +> ```sh +> pip install --pre kagi-client +> ``` Then import the package: ```python import kagi_client ``` -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). +### From source ```sh -python setup.py install --user +pip install git+https://github.com/kagisearch/kagi-openapi-python.git ``` -(or `sudo python setup.py install` to install the package for all users) Then import the package: ```python From b1934a9839cfe8481f7d805e8ccc871f8ce71e5b Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 19:59:14 -0400 Subject: [PATCH 7/9] bump --- README.md | 2 +- config.yaml | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc90957..b6d4070 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Join our [Discord](https://kagi.com/discord)! Good for quick questions or chatti This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1 -- Package version: 1.0.0rc1 +- Package version: 1.0.0rc2 - Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://kagi.com/support](https://kagi.com/support) diff --git a/config.yaml b/config.yaml index ce047c7..755601c 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ packageName: kagi_client projectName: kagi-client -packageVersion: 1.0.0rc1 +packageVersion: 1.0.0rc2 gitUserId: kagisearch gitRepoId: kagi-openapi-python diff --git a/pyproject.toml b/pyproject.toml index 2443daa..aa54aaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kagi_client" -version = "1.0.0rc1" +version = "1.0.0rc2" description = "Kagi API" authors = [ {name = "API Support",email = "support@kagi.com"}, diff --git a/setup.py b/setup.py index 81c9a8e..f231803 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "kagi-client" -VERSION = "1.0.0rc1" +VERSION = "1.0.0rc2" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", From 38f0ca09de6c347c93711bd056bc7e1b8b51f9ea Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 20:04:26 -0400 Subject: [PATCH 8/9] add pypi publish github action --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3df18ff --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish to PyPI + +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + + - run: uv build + + - run: uv publish + env: + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} From 584f4c8ad7bb1b5d6cbc12c1d78b1d5499ac4960 Mon Sep 17 00:00:00 2001 From: Rehan Date: Wed, 13 May 2026 20:09:13 -0400 Subject: [PATCH 9/9] another bump --- README.md | 2 +- config.yaml | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6d4070..326f8f9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Join our [Discord](https://kagi.com/discord)! Good for quick questions or chatti This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1 -- Package version: 1.0.0rc2 +- Package version: 1.0.0rc3 - Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://kagi.com/support](https://kagi.com/support) diff --git a/config.yaml b/config.yaml index 755601c..ebf488c 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ packageName: kagi_client projectName: kagi-client -packageVersion: 1.0.0rc2 +packageVersion: 1.0.0rc3 gitUserId: kagisearch gitRepoId: kagi-openapi-python diff --git a/pyproject.toml b/pyproject.toml index aa54aaa..aa566fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kagi_client" -version = "1.0.0rc2" +version = "1.0.0rc3" description = "Kagi API" authors = [ {name = "API Support",email = "support@kagi.com"}, diff --git a/setup.py b/setup.py index f231803..6754a6b 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "kagi-client" -VERSION = "1.0.0rc2" +VERSION = "1.0.0rc3" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0",