Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
65ea7c5
chore(internal): codegen related update
stainless-app[bot] May 28, 2025
7d673d4
fix(docs/api): remove references to nonexistent types
stainless-app[bot] May 28, 2025
e003bb1
codegen metadata
stainless-app[bot] May 28, 2025
4d3aa06
codegen metadata
stainless-app[bot] May 29, 2025
c9bd905
codegen metadata
stainless-app[bot] May 30, 2025
9fc4749
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 3, 2025
d2875f3
chore(docs): remove unnecessary param examples
stainless-app[bot] Jun 3, 2025
b22320b
feat(client): add follow_redirects request option
stainless-app[bot] Jun 3, 2025
d7a73bc
feat(api): api update
stainless-app[bot] Jun 3, 2025
652a957
codegen metadata
stainless-app[bot] Jun 6, 2025
9d9d65e
chore(tests): run tests in parallel
stainless-app[bot] Jun 13, 2025
03552e7
fix(pagination): correct next page check
stainless-app[bot] Jun 13, 2025
5568773
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 13, 2025
c620e09
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 17, 2025
f06435d
chore(internal): update conftest.py
stainless-app[bot] Jun 17, 2025
a6636e7
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
bc28102
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
3036c4b
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
482e328
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
292b89e
feat(client): add support for aiohttp
stainless-app[bot] Jun 21, 2025
188abef
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
71f15b7
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
f5756ca
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
b23a053
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
bef0279
codegen metadata
stainless-app[bot] Jun 30, 2025
267f707
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
c281941
chore(internal): codegen related update
stainless-app[bot] Jul 8, 2025
cb54577
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 9, 2025
e1a20f7
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
5fcaeb7
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 10, 2025
e05e6e5
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 11, 2025
41feabc
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 12, 2025
6002d27
feat: clean up environment call outs
stainless-app[bot] Jul 15, 2025
cf653ef
feat(api): add test set api
stainless-app[bot] Jul 19, 2025
b8f0491
release: 5.5.0
stainless-app[bot] Jul 19, 2025
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
26 changes: 23 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/asktable-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -30,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/asktable-python'
build:
if: github.repository == 'stainless-sdks/asktable-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand All @@ -58,6 +77,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/asktable-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.4.0"
".": "5.5.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 96
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-fd9a749a4afed8a45757ab4e83984c36c56cf6f4f0d53b80d4d5e0022869c3e1.yml
openapi_spec_hash: d5cf0471c4e715bdfbf597de3f591ef1
config_hash: a572ab842ea60ce13f1d1a1358440cbe
configured_endpoints: 107
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-420512609e3f9f33f8a5b2d0086d4d3152b78935f1dc689cf4c5adf245241ba8.yml
openapi_spec_hash: a0055c3c329900b7a66dc27f4bea86cb
config_hash: acdf4142177ed1932c2d82372693f811
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 5.5.0 (2025-07-19)

