Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -31,4 +31,4 @@ jobs:
pip install -r test-requirements.txt
- name: Test with pytest
run: |
pytest --cov=openapi_client
pytest --cov=kagi_client
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
78 changes: 29 additions & 49 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.22.0-SNAPSHOT
7.22.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SPEC_URL := https://kagi.redocly.app/_spec/openapi.yaml

generate:
openapi-generator-cli generate \
-i $(SPEC_URL) \
-g python \
-o . \
-c config.yaml \
-t templates/
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -40,8 +40,8 @@ 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
- Generator version: 7.22.0-SNAPSHOT
- 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)

Expand All @@ -50,32 +50,31 @@ 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 openapi_client
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
import openapi_client
import kagi_client
```

### Tests
Expand All @@ -88,13 +87,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"
)

Expand All @@ -104,15 +103,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:
Expand Down
5 changes: 5 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packageName: kagi_client
projectName: kagi-client
packageVersion: 1.0.0rc3
gitUserId: kagisearch
gitRepoId: kagi-openapi-python
2 changes: 1 addition & 1 deletion docs/ErrorDetail.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/ErrorEnvelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
18 changes: 9 additions & 9 deletions docs/ExtractApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openapi_client.ExtractApi
# kagi_client.ExtractApi

All URIs are relative to *https://kagi.com/api/v1*

Expand All @@ -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"
)

Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/ExtractRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/ExtractResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/Meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/PageInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/PageOutput.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/Search200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
2 changes: 1 addition & 1 deletion docs/Search200ResponseData.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "{}"
Expand Down
Loading
Loading