Skip to content
Open
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
841f6b8
chore(internal): fix ruff target version
stainless-app[bot] Aug 6, 2025
5be621c
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
affca4a
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
c606559
chore(internal): codegen related update
stainless-app[bot] Aug 12, 2025
623da5a
chore: update github action
stainless-app[bot] Aug 22, 2025
0cc1cdf
chore(internal): change ci workflow machines
stainless-app[bot] Aug 26, 2025
8be2d00
fix: avoid newer type syntax
stainless-app[bot] Aug 27, 2025
f52b313
chore(internal): update pyright exclude list
stainless-app[bot] Aug 27, 2025
59172cd
chore(internal): add Sequence related utils
stainless-app[bot] Aug 30, 2025
ac97bcc
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 3, 2025
8673889
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 4, 2025
8c3c148
chore(internal): move mypy configurations to `pyproject.toml` file
stainless-app[bot] Sep 5, 2025
e80b9a7
chore(tests): simplify `get_platform` test
stainless-app[bot] Sep 6, 2025
ea4f37d
codegen metadata
stainless-app[bot] Sep 10, 2025
fd7ed5b
chore(internal): update pydantic dependency
stainless-app[bot] Sep 17, 2025
e140d77
chore(types): change optional parameter type from NotGiven to Omit
stainless-app[bot] Sep 19, 2025
a676ec0
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 20, 2025
f735ee0
chore(internal): codegen related update
stainless-app[bot] Oct 11, 2025
9917d18
chore(internal): codegen related update
stainless-app[bot] Oct 18, 2025
9da362b
chore(internal): codegen related update
stainless-app[bot] Oct 30, 2025
9e5bd44
chore(internal): codegen related update
stainless-app[bot] Oct 31, 2025
2f6c5f3
chore(internal): codegen related update
stainless-app[bot] Nov 4, 2025
6a7e464
chore(internal): codegen related update
stainless-app[bot] Nov 11, 2025
2a90cac
chore(internal): codegen related update
stainless-app[bot] Nov 12, 2025
921466d
chore(internal): codegen related update
stainless-app[bot] Nov 22, 2025
21a1828
chore(internal): codegen related update
stainless-app[bot] Nov 28, 2025
324d8ba
codegen metadata
stainless-app[bot] Dec 2, 2025
f30af77
chore(internal): codegen related update
stainless-app[bot] Dec 3, 2025
4a1a767
chore(internal): codegen related update
stainless-app[bot] Dec 9, 2025
a456de9
chore(internal): codegen related update
stainless-app[bot] Dec 16, 2025
fcd6dff
chore(internal): codegen related update
stainless-app[bot] Dec 17, 2025
16d5c84
chore(internal): codegen related update
stainless-app[bot] Dec 18, 2025
a1d208a
chore(internal): codegen related update
stainless-app[bot] Dec 19, 2025
2b9f07b
chore(internal): codegen related update
stainless-app[bot] Jan 1, 2026
864e7f4
release: 0.6.0
stainless-app[bot] Jan 1, 2026
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
run: ./scripts/lint

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

