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
40 changes: 20 additions & 20 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
lockVersion: 2.0.0
id: 5ca2c9b7-aea6-4a23-a631-998fcc6c18a8
management:
docChecksum: 675728091831dc0dbf72fdee4fb1bb47
docVersion: 1.0.124
speakeasyVersion: 1.791.1
generationVersion: 2.926.2
releaseVersion: 0.15.4
configChecksum: d5ae22d28bb3a7fb9b9c681be320d735
docChecksum: 0cd005eeb36ea8cdb1968793fd654c0b
docVersion: 1.0.125
speakeasyVersion: 1.795.0
generationVersion: 2.931.0
releaseVersion: 0.16.0
configChecksum: 3b4af5367a2eba92ef229df970e4068f
repoURL: https://github.com/censys/censys-sdk-python.git
installationURL: https://github.com/censys/censys-sdk-python.git
published: true
persistentEdits:
generation_id: f6e80453-05a4-4158-9101-29da13413f59
pristine_commit_hash: 53f284853f7cef9b754f109af313b93b840bb2e4
pristine_tree_hash: e810a8fa6eeb37f6411df274312bbe683d9e9138
generation_id: c8dc0497-8491-4385-9ee4-a2d59a81241a
pristine_commit_hash: ae9a49004a99a72b99d12e216fd95e746ec66bf4
pristine_tree_hash: b96886713b9f9518d1c5d3d53ff8cf405ec8f7fd
features:
python:
acceptHeaders: 3.0.0
additionalDependencies: 1.1.0
constsAndDefaults: 1.0.7
core: 6.0.35
core: 6.1.0
defaultEnabledRetries: 0.2.0
downloadStreams: 1.0.1
enumUnions: 0.1.1
Expand All @@ -36,9 +36,9 @@ features:
nameOverrides: 3.0.3
nullables: 1.0.2
responseFormat: 1.1.0
retries: 3.0.7
retries: 3.1.0
sdkHooks: 1.3.0
unions: 3.1.8
unions: 3.1.9
trackedFiles:
.gitattributes:
id: 24139dae6567
Expand Down Expand Up @@ -4102,8 +4102,8 @@ trackedFiles:
pristine_git_object: bfd8691be4b4b5ee9f2c4baf849970d807ade207
pyproject.toml:
id: 5d07e7d72637
last_write_checksum: sha1:2c2714854491406227668493e0af9fabb01644ab
pristine_git_object: 3ce85c786a52e2118522ffc814d75e83214aea36
last_write_checksum: sha1:58365b1a1825b4b471d572ca25b0da5779c8cae1
pristine_git_object: 0b806e428ac25c3942c2aa4705be2577e9aacd3c
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:10d6ae008b24c68e99d7e8ba9c2e747070685ead
Expand All @@ -4130,8 +4130,8 @@ trackedFiles:
pristine_git_object: ec32aa84954b1a51f33327002cacd727eb9ab81e
src/censys_platform/_version.py:
id: d2dc39704c23
last_write_checksum: sha1:8fdb90bd62d2fe796e866126a1bafed27480f070
pristine_git_object: a5cd78b2f1cd377a2619367917589b50b3295aaa
last_write_checksum: sha1:3140f14d0fce666b80e47aa590b7a7b2cbf7b67c
pristine_git_object: 2247461a87b134be29bd8974051fec66c11727cd
src/censys_platform/account_management.py:
id: 09993862b047
last_write_checksum: sha1:bd19db50cb8a422da287a12730ebd3520de2d4ee
Expand Down Expand Up @@ -7358,8 +7358,8 @@ trackedFiles:
pristine_git_object: 591415af8e64baa410627b507d2740afb5387d13
src/censys_platform/utils/retries.py:
id: d5aceef1f0a1
last_write_checksum: sha1:3585b891142f30a597fbf7a2f0340700babef8e4
pristine_git_object: ca7b59efebbbd9545744d0207ef42725c4cc5143
last_write_checksum: sha1:481dfc7cd6a07a3987f0f443e91bee72888ae41d
pristine_git_object: c7418a62826fc73990a52e70df0d54093c5e2a57
src/censys_platform/utils/security.py:
id: 1559cefe0793
last_write_checksum: sha1:c11eef495b6aaa249178c24c796940cc540b7a00
Expand All @@ -7378,8 +7378,8 @@ trackedFiles:
pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418
src/censys_platform/utils/values.py:
id: "277559094909"
last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553
pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3
last_write_checksum: sha1:65e1ee8607767a4fc1ae7a55c74d77a23ab3cef1
pristine_git_object: ac217f473c5d52a454a2979b3eb35e66175d365c
examples:
v3-collections-crud-list:
speakeasy-default-v3-collections-crud-list:
Expand Down
3 changes: 2 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 0.15.4
version: 0.16.0
additionalDependencies:
dev: {}
main: {}
Expand Down Expand Up @@ -61,6 +61,7 @@ python:
flatteningOrder: parameters-first
forwardCompatibleEnumsByDefault: true
forwardCompatibleUnionsByDefault: "false"
httpClientLibrary: httpx
imports:
option: openapi
paths:
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
speakeasyVersion: 1.791.1
speakeasyVersion: 1.795.0
sources:
converge-source:
sourceNamespace: converge-source
sourceRevisionDigest: sha256:90529c03d3b04235f84af38090546d2b68694954253d5908f4758875f555910c
sourceBlobDigest: sha256:be5af8ccca1c0834d667b936514f8f4dc3ea6b1d1456c2fdff3709911e644191
sourceRevisionDigest: sha256:4f877d409cab8ab9389f4a7c131446de2cc2091243e068fe3681185ad6866e30
sourceBlobDigest: sha256:906b1637492daccebfb8b6af8cc8b900072d0c2889431fefe04869e7fbb37134
tags:
- latest
- 1.0.124
- 1.0.125
targets:
censys-sdk-python:
source: converge-source
sourceNamespace: converge-source
sourceRevisionDigest: sha256:90529c03d3b04235f84af38090546d2b68694954253d5908f4758875f555910c
sourceBlobDigest: sha256:be5af8ccca1c0834d667b936514f8f4dc3ea6b1d1456c2fdff3709911e644191
sourceRevisionDigest: sha256:4f877d409cab8ab9389f4a7c131446de2cc2091243e068fe3681185ad6866e30
sourceBlobDigest: sha256:906b1637492daccebfb8b6af8cc8b900072d0c2889431fefe04869e7fbb37134
codeSamplesNamespace: converge-source-python-code-samples
codeSamplesRevisionDigest: sha256:8c3f4f5a812749b04738a015b862da93cdfb1c64c5901078182a7845bfdb6009
codeSamplesRevisionDigest: sha256:002602fcd212b144a6ff7ad9b4c4ee9da97e1e25ddf1439378e01e6578d4eb0a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
14 changes: 14 additions & 0 deletions README-PYPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,20 @@ class CustomClient(AsyncHttpClient):

