Skip to content

Commit 3fda81d

Browse files
feat(api): api update
1 parent 8e6c5b2 commit 3fda81d

File tree

12 files changed

+808
-145
lines changed

12 files changed

+808
-145
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-9eaed98ce5934f11e901cef376a28257d2c196bd3dba7c690babc6741a730ded.yml
3-
openapi_spec_hash: b76e4e830c4d03ba4cf9429bb9fb9c8a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-38618cc5c938e87eeacf4893d6a6ba4e6ef7da390e6283dc7b50b484a7b97165.yml
3+
openapi_spec_hash: b9e439ecee904ded01aa34efdee88856
44
config_hash: cb5d75abef6264b5d86448caf7295afa

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Cas Parser
189+
Copyright 2026 Cas Parser
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@ pip install cas-parser-python[aiohttp]
8585
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
8686

8787
```python
88+
import os
8889
import asyncio
8990
from cas_parser import DefaultAioHttpClient
9091
from cas_parser import AsyncCasParser
9192

9293

9394
async def main() -> None:
9495
async with AsyncCasParser(
95-
api_key="My API Key",
96+
api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted
9697
http_client=DefaultAioHttpClient(),
9798
) as client:
9899
unified_response = await client.cas_parser.smart_parse(

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ license = "Apache-2.0"
77
authors = [
88
{ name = "Cas Parser", email = "[email protected]" },
99
]
10+
1011
dependencies = [
11-
"httpx>=0.23.0, <1",
12-
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.10, <5",
14-
"anyio>=3.5.0, <5",
15-
"distro>=1.7.0, <2",
16-
"sniffio",
12+
"httpx>=0.23.0, <1",
13+
"pydantic>=1.9.0, <3",
14+
"typing-extensions>=4.10, <5",
15+
"anyio>=3.5.0, <5",
16+
"distro>=1.7.0, <2",
17+
"sniffio",
1718
]
19+
1820
requires-python = ">= 3.9"
1921
classifiers = [
2022
"Typing :: Typed",
@@ -24,6 +26,7 @@ classifiers = [
2426
"Programming Language :: Python :: 3.11",
2527
"Programming Language :: Python :: 3.12",
2628
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: 3.14",
2730
"Operating System :: OS Independent",
2831
"Operating System :: POSIX",
2932
"Operating System :: MacOS",
@@ -45,7 +48,7 @@ managed = true
4548
# version pins are in requirements-dev.lock
4649
dev-dependencies = [
4750
"pyright==1.1.399",
48-
"mypy",
51+
"mypy==1.17",
4952
"respx",
5053
"pytest",
5154
"pytest-asyncio",

requirements-dev.lock

Lines changed: 62 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,45 @@
1212
-e file:.
1313
aiohappyeyeballs==2.6.1
1414
# via aiohttp
15-
aiohttp==3.12.8
15+
aiohttp==3.13.2
1616
# via cas-parser-python
1717
# via httpx-aiohttp
18-
aiosignal==1.3.2
18+
aiosignal==1.4.0
1919
# via aiohttp
20-
annotated-types==0.6.0
20+
annotated-types==0.7.0
2121
# via pydantic
22-
anyio==4.4.0
22+
anyio==4.12.0
2323
# via cas-parser-python
2424
# via httpx
25-
argcomplete==3.1.2
25+
argcomplete==3.6.3
2626
# via nox
2727
async-timeout==5.0.1
2828
# via aiohttp
29-
attrs==25.3.0
29+
attrs==25.4.0
3030
# via aiohttp
31-
certifi==2023.7.22
31+
# via nox
32+
backports-asyncio-runner==1.2.0
33+
# via pytest-asyncio
34+
certifi==2025.11.12
3235
# via httpcore
3336
# via httpx
34-
colorlog==6.7.0
37+
colorlog==6.10.1
38+
# via nox
39+
dependency-groups==1.3.1
3540
# via nox
36-
dirty-equals==0.6.0
37-
distlib==0.3.7
41+
dirty-equals==0.11
42+
distlib==0.4.0
3843
# via virtualenv
39-
distro==1.8.0
44+
distro==1.9.0
4045
# via cas-parser-python
41-
exceptiongroup==1.2.2
46+
exceptiongroup==1.3.1
4247
# via anyio
4348
# via pytest
44-
execnet==2.1.1
49+
execnet==2.1.2
4550
# via pytest-xdist
46-
filelock==3.12.4
51+
filelock==3.19.1
4752
# via virtualenv
48-
frozenlist==1.6.2
53+
frozenlist==1.8.0
4954
# via aiohttp
5055
# via aiosignal
5156
h11==0.16.0
@@ -58,80 +63,87 @@ httpx==0.28.1
5863
# via respx
5964
httpx-aiohttp==0.1.9
6065
# via cas-parser-python
61-
idna==3.4
66+
humanize==4.13.0
67+
# via nox
68+
idna==3.11
6269
# via anyio
6370
# via httpx
6471
# via yarl
65-
importlib-metadata==7.0.0
66-
iniconfig==2.0.0
72+
importlib-metadata==8.7.0
73+
iniconfig==2.1.0
6774
# via pytest
6875
markdown-it-py==3.0.0
6976
# via rich
7077
mdurl==0.1.2
7178
# via markdown-it-py
72-
multidict==6.4.4
79+
multidict==6.7.0
7380
# via aiohttp
7481
# via yarl
75-
mypy==1.14.1
76-
mypy-extensions==1.0.0
82+
mypy==1.17.0
83+
mypy-extensions==1.1.0
7784
# via mypy
78-
nodeenv==1.8.0
85+
nodeenv==1.9.1
7986
# via pyright
80-
nox==2023.4.22
81-
packaging==23.2
87+
nox==2025.11.12
88+
packaging==25.0
89+
# via dependency-groups
8290
# via nox
8391
# via pytest
84-
platformdirs==3.11.0
92+
pathspec==0.12.1
93+
# via mypy
94+
platformdirs==4.4.0
8595
# via virtualenv
86-
pluggy==1.5.0
96+
pluggy==1.6.0
8797
# via pytest
88-
propcache==0.3.1
98+
propcache==0.4.1
8999
# via aiohttp
90100
# via yarl
91-
pydantic==2.11.9
101+
pydantic==2.12.5
92102
# via cas-parser-python
93-
pydantic-core==2.33.2
103+
pydantic-core==2.41.5
94104
# via pydantic
95-
pygments==2.18.0
105+
pygments==2.19.2
106+
# via pytest
96107
# via rich
97108
pyright==1.1.399
98-
pytest==8.3.3
109+
pytest==8.4.2
99110
# via pytest-asyncio
100111
# via pytest-xdist
101-
pytest-asyncio==0.24.0
102-
pytest-xdist==3.7.0
103-
python-dateutil==2.8.2
112+
pytest-asyncio==1.2.0
113+
pytest-xdist==3.8.0
114+
python-dateutil==2.9.0.post0
104115
# via time-machine
105-
pytz==2023.3.post1
106-
# via dirty-equals
107116
respx==0.22.0
108-
rich==13.7.1
109-
ruff==0.9.4
110-
setuptools==68.2.2
111-
# via nodeenv
112-
six==1.16.0
117+
rich==14.2.0
118+
ruff==0.14.7
119+
six==1.17.0
113120
# via python-dateutil
114-
sniffio==1.3.0
115-
# via anyio
121+
sniffio==1.3.1
116122
# via cas-parser-python
117-
time-machine==2.9.0
118-
tomli==2.0.2
123+
time-machine==2.19.0
124+
tomli==2.3.0
125+
# via dependency-groups
119126
# via mypy
127+
# via nox
120128
# via pytest
121-
typing-extensions==4.12.2
129+
typing-extensions==4.15.0
130+
# via aiosignal
122131
# via anyio
123132
# via cas-parser-python
133+
# via exceptiongroup
124134
# via multidict
125135
# via mypy
126136
# via pydantic
127137
# via pydantic-core
128138
# via pyright
139+
# via pytest-asyncio
129140
# via typing-inspection
130-
typing-inspection==0.4.1
141+
# via virtualenv
142+
typing-inspection==0.4.2
131143
# via pydantic
132-
virtualenv==20.24.5
144+
virtualenv==20.35.4
133145
# via nox
134-
yarl==1.20.0
146+
yarl==1.22.0
135147
# via aiohttp
136-
zipp==3.17.0
148+
zipp==3.23.0
137149
# via importlib-metadata

requirements.lock

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@
1212
-e file:.
1313
aiohappyeyeballs==2.6.1
1414
# via aiohttp
15-
aiohttp==3.12.8
15+
aiohttp==3.13.2
1616
# via cas-parser-python
1717
# via httpx-aiohttp
18-
aiosignal==1.3.2
18+
aiosignal==1.4.0
1919
# via aiohttp
20-
annotated-types==0.6.0
20+
annotated-types==0.7.0
2121
# via pydantic
22-
anyio==4.4.0
22+
anyio==4.12.0
2323
# via cas-parser-python
2424
# via httpx
2525
async-timeout==5.0.1
2626
# via aiohttp
27-
attrs==25.3.0
27+
attrs==25.4.0
2828
# via aiohttp
29-
certifi==2023.7.22
29+
certifi==2025.11.12
3030
# via httpcore
3131
# via httpx
32-
distro==1.8.0
32+
distro==1.9.0
3333
# via cas-parser-python
34-
exceptiongroup==1.2.2
34+
exceptiongroup==1.3.1
3535
# via anyio
36-
frozenlist==1.6.2
36+
frozenlist==1.8.0
3737
# via aiohttp
3838
# via aiosignal
3939
h11==0.16.0
@@ -45,31 +45,32 @@ httpx==0.28.1
4545
# via httpx-aiohttp
4646
httpx-aiohttp==0.1.9
4747
# via cas-parser-python
48-
idna==3.4
48+
idna==3.11
4949
# via anyio
5050
# via httpx
5151
# via yarl
52-
multidict==6.4.4
52+
multidict==6.7.0
5353
# via aiohttp
5454
# via yarl
55-
propcache==0.3.1
55+
propcache==0.4.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.11.9
58+
pydantic==2.12.5
5959
# via cas-parser-python
60-
pydantic-core==2.33.2
60+
pydantic-core==2.41.5
6161
# via pydantic
62-
sniffio==1.3.0
63-
# via anyio
62+
sniffio==1.3.1
6463
# via cas-parser-python
65-
typing-extensions==4.12.2
64+
typing-extensions==4.15.0
65+
# via aiosignal
6666
# via anyio
6767
# via cas-parser-python
68+
# via exceptiongroup
6869
# via multidict
6970
# via pydantic
7071
# via pydantic-core
7172
# via typing-inspection
72-
typing-inspection==0.4.1
73+
typing-inspection==0.4.2
7374
# via pydantic
74-
yarl==1.20.0
75+
yarl==1.22.0
7576
# via aiohttp

scripts/lint

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
echo "==> Running lints"
8-
rye run lint
7+
if [ "$1" = "--fix" ]; then
8+
echo "==> Running lints with --fix"
9+
rye run fix:ruff
10+
else
11+
echo "==> Running lints"
12+
rye run lint
13+
fi
914

1015
echo "==> Making sure it imports"
1116
rye run python -c 'import cas_parser'

src/cas_parser/_base_client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,12 @@ def patch(
12471247
*,
12481248
cast_to: Type[ResponseT],
12491249
body: Body | None = None,
1250+
files: RequestFiles | None = None,
12501251
options: RequestOptions = {},
12511252
) -> ResponseT:
1252-
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
1253+
opts = FinalRequestOptions.construct(
1254+
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
1255+
)
12531256
return self.request(cast_to, opts)
12541257

12551258
def put(
@@ -1767,9 +1770,12 @@ async def patch(
17671770
*,
17681771
cast_to: Type[ResponseT],
17691772
body: Body | None = None,
1773+
files: RequestFiles | None = None,
17701774
options: RequestOptions = {},
17711775
) -> ResponseT:
1772-
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
1776+
opts = FinalRequestOptions.construct(
1777+
method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1778+
)
17731779
return await self.request(cast_to, opts)
17741780

17751781
async def put(

0 commit comments

Comments
 (0)