Expand All @@ -61,12 +61,14 @@ jobs:
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/nextbillion-sdk-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/nextbillion-sdk-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
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 @@
{
".": "0.5.1"
".": "0.6.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 95
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nextbillion-ai%2Fnextbillion-sdk-b647f1808dda89d18a6340cee497eca5248f6f7d0172dfcf903a6361a1261013.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/nextbillion-ai%2Fnextbillion-sdk-3b1c8d82ae3012f3c367f77f3524f52e1bd00bbdcb8e94b9148a7ad17dfdec86.yml
openapi_spec_hash: 6af51daccd4c91b5d04f71c45dbc31d8
config_hash: 297ad5b2a79da3c4bae12d9bce4efcc7
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Changelog

## 0.6.0 (2026-01-01)

Full Changelog: [v0.5.1...v0.6.0](https://github.com/nextbillion-ai/nextbillion-sdk-python/compare/v0.5.1...v0.6.0)

### Features

* improve future compat with pydantic v3 ([8673889](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/86738898fdc5c9a72a4b933398f2dbe013b038d6))
* **types:** replace List[str] with SequenceNotStr in params ([ac97bcc](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/ac97bcc961a56515cfc8848ada4eb321f0446c63))


### Bug Fixes

* avoid newer type syntax ([8be2d00](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/8be2d006207d7891b8fdf6a2a8985b5107e66137))


### Chores

* do not install brew dependencies in ./scripts/bootstrap by default ([a676ec0](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/a676ec08499f24939b3c69b6d398e703a7f51143))
* **internal:** add Sequence related utils ([59172cd](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/59172cd255e31005a12c28c411d28af93d774a11))
* **internal:** change ci workflow machines ([0cc1cdf](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/0cc1cdff89de3c7453b781a567d5853ac2d6dbb6))
* **internal:** codegen related update ([2b9f07b](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/2b9f07b6d35ed7b3da76adbd31d8dcd687fb8416))
* **internal:** codegen related update ([a1d208a](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/a1d208af82a5d77a224cce412016088e1c03e433))
* **internal:** codegen related update ([16d5c84](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/16d5c8449a6de9f71ac5e726893f6f4485dc1805))
* **internal:** codegen related update ([fcd6dff](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/fcd6dff8d60e3cdc989727e6a0502e4c7bfd5371))
* **internal:** codegen related update ([a456de9](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/a456de96ce398e197294b9c2b6a6ee0e0c4d0a67))
* **internal:** codegen related update ([4a1a767](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/4a1a76794f9f1b4b775dc8db3f8184377c84a9f7))
* **internal:** codegen related update ([f30af77](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/f30af773d2ccdc6a9bc60bbaf0719fd7343597d4))
* **internal:** codegen related update ([21a1828](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/21a1828acd1d5509dbf6b22bfc1f4bb46b70de9b))
* **internal:** codegen related update ([921466d](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/921466dcbb63bbd803a43405da40c41b5f993376))
* **internal:** codegen related update ([2a90cac](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/2a90cac3860464206e1061da69da2cf0086ac037))
* **internal:** codegen related update ([6a7e464](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/6a7e464b26e8176db0ba6a62bf101f82f58dc5c5))
* **internal:** codegen related update ([2f6c5f3](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/2f6c5f3383dd081bb4bf619880e610f54cb13479))
* **internal:** codegen related update ([9e5bd44](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/9e5bd4484a2738f20363c0ba5b729ff9e6d1a2c2))
* **internal:** codegen related update ([9da362b](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/9da362bf226d118fbba85093fe623aca94e4ed73))
* **internal:** codegen related update ([9917d18](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/9917d185f532fcbf06e56803b4cf7848b84eed7b))
* **internal:** codegen related update ([f735ee0](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/f735ee00e0765848f9e9346294eaf04e80a3a1fd))
* **internal:** codegen related update ([c606559](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/c606559c6b779b8ba98f1d60adb981f294fd04e2))
* **internal:** fix ruff target version ([841f6b8](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/841f6b83607d1fbc81fd7760d01ad48f2c6efb83))
* **internal:** move mypy configurations to `pyproject.toml` file ([8c3c148](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/8c3c148d136fd0541c4ef1ce1cafd28f39512cf0))
* **internal:** update comment in script ([affca4a](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/affca4a54c56578021aa4fe0ba4c43cb1d4b3c14))
* **internal:** update pydantic dependency ([fd7ed5b](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/fd7ed5b1b53ed3502ab1874621719f000398023b))
* **internal:** update pyright exclude list ([f52b313](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/f52b313f51371fcb984383806a94b09a3e28e988))
* **tests:** simplify `get_platform` test ([e80b9a7](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/e80b9a7726b0736e33539db461449522179510ab))
* **types:** change optional parameter type from NotGiven to Omit ([e140d77](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/e140d77f0549af65b3ca81528a6ad2e8d13fe144))
* update @stainless-api/prism-cli to v5.15.0 ([5be621c](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/5be621cd6a883137ec3c379c1a64e6a12b9be1ea))
* update github action ([623da5a](https://github.com/nextbillion-ai/nextbillion-sdk-python/commit/623da5a8f4e690185e66bb10060d6ae5c09fa7b2))

## 0.5.1 (2025-08-06)

Full Changelog: [v0.5.0...v0.5.1](https://github.com/nextbillion-ai/nextbillion-sdk-python/compare/v0.5.0...v0.5.1)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Nextbillion SDK
Copyright 2026 Nextbillion SDK

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/nextbillionai.svg?label=pypi%20(stable))](https://pypi.org/project/nextbillionai/)

The Nextbillion SDK Python library provides convenient access to the Nextbillion SDK REST API from any Python 3.8+
The Nextbillion SDK Python library provides convenient access to the Nextbillion SDK REST API from any Python 3.9+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

Expand Down Expand Up @@ -85,14 +85,15 @@ pip install nextbillionai[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from nextbillionai import DefaultAioHttpClient
from nextbillionai import AsyncNextbillionSDK


async def main() -> None:
async with AsyncNextbillionSDK(
api_key="My API Key",
api_key=os.environ.get("NEXTBILLION_SDK_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
response = await client.directions.compute_route(
Expand Down Expand Up @@ -404,7 +405,7 @@ print(nextbillionai.__version__)

## Requirements

Python 3.8 or higher.
Python 3.9 or higher.

## Contributing

Expand Down
50 changes: 0 additions & 50 deletions mypy.ini

This file was deleted.

86 changes: 72 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
[project]
name = "nextbillionai"
version = "0.5.1"
version = "0.6.0"
description = "The official Python library for the nextbillion-sdk API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
{ name = "Nextbillion SDK", email = "yun@nextbillion.ai" },
]

dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
]
requires-python = ">= 3.8"

requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -39,14 +41,14 @@ Homepage = "https://github.com/nextbillion-ai/nextbillion-sdk-python"
Repository = "https://github.com/nextbillion-ai/nextbillion-sdk-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]

[tool.rye]
managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright==1.1.399",
"mypy",
"mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
Expand All @@ -56,7 +58,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

Expand Down Expand Up @@ -142,12 +143,13 @@ filterwarnings = [
# there are a couple of flags that are still disabled by
# default in strict mode as they are experimental and niche.
typeCheckingMode = "strict"
pythonVersion = "3.8"
pythonVersion = "3.9"

exclude = [
"_dev",
".venv",
".nox",
".git",
]

reportImplicitOverride = true
Expand All @@ -156,10 +158,62 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false

[tool.mypy]
pretty = true
show_error_codes = true

# Exclude _files.py because mypy isn't smart enough to apply
# the correct type narrowing and as this is an internal module
# it's fine to just use Pyright.
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/nextbillionai/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
check_untyped_defs = true
no_implicit_optional = true

warn_return_any = true
warn_unreachable = true
warn_unused_configs = true

# Turn these options off as it could cause conflicts
# with the Pyright options.
warn_unused_ignores = false
warn_redundant_casts = false

disallow_any_generics = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
cache_fine_grained = true

# By default, mypy reports an error if you assign a value to the result
# of a function call that doesn't return anything. We do this in our test
# cases:
# ```
# result = ...
# assert result is None
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = "func-returns-value,overload-cannot-match"

# https://github.com/python/mypy/issues/12162
[[tool.mypy.overrides]]
module = "black.files.*"
ignore_errors = true
ignore_missing_imports = true


[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand All @@ -172,6 +226,8 @@ select = [
"B",
# remove unused imports
"F401",
# check for missing future annotations
"FA102",
# bare except statements
"E722",
# unused arguments
Expand All @@ -194,6 +250,8 @@ unfixable = [
"T203",
]

extend-safe-fixes = ["FA102"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"

Expand Down
Loading
Loading