s = SDK(async_client=CustomClient(httpx.AsyncClient()))
```
### httpx2 (Pydantic's httpx fork)

[httpx2](https://httpx2.pydantic.dev/) is Pydantic's maintained fork of `httpx`. To run this SDK on httpx2, call `alias_httpx()` at your program's entry point, before importing the SDK, so every `import httpx` β€” including the ones inside the SDK β€” resolves to `httpx2`:
```python
import httpx2

httpx2.alias_httpx()

from censys_platform import SDK

s = SDK()
```

An SDK can also be generated against httpx2 directly, so it depends on the fork instead of `httpx`, by setting `python.httpClientLibrary: httpx2` in `gen.yaml`.
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,20 @@ class CustomClient(AsyncHttpClient):

s = SDK(async_client=CustomClient(httpx.AsyncClient()))
```
### httpx2 (Pydantic's httpx fork)

[httpx2](https://httpx2.pydantic.dev/) is Pydantic's maintained fork of `httpx`. To run this SDK on httpx2, call `alias_httpx()` at your program's entry point, before importing the SDK, so every `import httpx` β€” including the ones inside the SDK β€” resolves to `httpx2`:
```python
import httpx2

httpx2.alias_httpx()

from censys_platform import SDK

s = SDK()
```

An SDK can also be generated against httpx2 directly, so it depends on the fork instead of `httpx`, by setting `python.httpClientLibrary: httpx2` in `gen.yaml`.
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,14 @@ Based on:
### Generated
- [python v0.15.4] .
### Releases
- [PyPI v0.15.4] https://pypi.org/project/censys-platform/0.15.4 - .
- [PyPI v0.15.4] https://pypi.org/project/censys-platform/0.15.4 - .

## 2026-08-19 00:16:59
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.795.0 (2.931.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.16.0] .
### Releases
- [PyPI v0.16.0] https://pypi.org/project/censys-platform/0.16.0 - .
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "censys-platform"
version = "0.15.4"
version = "0.16.0"
description = "Python Client SDK Generated by Speakeasy."
authors = [{ name = "Speakeasy" },]
readme = "README-PYPI.md"
Expand Down
8 changes: 4 additions & 4 deletions src/censys_platform/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "censys-platform"
__version__: str = "0.15.4"
__openapi_doc_version__: str = "1.0.124"
__gen_version__: str = "2.926.2"
__user_agent__: str = "speakeasy-sdk/python 0.15.4 2.926.2 1.0.124 censys-platform"
__version__: str = "0.16.0"
__openapi_doc_version__: str = "1.0.125"
__gen_version__: str = "2.931.0"
__user_agent__: str = "speakeasy-sdk/python 0.16.0 2.931.0 1.0.125 censys-platform"

try:
if __package__ is not None:
Expand Down
34 changes: 24 additions & 10 deletions src/censys_platform/utils/retries.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ def __init__(self, inner: Exception):
self.inner = inner


_TRANSPORT_ERROR_NAMES = frozenset({"NetworkError", "TimeoutException"})
_TRANSPORT_ERROR_BASES = frozenset({"TransportError", "RequestError", "HTTPError"})


def _is_transport_error(exception: BaseException) -> bool:
"""Report whether an exception is a connection or timeout failure."""
if isinstance(exception, (httpx.NetworkError, httpx.TimeoutException)):
return True
names = {base.__name__ for base in type(exception).__mro__}
return bool(names & _TRANSPORT_ERROR_NAMES) and _TRANSPORT_ERROR_BASES <= names


def _parse_retry_after_header(response: httpx.Response) -> Optional[int]:
"""Parse Retry-After header from response.

Expand Down Expand Up @@ -207,14 +219,15 @@ def do_request() -> httpx.Response:

if res.status_code == parsed_code:
raise TemporaryError(res)
except (httpx.NetworkError, httpx.TimeoutException) as exception:
if retries.config.retry_connection_errors:
raise

raise PermanentError(exception) from exception
except TemporaryError:
raise
except Exception as exception:
if (
_is_transport_error(exception)
and retries.config.retry_connection_errors
):
raise

raise PermanentError(exception) from exception

return res
Expand Down Expand Up @@ -252,14 +265,15 @@ async def do_request() -> httpx.Response:

if res.status_code == parsed_code:
raise TemporaryError(res)
except (httpx.NetworkError, httpx.TimeoutException) as exception:
if retries.config.retry_connection_errors:
raise

raise PermanentError(exception) from exception
except TemporaryError:
raise
except Exception as exception:
if (
_is_transport_error(exception)
and retries.config.retry_connection_errors
):
raise

raise PermanentError(exception) from exception

return res
Expand Down
2 changes: 2 additions & 0 deletions src/censys_platform/utils/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool:

T = TypeVar("T")


def cast_partial(typ):
return partial(cast, typ)


def get_global_from_env(
value: Optional[T], env_key: str, type_cast: Callable[[str], T]
) -> Optional[T]:
Expand Down
Loading