Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"cliVersion": "3.5.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.45.1",
"generatorConfig": {
"package_name": "truefoundry_sdk",
"pydantic_config": {
"enum_type": "python_enums",
"use_provided_defaults": true,
"frozen": false
},
"client": {
"class_name": "BaseTrueFoundry",
"filename": "base_client.py",
"exported_class_name": "TrueFoundry",
"exported_filename": "client.py"
},
"pyproject_python_version": ">=3.8",
"extra_dev_dependencies": {
"ipython": ">=8.0.0,<10.0.0",
"Jinja2": ">=3.1.6,<4.0.0",
"numpydoc": ">=1.7.0,<2.0.0"
}
}
}
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ This library provides convenient access to the TrueFoundry API.
> - TypeScript: [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/truefoundry/truefoundry-typescript-sdk)


## Table of Contents

- [Installation](#installation)
- [Reference](#reference)
- [Usage](#usage)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Advanced](#advanced)
- [Access Raw Response Data](#access-raw-response-data)
- [Retries](#retries)
- [Timeouts](#timeouts)
- [Custom Client](#custom-client)
- [Contributing](#contributing)

## Installation

```sh
Expand Down Expand Up @@ -152,6 +167,15 @@ for page in response.iter_pages():
yield page
```

```python
# You can also iterate through pages and access the typed response per page
pager = client.users.list(...)
for page in pager.iter_pages():
print(page.response) # access the typed response for each page
for item in page:
print(item)
```

## Advanced

### Access Raw Response Data
Expand All @@ -169,11 +193,11 @@ response = client.applications.with_raw_response.list(...)
print(response.headers) # access the response headers
print(response.data) # access the underlying object
pager = client.users.list(...)
print(pager.response.headers) # access the response headers for the first page
print(pager.response) # access the typed response for the first page
for item in pager:
print(item) # access the underlying object(s)
for page in pager.iter_pages():
print(page.response.headers) # access the response headers for each page
print(page.response) # access the typed response for each page
for item in page:
print(item) # access the underlying object(s)
```
Expand Down
58 changes: 46 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[project]
name = "truefoundry-sdk"
dynamic = ["version"]

[tool.poetry]
name = "truefoundry-sdk"
Expand Down Expand Up @@ -44,6 +45,7 @@ typing_extensions = ">= 4.0.0"
mypy = "==1.13.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
Jinja2 = ">=3.1.6,<4.0.0"
Expand Down
Loading