Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c8610fe
chore(docs): grammar improvements
stainless-app[bot] May 21, 2025
7cd8d1b
chore(api): mark some methods as deprecated
stainless-app[bot] May 28, 2025
3375bf9
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 2, 2025
35e3181
feat(client): add follow_redirects request option
stainless-app[bot] Jun 2, 2025
843f8ef
feat(client): adds support for 3DS to Auth Rules
stainless-app[bot] Jun 3, 2025
9fec4b1
feat(client): adds endpoint to register an account number on a Financ…
stainless-app[bot] Jun 9, 2025
62bce48
chore(tests): run tests in parallel
stainless-app[bot] Jun 12, 2025
1c23f45
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 12, 2025
5b5cda3
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 16, 2025
3607c50
chore(internal): update conftest.py
stainless-app[bot] Jun 16, 2025
b9b15ca
feat(api): add CLOSED account state option and UNVERIFIED verificatio…
stainless-app[bot] Jun 16, 2025
96f3f23
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
5a08ed9
chore(readme): update badges
stainless-app[bot] Jun 17, 2025
6fbce26
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 17, 2025
6df47f4
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 18, 2025
b675627
feat(client): add support for aiohttp
stainless-app[bot] Jun 20, 2025
5cd166b
codegen metadata
stainless-app[bot] Jun 20, 2025
45e57bc
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 23, 2025
cb8a569
release: 0.94.0
stainless-app[bot] Jun 23, 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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
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.93.0"
".": "0.94.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: 160
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-025f40c854a9485cf316c9058f9cc5fa37f069add30e409d49ab93f2e166f4fb.yml
openapi_spec_hash: a9391f3a54b8db5d5df40169de8c645c
config_hash: fa3481d1d8505e4157f6cebe93211bd0
configured_endpoints: 161
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-67859c948e3b903a317f4bd14135c7ee44254d2760068117bab34b7c4058be71.yml
openapi_spec_hash: 23a4716c6168e96f040ac8575582d075
config_hash: 227ad54062905d4ae964b24cef0505b0
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.94.0 (2025-06-23)

