Speakeasy Logo
Skip to Content

Product Updates

Python Alpha Release: Pydantic & Async

Nolan Sullivan

Nolan Sullivan

July 10, 2024 - 3 min read

Product Updates

One benefit of having a UK-based engineering hub โ€” no Independence Day! As the US celebrated last week, our UK colleagues were hard at work on the next iteration of our Python SDK Generator.

And itโ€™s thanks to those efforts that weโ€™re able to announce the alpha release of our new Python Generator with support for Async & Pydantic models!

Python Alpha Release: Pydantic & Async

The new generator takes full advantage of the best tooling available in the Python ecosystem to introduce true end-to-end type safety, support for asynchronous operations, and a streamlined developer experience:

  • Full type safety with Pydanticย  models for all request and response objects,
  • Support for both asynchronous and synchronous method calls using HTTPX,
  • Support for typed dicts as method inputs for an ergonomic interface,
  • Poetry for dependency management and packaging,
  • Improved IDE compatibility for a better type checking experience,
  • A DRYer and more maintainable internal library codebase.

Check out the release post for the full details.

If you want to test the new Python Generator, please fill out our Typeformย , or message us on Slack. We will provide you with the necessary information to get started.


TypeScript Bundle Size Reduction

Bundle Size does matter! Which is why weโ€™ve been working hard to reduce the size of our TypeScript SDKs, and weโ€™re happy to announce that weโ€™ve made significant progress. Bundle size has dropped an average of 30% with some SDKs seeing reductions of up to 50%. This is down to a couple recent efforts:

  • Support for ESM - Weโ€™ve implemented support for ECMAScript Modules (ESM) alongside CommonJS. This dual bundling approach improves the ability to tree-shake by allowing developers to choose the format that works best for their needs.
  • DRYer library code - We intentionally prioritize readability and debuggability in our SDKs, but that can sometimes mean duplication. We identified some key areas where we could reduce duplication without sacrificing readability.

This is just the beginning. With the upcoming release of Zod v4 weโ€™ll be able to tree-shake the Zod dependency, and further reduce the bundle size. Stay tuned for further updates!

๐Ÿ New Features and Bug Fixes ๐Ÿ›

The Platform

๐Ÿ› Fix: Correctly display x-speakeasy-error-message
๐Ÿ› Fix: Patch broken usage snippets for SSE-based SDK methods

TypeScript

๐Ÿ Feat: Support building SDKs to ESM or ESM and CJS
๐Ÿ Feat: Refactored Zod Schemas for tree-shaking
๐Ÿ› Fix: Omit barrel exports in ESM for unused model scopes
๐Ÿ› Fix: Added missing imports for open enums in TS

Python

๐Ÿ› Fix: use None as arg default instead of UNSET for optional method arguments

Terraform

๐Ÿ Feat: Support for custom plan modifiers
๐Ÿ Feat: Derive json schema types from const values when not specified

Go

๐Ÿ Feat: Move retry logic out of utils and into a public package

Java

๐Ÿ› Fix: Patched compilation error in client credentials hook when security not flattened

Last updated on

Organize your
dev universe,

faster and easier.

Try Speakeasy Now