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
9 changes: 9 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cliVersion": "3.5.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.38.4",
"generatorConfig": {
"client_class_name": "Lattice",
"package_name": "anduril"
}
}
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: ci

on: [push]
jobs:
compile:
Expand All @@ -10,7 +9,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
Expand All @@ -26,15 +25,15 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install

- name: Test
run: poetry run pytest -rP .
run: poetry run pytest -rP -n auto .

publish:
needs: [compile, test]
Expand All @@ -46,7 +45,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
Expand Down
42 changes: 30 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@

The Lattice SDK Python library provides convenient access to the Lattice SDK APIs from Python.

## Table of Contents

- [Documentation](#documentation)
- [Requirements](#requirements)
- [Installation](#installation)
- [Support](#support)
- [Reference](#reference)
- [Usage](#usage)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Streaming](#streaming)
- [Pagination](#pagination)
- [Advanced](#advanced)
- [Access Raw Response Data](#access-raw-response-data)
- [Retries](#retries)
- [Timeouts](#timeouts)
- [Custom Client](#custom-client)

## Documentation

API reference documentation is available [here](https://developer.anduril.com/).
Expand Down Expand Up @@ -103,28 +121,28 @@ for chunk in response.data:
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.

```python
import datetime

from anduril import Lattice

client = Lattice(
token="YOUR_TOKEN",
)
response = client.objects.list_objects(
prefix="prefix",
since_timestamp=datetime.datetime.fromisoformat(
"2024-01-15 09:30:00+00:00",
),
page_token="pageToken",
all_objects_in_mesh=True,
)
response = client.objects.list_objects()
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
```

```python
# You can also iterate through pages and access the typed response per page
pager = client.objects.list_objects(...)
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 @@ -142,11 +160,11 @@ response = client.entities.with_raw_response.long_poll_entity_events(...)
print(response.headers) # access the response headers
print(response.data) # access the underlying object
pager = client.objects.list_objects(...)
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)
with client.entities.with_raw_response.stream_entities(...) as response:
Expand Down
48 changes: 41 additions & 7 deletions poetry.lock

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

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "anduril-lattice-sdk"

[tool.poetry]
name = "anduril-lattice-sdk"
version = "3.0.0"
version = "4.0.0"
description = "HTTP clients for the Anduril Lattice SDK"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -35,7 +35,7 @@ packages = [
{ include = "anduril", from = "src"}
]

[project.urls]
[tool.poetry.urls]
Documentation = 'https://developer.anduril.com'
Homepage = 'https://www.anduril.com/lattice-sdk/'
Repository = 'https://github.com/anduril/lattice-sdk-python'
Expand All @@ -51,6 +51,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"
ruff = "==0.11.5"
Expand Down
Loading