Skip to content

Commit 0648956

Browse files
Merge pull request #8 from CASParser/release-please--branches--main--changes--next
release: 1.3.0
2 parents 3b6a6e3 + b918648 commit 0648956

85 files changed

Lines changed: 8378 additions & 1899 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
7-
ENV PATH=/home/vscode/.rye/shims:$PATH
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
87

98
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"context": ".."
88
},
99

10-
"postStartCommand": "rye sync --all-features",
10+
"postStartCommand": "uv sync --all-extras",
1111

1212
"customizations": {
1313
"vscode": {
@@ -20,7 +20,7 @@
2020
"python.defaultInterpreterPath": ".venv/bin/python",
2121
"python.typeChecking": "basic",
2222
"terminal.integrated.env.linux": {
23-
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
23+
"PATH": "${env:PATH}"
2424
}
2525
}
2626
}

.github/workflows/ci.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v6
2323

24-
- name: Install Rye
25-
run: |
26-
curl -sSf https://rye.astral.sh/get | bash
27-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
28-
env:
29-
RYE_VERSION: '0.44.0'
30-
RYE_INSTALL_OPTION: '--yes'
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
version: '0.9.13'
3128

3229
- name: Install dependencies
33-
run: rye sync --all-features
30+
run: uv sync --all-extras
3431

3532
- name: Run lints
3633
run: ./scripts/lint
@@ -46,19 +43,16 @@ jobs:
4643
steps:
4744
- uses: actions/checkout@v6
4845

49-
- name: Install Rye
50-
run: |
51-
curl -sSf https://rye.astral.sh/get | bash
52-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53-
env:
54-
RYE_VERSION: '0.44.0'
55-
RYE_INSTALL_OPTION: '--yes'
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v5
48+
with:
49+
version: '0.9.13'
5650

5751
- name: Install dependencies
58-
run: rye sync --all-features
52+
run: uv sync --all-extras
5953

6054
- name: Run build
61-
run: rye build
55+
run: uv build
6256

6357
- name: Get GitHub OIDC Token
6458
if: github.repository == 'stainless-sdks/cas-parser-python'
@@ -83,13 +77,10 @@ jobs:
8377
steps:
8478
- uses: actions/checkout@v6
8579

86-
- name: Install Rye
87-
run: |
88-
curl -sSf https://rye.astral.sh/get | bash
89-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
90-
env:
91-
RYE_VERSION: '0.44.0'
92-
RYE_INSTALL_OPTION: '--yes'
80+
- name: Install uv
81+
uses: astral-sh/setup-uv@v5
82+
with:
83+
version: '0.9.13'
9384

9485
- name: Bootstrap
9586
run: ./scripts/bootstrap

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v6
1818

19-
- name: Install Rye
20-
run: |
21-
curl -sSf https://rye.astral.sh/get | bash
22-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23-
env:
24-
RYE_VERSION: '0.44.0'
25-
RYE_INSTALL_OPTION: '--yes'
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
version: '0.9.13'
2623

