Python 0.6.0 parity map
September 17, 2026 ยท View on GitHub
Reference: typesafe-sdk-python 0.6.0, revision 420ef4ffb612d5a539a1e0f0fe883ff6770340af.
This is an implementation map, not a certification of complete parity. The current offline suite covers selected contracts; the full Python suite has not been ported and live API compatibility has not been verified. Rows citing an implementation or documentation describe the intended behavior, not an independently tested guarantee.
| Upstream export/feature | PHP equivalent | Evidence | Honest limitation |
|---|---|---|---|
TypeSafeClient | TypeSafe\\TypeSafeClient | tests/ContractTest.php | PHP uses try/finally rather than context manager syntax. |
AsyncTypeSafeClient | TypeSafe\\AsyncTypeSafeClient | async contract test | Guzzle promises/cURL replace asyncio. |
Models / AsyncModels | Models / AsyncModels resources | models tests | No Python async iterator is involved. |
Noul, Choice, Score | same names in TypeSafe\\ | serialization tests | PHP arrays need JsonObject internally for empty/sequential maps. |
NoulModel, ChoiceModel, ScoreModel | Raw question arrays | raw question test | PHP has no TypedDict equivalent; not all upstream static type constraints are represented. |
Question, QuestionModel, Questions | PHPDoc unions and arrays | question validation test | Runtime raw validation intentionally remains shallow. |
JSONValue, JSONContent | Scalars, arrays and stdClass accepted through mixed inputs | serialization test | Recursive JSON aliases are not statically enforced. |
SystemOneResponse | same name | response tests | Derived views are readonly arrays, not cached properties. |
NoulAnswer, ChoiceAnswer, ScoreAnswer | same names | response tests | Score object keys are converted to PHP ints. |
Usage | same name with inputTokens/outputTokens | response tests | billing_units remains intentionally absent, matching public upstream Usage. |
ModelMetadata | same name with releaseDate | models test | Wire key remains release_date. |
ListModelsResponse | same name | models test | Models are a PHP list array rather than Python tuple. |
RetryPolicy | same name, camelCase options | retry contract test | Delay uses Guzzle's millisecond option; no Tenacity dependency. |
TypeSafeError and status subclasses | same names | error contract test | Guzzle transport errors are normalized before escaping the client. |
from_http_response | fromHttpResponse(ResponseInterface, ?RequestInterface) | response test | PSR-7 replaces httpx response/request types. |
request_id, raw_http_response | magic properties plus getRequestId()/getRawHttpResponse() | metadata test | Metadata is unavailable on manually constructed DTOs. |
system_one endpoints | systemOne, models->list | transport tests | Only the two upstream endpoints are implemented. |
| env/default config | camelCase constructor and env names | config coverage | No global app configuration is changed. |
| logging/redaction | PSR-3 Logger adapter | logging implementation | Bodies are not redacted; sanitized URLs omit userinfo/query/fragment. |
| HTTPX timeout phases | float or Timeout | timeout test | Guzzle has no exact write/pool phase analogue; read setting is handler-dependent. |
| async cancellation | Guzzle promise cancel() and client close() | async implementation | Cancellation/close semantics depend on the selected Guzzle handler. |
| context managers / pickling | close() and PHP object lifecycle | lifecycle docs | PHP has neither Python context manager nor pickle protocol. |