Full Changelog: [v0.93.0...v0.94.0](https://github.com/lithic-com/lithic-python/compare/v0.93.0...v0.94.0)

### Features

* **api:** add CLOSED account state option and UNVERIFIED verification method ([b9b15ca](https://github.com/lithic-com/lithic-python/commit/b9b15ca5320605b194b8ac12a9b7a476b6c90027))
* **client:** add follow_redirects request option ([35e3181](https://github.com/lithic-com/lithic-python/commit/35e31812c2b8c7a1ff943ec7eccc8496d5dd923e))
* **client:** add support for aiohttp ([b675627](https://github.com/lithic-com/lithic-python/commit/b675627fd898667a17e37ed036c0a7a1ba4b9d9b))
* **client:** adds endpoint to register an account number on a Financial Account ([9fec4b1](https://github.com/lithic-com/lithic-python/commit/9fec4b13649f8e8ca11733ed0f9a3d8dc7034834))
* **client:** adds support for 3DS to Auth Rules ([843f8ef](https://github.com/lithic-com/lithic-python/commit/843f8ef3ef8c09643a2179531886c4b0fecbd325))


### Bug Fixes

* **client:** correctly parse binary response | stream ([1c23f45](https://github.com/lithic-com/lithic-python/commit/1c23f4513b0fe2d7578844f08da8684bb56e449b))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([6fbce26](https://github.com/lithic-com/lithic-python/commit/6fbce267364552f360519cd6c58c7cbf324d99de))


### Chores

* **api:** mark some methods as deprecated ([7cd8d1b](https://github.com/lithic-com/lithic-python/commit/7cd8d1b5a8afcc9754a0c703d0c975999be958f4))
* **ci:** enable for pull requests ([96f3f23](https://github.com/lithic-com/lithic-python/commit/96f3f2381da359a7c9db41db9b2988d9b731063c))
* **docs:** grammar improvements ([c8610fe](https://github.com/lithic-com/lithic-python/commit/c8610fed4efbb18a63cabbe75596d001922bce29))
* **docs:** remove reference to rye shell ([3375bf9](https://github.com/lithic-com/lithic-python/commit/3375bf9b3fc3aaf2349e8c68e310472390339fb1))
* **internal:** update conftest.py ([3607c50](https://github.com/lithic-com/lithic-python/commit/3607c50cf548acd5fa4587b2e86f6b93fbc924aa))
* **readme:** update badges ([5a08ed9](https://github.com/lithic-com/lithic-python/commit/5a08ed9d58d64d3998a5837b37f8db71a47951c4))
* **tests:** add tests for httpx client instantiation & proxies ([5b5cda3](https://github.com/lithic-com/lithic-python/commit/5b5cda365c0c6cbf1a6c440c02c8fd5f71915d24))
* **tests:** run tests in parallel ([62bce48](https://github.com/lithic-com/lithic-python/commit/62bce4878f34851b7f3e7938e6f702ac176b278a))
* **tests:** skip some failing tests on the latest python versions ([45e57bc](https://github.com/lithic-com/lithic-python/commit/45e57bc33bafb6c2dd7f14d492ee3265c37b8cc2))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([6df47f4](https://github.com/lithic-com/lithic-python/commit/6df47f4032acaab9c51f29193b8114885dffbcc6))

## 0.93.0 (2025-05-15)

Full Changelog: [v0.92.0...v0.93.0](https://github.com/lithic-com/lithic-python/compare/v0.92.0...v0.93.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
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lithic Python API library

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

The Lithic Python library provides convenient access to the Lithic REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -70,6 +70,40 @@ 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 lithic[aiohttp]
```

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

```python
import os
import asyncio
from lithic import DefaultAioHttpClient
from lithic import AsyncLithic


async def main() -> None:
async with AsyncLithic(
api_key=os.environ.get("LITHIC_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
card = await client.cards.create(
type="SINGLE_USE",
)
print(card.token)


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 @@ -234,7 +268,7 @@ client.with_options(max_retries=5).cards.list(
### Timeouts

By default requests time out after 1 minute. 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 lithic import Lithic
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Lithic please follow the respective company's security reporting guidelines.
or products provided by Lithic, please follow the respective company's security reporting guidelines.

### Lithic Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.
Please contact [email protected] for any questions or concerns regarding the security of our services.

---

Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ Methods:
- <code title="get /v1/financial_accounts/{financial_account_token}">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">retrieve</a>(financial_account_token) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>
- <code title="patch /v1/financial_accounts/{financial_account_token}">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">update</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_update_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>
- <code title="get /v1/financial_accounts">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">list</a>(\*\*<a href="src/lithic/types/financial_account_list_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">SyncSinglePage[FinancialAccount]</a></code>
- <code title="post /v1/financial_accounts/{financial_account_token}/register_account_number">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">register_account_number</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_register_account_number_params.py">params</a>) -> None</code>
- <code title="post /v1/financial_accounts/{financial_account_token}/update_status">client.financial_accounts.<a href="./src/lithic/resources/financial_accounts/financial_accounts.py">update_status</a>(financial_account_token, \*\*<a href="src/lithic/types/financial_account_update_status_params.py">params</a>) -> <a href="./src/lithic/types/financial_account.py">FinancialAccount</a></code>

## Balances
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lithic"
version = "0.93.0"
version = "0.94.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,6 +37,8 @@ classifiers = [
Homepage = "https://github.com/lithic-com/lithic-python"
Repository = "https://github.com/lithic-com/lithic-python"

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

[tool.rye]
managed = true
Expand All @@ -54,6 +56,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -125,7 +128,7 @@ replacement = '[\1](https://github.com/lithic-com/lithic-python/tree/main/\g<2>)

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
Expand Down
31 changes: 31 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via httpx-aiohttp
# via lithic
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via lithic
argcomplete==3.1.2
# via nox
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
Expand All @@ -30,25 +41,37 @@ distro==1.8.0
exceptiongroup==1.2.2
# via anyio
# via pytest
execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via lithic
# via respx
httpx-aiohttp==0.1.6
# via lithic
idna==3.4
# via anyio
# via httpx
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.4.4
# via aiohttp
# via yarl
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
Expand All @@ -63,6 +86,9 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via lithic
pydantic-core==2.27.1
Expand All @@ -72,7 +98,9 @@ pygments==2.18.0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
Expand All @@ -94,11 +122,14 @@ tomli==2.0.2
typing-extensions==4.12.2
# via anyio
# via lithic
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
virtualenv==20.24.5
# via nox
yarl==1.20.0
# via aiohttp
zipp==3.17.0
# via importlib-metadata
27 changes: 27 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,51 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via httpx-aiohttp
# via lithic
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via lithic
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
distro==1.8.0
# via lithic
exceptiongroup==1.2.2
# via anyio
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via lithic
httpx-aiohttp==0.1.6
# via lithic
idna==3.4
# via anyio
# via httpx
# via yarl
multidict==6.4.4
# via aiohttp
# via yarl
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via lithic
pydantic-core==2.27.1
Expand All @@ -41,5 +65,8 @@ sniffio==1.3.0
typing-extensions==4.12.2
# via anyio
# via lithic
# via multidict
# via pydantic
# via pydantic-core
yarl==1.20.0
# via aiohttp
3 changes: 2 additions & 1 deletion src/lithic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
UnprocessableEntityError,
APIResponseValidationError,
)
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
from ._utils._logs import setup_logging as _setup_logging

__all__ = [
Expand Down Expand Up @@ -80,6 +80,7 @@
"DEFAULT_CONNECTION_LIMITS",
"DefaultHttpxClient",
"DefaultAsyncHttpxClient",
"DefaultAioHttpClient",
]

if not _t.TYPE_CHECKING:
Expand Down
Loading