2724
- name: Publish to PyPI
2825
run: |

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.2.1"
2+
".": "1.3.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 4
1+
configured_endpoints: 17
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
33
openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
4-
config_hash: cb5d75abef6264b5d86448caf7295afa
4+
config_hash: c9c82d7a2437cc99fc06dd1f92cf76ab

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
brew "rye"
1+
brew "uv"
22

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 1.3.0 (2026-02-14)
4+
5+
Full Changelog: [v1.2.1...v1.3.0](https://github.com/CASParser/cas-parser-python/compare/v1.2.1...v1.3.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([98b1422](https://github.com/CASParser/cas-parser-python/commit/98b1422eadacacd06a45ffe4ce7dcab0e2dc9f1b))
10+
11+
12+
### Chores
13+
14+
* update SDK settings ([7fcfc93](https://github.com/CASParser/cas-parser-python/commit/7fcfc935a8b94a8ad6401336cc52f9fe66ae3022))
15+
* update SDK settings ([32181ec](https://github.com/CASParser/cas-parser-python/commit/32181ecb3c8bb0e523506b159320422ef565c411))
16+
317
## 1.2.1 (2026-02-14)
418

519
Full Changelog: [v1.2.0...v1.2.1](https://github.com/CASParser/cas-parser-python/compare/v1.2.0...v1.2.1)

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
## Setting up the environment
22

3-
### With Rye
3+
### With `uv`
44

5-
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
5+
We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
66

77
```sh
88
$ ./scripts/bootstrap
99
```
1010

11-
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
11+
Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/) and run:
1212

1313
```sh
14-
$ rye sync --all-features
14+
$ uv sync --all-extras
1515
```
1616

17-
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
17+
You can then run scripts using `uv run python script.py` or by manually activating the virtual environment:
1818

1919
```sh
20-
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
2121
$ source .venv/bin/activate
2222

23-
# now you can omit the `rye run` prefix
23+
# now you can omit the `uv run` prefix
2424
$ python script.py
2525
```
2626

27-
### Without Rye
27+
### Without `uv`
2828

29-
Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
29+
Alternatively if you don't want to install `uv`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
3030

3131
```sh
3232
$ pip install -r requirements-dev.lock
@@ -45,7 +45,7 @@ All files in the `examples/` directory are not modified by the generator and can
4545
```py
4646
# add an example to examples/<your-example>.py
4747

48-
#!/usr/bin/env -S rye run python
48+
#!/usr/bin/env -S uv run python
4949
5050
```
5151

@@ -72,7 +72,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
7272
To create a distributable version of the library, all you have to do is run this command:
7373

7474
```sh
75-
$ rye build
75+
$ uv build
7676
# or
7777
$ python -m build
7878
```

README.md

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
# Cas Parser Python API library
22

33
<!-- prettier-ignore -->
4-
[![PyPI version](https://img.shields.io/pypi/v/cas-parser-python.svg?label=pypi%20(stable))](https://pypi.org/project/cas-parser-python/)
4+
[![PyPI version](https://img.shields.io/pypi/v/cas_parser.svg?label=pypi%20(stable))](https://pypi.org/project/cas_parser/)
55

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

1010
It is generated with [Stainless](https://www.stainless.com/).
1111

12-
## MCP Server
13-
14-
Use the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
15-
16-
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNhcy1wYXJzZXItbm9kZS1tY3AiXSwiZW52Ijp7IkNBU19QQVJTRVJfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)
17-
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cas-parser-node-mcp%22%5D%2C%22env%22%3A%7B%22CAS_PARSER_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
18-
19-
> Note: You may need to set environment variables in your MCP client.
20-
2112
## Documentation
2213

23-
The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in/reference). The full API of this library can be found in [api.md](api.md).
14+
The full API of this library can be found in [api.md](api.md).
2415

2516
## Installation
2617

2718
```sh
2819
# install from PyPI
29-
pip install cas-parser-python
20+
pip install cas_parser
3021
```
3122

3223
## Usage
@@ -39,13 +30,12 @@ from cas_parser import CasParser
3930

4031
client = CasParser(
4132
api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted
33+
# or 'production' | 'environment_2'; defaults to "production".
34+
environment="environment_1",
4235
)
4336

44-
unified_response = client.cas_parser.smart_parse(
45-
password="ABCDF",
46-
pdf_url="https://your-cas-pdf-url-here.com",
47-
)
48-
print(unified_response.demat_accounts)
37+
response = client.credits.check()
38+
print(response.enabled_features)
4939
```
5040

5141
While you can provide an `api_key` keyword argument,
@@ -64,15 +54,14 @@ from cas_parser import AsyncCasParser
6454

6555
client = AsyncCasParser(
6656
api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted
57+
# or 'production' | 'environment_2'; defaults to "production".
58+
environment="environment_1",
6759
)
6860

6961

7062
async def main() -> None:
71-
unified_response = await client.cas_parser.smart_parse(
72-
password="ABCDF",
73-
pdf_url="https://your-cas-pdf-url-here.com",
74-
)
75-
print(unified_response.demat_accounts)
63+
response = await client.credits.check()
64+
print(response.enabled_features)
7665

7766

7867
asyncio.run(main())
@@ -88,7 +77,7 @@ You can enable this by installing `aiohttp`:
8877

8978
```sh
9079
# install from PyPI
91-
pip install cas-parser-python[aiohttp]
80+
pip install cas_parser[aiohttp]
9281
```
9382

9483
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -105,11 +94,8 @@ async def main() -> None:
10594
api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted
10695
http_client=DefaultAioHttpClient(),
10796
) as client:
108-
unified_response = await client.cas_parser.smart_parse(
109-
password="ABCDF",
110-
pdf_url="https://your-cas-pdf-url-here.com",
111-
)
112-
print(unified_response.demat_accounts)
97+
response = await client.credits.check()
98+
print(response.enabled_features)
11399

114100

115101
asyncio.run(main())
@@ -140,10 +126,7 @@ from cas_parser import CasParser
140126
client = CasParser()
141127

142128
try:
143-
client.cas_parser.smart_parse(
144-
password="ABCDF",
145-
pdf_url="https://you-cas-pdf-url-here.com",
146-
)
129+
client.credits.check()
147130
except cas_parser.APIConnectionError as e:
148131
print("The server could not be reached")
149132
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -186,10 +169,7 @@ client = CasParser(
186169
)
187170

188171
# Or, configure per-request:
189-
client.with_options(max_retries=5).cas_parser.smart_parse(
190-
password="ABCDF",
191-
pdf_url="https://you-cas-pdf-url-here.com",
192-
)
172+
client.with_options(max_retries=5).credits.check()
193173
```
194174

195175
### Timeouts
@@ -212,10 +192,7 @@ client = CasParser(
212192
)
213193

214194
# Override per-request:
215-
client.with_options(timeout=5.0).cas_parser.smart_parse(
216-
password="ABCDF",
217-
pdf_url="https://you-cas-pdf-url-here.com",
218-
)
195+
client.with_options(timeout=5.0).credits.check()
219196
```
220197

221198
On timeout, an `APITimeoutError` is thrown.
@@ -256,14 +233,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
256233
from cas_parser import CasParser
257234

258235
client = CasParser()
259-
response = client.cas_parser.with_raw_response.smart_parse(
260-
password="ABCDF",
261-
pdf_url="https://you-cas-pdf-url-here.com",
262-
)
236+
response = client.credits.with_raw_response.check()
263237
print(response.headers.get('X-My-Header'))
264238

265-
cas_parser = response.parse() # get the object that `cas_parser.smart_parse()` would have returned
266-
print(cas_parser.demat_accounts)
239+
credit = response.parse() # get the object that `credits.check()` would have returned
240+
print(credit.enabled_features)
267241
```
268242

269243
These methods return an [`APIResponse`](https://github.com/CASParser/cas-parser-python/tree/main/src/cas_parser/_response.py) object.
@@ -277,10 +251,7 @@ The above interface eagerly reads the full response body when you make the reque
277251
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
278252

279253
```python
280-
with client.cas_parser.with_streaming_response.smart_parse(
281-
password="ABCDF",
282-
pdf_url="https://you-cas-pdf-url-here.com",
283-
) as response:
254+
with client.credits.with_streaming_response.check() as response:
284255
print(response.headers.get("X-My-Header"))
285256

286257
for line in response.iter_lines():

0 commit comments

Comments
 (0)