Full Changelog: [v5.4.0...v5.5.0](https://github.com/DataMini/asktable-python/compare/v5.4.0...v5.5.0)

### Features

* **api:** add test set api ([cf653ef](https://github.com/DataMini/asktable-python/commit/cf653ef0d527894151c209f7eb79b120e8d7109c))
* **api:** api update ([d7a73bc](https://github.com/DataMini/asktable-python/commit/d7a73bceb38896da2565dd7e1ae8a3e39529a685))
* clean up environment call outs ([6002d27](https://github.com/DataMini/asktable-python/commit/6002d277b7004e7fdd69f8b23572cf84a6cf10da))
* **client:** add follow_redirects request option ([b22320b](https://github.com/DataMini/asktable-python/commit/b22320bad43f0de89af6d252c36902b2cd08ec97))
* **client:** add support for aiohttp ([292b89e](https://github.com/DataMini/asktable-python/commit/292b89e54d3215237251f84ebbae97d4cbf65310))


### Bug Fixes

* **ci:** correct conditional ([b23a053](https://github.com/DataMini/asktable-python/commit/b23a0530daffe5b27939e7ab9516790f6fb36a7b))
* **ci:** release-doctor — report correct token name ([71f15b7](https://github.com/DataMini/asktable-python/commit/71f15b7d055dafd7aabb993d5ca0f6ca33707620))
* **client:** correctly parse binary response | stream ([5568773](https://github.com/DataMini/asktable-python/commit/5568773fc1b6ee7a5183cd5e6789ce6eafe119e8))
* **client:** don't send Content-Type header on GET requests ([41feabc](https://github.com/DataMini/asktable-python/commit/41feabcb23fb5c257d18ba7f96f0ddb9304d53d5))
* **docs/api:** remove references to nonexistent types ([7d673d4](https://github.com/DataMini/asktable-python/commit/7d673d44b295a507ca08ff0982cc5e033893e3d3))
* **pagination:** correct next page check ([03552e7](https://github.com/DataMini/asktable-python/commit/03552e74ca1fa48289b48381777b1243398777bc))
* **parsing:** correctly handle nested discriminated unions ([5fcaeb7](https://github.com/DataMini/asktable-python/commit/5fcaeb76ff37258c12becb7e459a3cfa56988fc0))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([3036c4b](https://github.com/DataMini/asktable-python/commit/3036c4bdbe59cd13bdfacdd113478e3e6ddd8ca0))


### Chores

* **ci:** change upload type ([267f707](https://github.com/DataMini/asktable-python/commit/267f707806319c9b4499046f286f891a985d22de))
* **ci:** enable for pull requests ([a6636e7](https://github.com/DataMini/asktable-python/commit/a6636e7b8409f7750b52c4850f05be437e4ed31d))
* **ci:** only run for pushes and fork pull requests ([f5756ca](https://github.com/DataMini/asktable-python/commit/f5756ca55464cba7219498f0fcf0786d299fdc7d))
* **docs:** remove reference to rye shell ([9fc4749](https://github.com/DataMini/asktable-python/commit/9fc4749e8965d398f281078e14f0249d12571ace))
* **docs:** remove unnecessary param examples ([d2875f3](https://github.com/DataMini/asktable-python/commit/d2875f3438404557c839e0d158a2e573c3607f1f))
* **internal:** bump pinned h11 dep ([cb54577](https://github.com/DataMini/asktable-python/commit/cb545771166f525600c876d70e6ca9af74aada7f))
* **internal:** codegen related update ([c281941](https://github.com/DataMini/asktable-python/commit/c28194157b0e93b082fc5c441528a4bdc0640c00))
* **internal:** codegen related update ([65ea7c5](https://github.com/DataMini/asktable-python/commit/65ea7c536f5fe17dfb13666bf7e37f25bf470bd9))
* **internal:** update conftest.py ([f06435d](https://github.com/DataMini/asktable-python/commit/f06435ded63522ac7f30d47b560183b86e95ef27))
* **package:** mark python 3.13 as supported ([e1a20f7](https://github.com/DataMini/asktable-python/commit/e1a20f7a5f7ce9dee0d182c2addc5fcf8b4342ae))
* **readme:** fix version rendering on pypi ([e05e6e5](https://github.com/DataMini/asktable-python/commit/e05e6e562cfddd5ef7b3ee27a2a155e0e8305e6c))
* **readme:** update badges ([bc28102](https://github.com/DataMini/asktable-python/commit/bc281028397ea60d93f86ea563e3e9cba303b0c6))
* **tests:** add tests for httpx client instantiation & proxies ([c620e09](https://github.com/DataMini/asktable-python/commit/c620e09f4be03fabc31167839018e69b8d7f5d7b))
* **tests:** run tests in parallel ([9d9d65e](https://github.com/DataMini/asktable-python/commit/9d9d65e5be80faba732cd2d29854186ff565b4c7))
* **tests:** skip some failing tests on the latest python versions ([188abef](https://github.com/DataMini/asktable-python/commit/188abef74adcaf1c5b8b4ee8b39315aba98c7f95))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([482e328](https://github.com/DataMini/asktable-python/commit/482e328e4938b04c3eca656984857d2ffc302fa3))

## 5.4.0 (2025-05-27)

Full Changelog: [v5.3.1...v5.4.0](https://github.com/DataMini/asktable-python/compare/v5.3.1...v5.4.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
53 changes: 45 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Asktable Python API library

[![PyPI version](https://img.shields.io/pypi/v/asktable.svg)](https://pypi.org/project/asktable/)
<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/asktable.svg?label=pypi%20(stable))](https://pypi.org/project/asktable/)

The Asktable Python library provides convenient access to the Asktable REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand All @@ -24,9 +25,12 @@ pip install asktable
The full API of this library can be found in [api.md](api.md).

```python
import os
from asktable import Asktable

client = Asktable()
client = Asktable(
api_key=os.environ.get("ASKTABLE_API_KEY"), # This is the default and can be omitted
)

datasource = client.datasources.create(
engine="mysql",
Expand All @@ -44,10 +48,13 @@ so that your API Key is not stored in source control.
Simply import `AsyncAsktable` instead of `Asktable` and use `await` with each API call:

```python
import os
import asyncio
from asktable import AsyncAsktable

client = AsyncAsktable()
client = AsyncAsktable(
api_key=os.environ.get("ASKTABLE_API_KEY"), # This is the default and can be omitted
)


async def main() -> None:
Expand All @@ -62,6 +69,39 @@ asyncio.run(main())

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install asktable[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import asyncio
from asktable import DefaultAioHttpClient
from asktable import AsyncAsktable


async def main() -> None:
async with AsyncAsktable(
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
datasource = await client.datasources.create(
engine="mysql",
)
print(datasource.id)


asyncio.run(main())
```

## Using types

Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
Expand Down Expand Up @@ -145,10 +185,7 @@ client = Asktable()

response = client.sys.projects.api_keys.create_token(
project_id="project_id",
chat_role={
"role_id": "1",
"role_variables": {"id": "42"},
},
chat_role={},
)
print(response.chat_role)
```
Expand Down Expand Up @@ -240,7 +277,7 @@ client.with_options(max_retries=5).datasources.create(
### Timeouts

By default requests time out after 5 minutes. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from asktable import Asktable
Expand Down
Loading