Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2d4a30e
chore(docs): grammar improvements
stainless-app[bot] May 21, 2025
b95ac19
feat(api): api update
stainless-app[bot] May 22, 2025
a31325e
feat(api): api update
stainless-app[bot] May 22, 2025
8cb6d58
codegen metadata
stainless-app[bot] May 23, 2025
0fce3dc
codegen metadata
stainless-app[bot] May 23, 2025
4dfa0fe
codegen metadata
stainless-app[bot] May 27, 2025
4ad8fe4
codegen metadata
stainless-app[bot] May 27, 2025
9548dd5
chore(tests): skip endpoints with basic auth
stainless-app[bot] May 28, 2025
2b6929f
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 2, 2025
f9bdda7
feat(client): add follow_redirects request option
stainless-app[bot] Jun 2, 2025
edcea6c
fix(client): fix PayStatementResponse body
stainless-app[bot] Jun 4, 2025
d1dc8a4
fix(client): manual fix
stainless-app[bot] Jun 4, 2025
68ed0de
feat(api): api update
stainless-app[bot] Jun 11, 2025
97ef62d
feat(api): api update
stainless-app[bot] Jun 11, 2025
25017c4
chore(tests): run tests in parallel
stainless-app[bot] Jun 12, 2025
260c761
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 12, 2025
e51c8f7
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 16, 2025
ed2f82d
chore(internal): update conftest.py
stainless-app[bot] Jun 16, 2025
3a05f2a
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
e27f6d8
chore(readme): update badges
stainless-app[bot] Jun 17, 2025
c17f081
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 18, 2025
9529a96
feat(client): add support for aiohttp
stainless-app[bot] Jun 20, 2025
668de92
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 23, 2025
d424f44
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 26, 2025
398de61
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 27, 2025
5bd88a7
fix(ci): correct conditional
stainless-app[bot] Jun 29, 2025
2d63eed
chore(ci): change upload type
stainless-app[bot] Jul 1, 2025
8411cf6
chore: fix access tokens test
TomerAberbach Jul 2, 2025
5ff5f5d
release: 1.30.0
stainless-app[bot] Jul 2, 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/finch-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/finch-python'
build:
if: github.repository == 'stainless-sdks/finch-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/finch-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 @@
{
".": "1.29.0"
".": "1.30.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 46
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-944a0f9d35f3b8ec2ba62fa12e551cf89f0b845f8ed1e3c7f67a9fb80b32d96f.yml
openapi_spec_hash: 37c849e7b5dd941c011385b49467e077
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-f7e741bc6e0175fd96a9db5348092b90a77b0985154c0814bb681ad5dccdf19a.yml
openapi_spec_hash: b348a9ef407a8e91dd770fcb219d4ac5
config_hash: 5146b12344dae76238940989dac1e8a0
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Changelog

## 1.30.0 (2025-07-02)

Full Changelog: [v1.29.0...v1.30.0](https://github.com/Finch-API/finch-api-python/compare/v1.29.0...v1.30.0)

### Features

* **api:** api update ([97ef62d](https://github.com/Finch-API/finch-api-python/commit/97ef62d11c21650cb6f34a69f3309cdbf034df86))
* **api:** api update ([68ed0de](https://github.com/Finch-API/finch-api-python/commit/68ed0de62a49c340a1ee7dc71d941d71b6d780c4))
* **api:** api update ([a31325e](https://github.com/Finch-API/finch-api-python/commit/a31325e6eeb04cfa725ceee5637b869dd02be1a8))
* **api:** api update ([b95ac19](https://github.com/Finch-API/finch-api-python/commit/b95ac1971a10372d70fc7ccdb3cf63f4411e9d2e))
* **client:** add follow_redirects request option ([f9bdda7](https://github.com/Finch-API/finch-api-python/commit/f9bdda77ef1fcb1460594a16f1b8726bbaad2b52))
* **client:** add support for aiohttp ([9529a96](https://github.com/Finch-API/finch-api-python/commit/9529a960260e47e147e10a9fec012f279089628b))


### Bug Fixes

* **ci:** correct conditional ([5bd88a7](https://github.com/Finch-API/finch-api-python/commit/5bd88a7228b013e66794a9731e3d3669d1a43321))
* **ci:** release-doctor — report correct token name ([d424f44](https://github.com/Finch-API/finch-api-python/commit/d424f44c05c5c05bf31b43e1da74acea40324553))
* **client:** correctly parse binary response | stream ([260c761](https://github.com/Finch-API/finch-api-python/commit/260c761024d36f0bb4efc3cf5a5e0e3c22b5f83e))
* **client:** fix PayStatementResponse body ([edcea6c](https://github.com/Finch-API/finch-api-python/commit/edcea6c7ac55661d3e46aec1c42576988b510dfc))
* **client:** manual fix ([d1dc8a4](https://github.com/Finch-API/finch-api-python/commit/d1dc8a4aa3df7a0199ab04958a766b56b3be0dc5))


### Chores

* **ci:** change upload type ([2d63eed](https://github.com/Finch-API/finch-api-python/commit/2d63eeda7540306cf29e14ac475c6f5cc740d768))
* **ci:** enable for pull requests ([3a05f2a](https://github.com/Finch-API/finch-api-python/commit/3a05f2a17a2f0067486b6c8427b2d50c18a79a80))
* **ci:** only run for pushes and fork pull requests ([398de61](https://github.com/Finch-API/finch-api-python/commit/398de612e40086b2814a79c2fcdd0d73bba289fc))
* **docs:** grammar improvements ([2d4a30e](https://github.com/Finch-API/finch-api-python/commit/2d4a30edc2f84fc7effc9b7719aae8ed51646338))
* **docs:** remove reference to rye shell ([2b6929f](https://github.com/Finch-API/finch-api-python/commit/2b6929f8eca16bff688b19907f38e05ad2d2b092))
* fix access tokens test ([8411cf6](https://github.com/Finch-API/finch-api-python/commit/8411cf6e5185b4f2dd70ac030d30d7c9808e55b5))
* **internal:** update conftest.py ([ed2f82d](https://github.com/Finch-API/finch-api-python/commit/ed2f82d6ecc8662e4717c9f7b75d912226c5df25))
* **readme:** update badges ([e27f6d8](https://github.com/Finch-API/finch-api-python/commit/e27f6d80e9b9bdbb23fa3a6c9cc84ecbbf790638))
* **tests:** add tests for httpx client instantiation & proxies ([e51c8f7](https://github.com/Finch-API/finch-api-python/commit/e51c8f78bb45e0c3dbce5dc67401390078a2fd33))
* **tests:** run tests in parallel ([25017c4](https://github.com/Finch-API/finch-api-python/commit/25017c43233e726dd80d1e7ca41eb02ec9456871))
* **tests:** skip endpoints with basic auth ([9548dd5](https://github.com/Finch-API/finch-api-python/commit/9548dd59525baf33a8d1977b132e93b2fe1d7f96))
* **tests:** skip some failing tests on the latest python versions ([668de92](https://github.com/Finch-API/finch-api-python/commit/668de928c9cd69af00755b2a201f3e26a24f9630))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([c17f081](https://github.com/Finch-API/finch-api-python/commit/c17f0817149ae17fe866bc79f8613cbccc0ded72))

## 1.29.0 (2025-05-16)

Full Changelog: [v1.28.0...v1.29.0](https://github.com/Finch-API/finch-api-python/compare/v1.28.0...v1.29.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
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Finch Python API library

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

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

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

```python
import asyncio
from finch import DefaultAioHttpClient
from finch import AsyncFinch


async def main() -> None:
async with AsyncFinch(
access_token="My Access Token",
http_client=DefaultAioHttpClient(),
) as client:
page = await client.hris.directory.list()
print(page.individuals)


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 @@ -219,7 +250,7 @@ client.with_options(max_retries=5).hris.directory.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 finch import Finch
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 Finch please follow the respective company's security reporting guidelines.
or products provided by Finch, please follow the respective company's security reporting guidelines.

### Finch Terms and Policies

Please contact founders@tryfinch.com for any questions or concerns regarding security of our services.
Please contact founders@tryfinch.com for any questions or concerns regarding the security of our services.

---

Expand Down
10 changes: 7 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ Methods:
Types:

```python
from finch.types.hris import PayStatement, PayStatementResponse, PayStatementResponseBody
from finch.types.hris import (
PayStatement,
PayStatementDataSyncInProgress,
PayStatementResponse,
PayStatementResponseBody,
)
```

Methods:
Expand Down Expand Up @@ -170,7 +175,6 @@ from finch.types.hris import (
SupportPerBenefitType,
SupportedBenefit,
UpdateCompanyBenefitResponse,
BenefitListSupportedBenefitsResponse,
BenfitContribution,
)
```
Expand All @@ -181,7 +185,7 @@ Methods:
- <code title="get /employer/benefits/{benefit_id}">client.hris.benefits.<a href="./src/finch/resources/hris/benefits/benefits.py">retrieve</a>(benefit_id) -> <a href="./src/finch/types/hris/company_benefit.py">CompanyBenefit</a></code>
- <code title="post /employer/benefits/{benefit_id}">client.hris.benefits.<a href="./src/finch/resources/hris/benefits/benefits.py">update</a>(benefit_id, \*\*<a href="src/finch/types/hris/benefit_update_params.py">params</a>) -> <a href="./src/finch/types/hris/update_company_benefit_response.py">UpdateCompanyBenefitResponse</a></code>
- <code title="get /employer/benefits">client.hris.benefits.<a href="./src/finch/resources/hris/benefits/benefits.py">list</a>() -> <a href="./src/finch/types/hris/company_benefit.py">SyncSinglePage[CompanyBenefit]</a></code>
- <code title="get /employer/benefits/meta">client.hris.benefits.<a href="./src/finch/resources/hris/benefits/benefits.py">list_supported_benefits</a>() -> <a href="./src/finch/types/hris/benefit_list_supported_benefits_response.py">SyncSinglePage[BenefitListSupportedBenefitsResponse]</a></code>
- <code title="get /employer/benefits/meta">client.hris.benefits.<a href="./src/finch/resources/hris/benefits/benefits.py">list_supported_benefits</a>() -> <a href="./src/finch/types/hris/supported_benefit.py">SyncSinglePage[SupportedBenefit]</a></code>

### Individuals

Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The FINCH_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
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 = "finch-api"
version = "1.29.0"
version = "1.30.0"
description = "The official Python library for the Finch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,6 +37,8 @@ classifiers = [
Homepage = "https://github.com/Finch-API/finch-api-python"
Repository = "https://github.com/Finch-API/finch-api-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/Finch-API/finch-api-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 finch-api
# via httpx-aiohttp
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via finch-api
# via httpx
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 finch-api
# via httpx-aiohttp
# via respx
httpx-aiohttp==0.1.6
# via finch-api
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 finch-api
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 finch-api
# 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
Loading