Background image
Featured blog post image

Python Alpha Release: Pydantic & Async

New features to the Speakeasy Platform - July 10, 2024

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 (opens in a new tab) 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 (opens in a new tab), 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 🐛

Info Icon

NOTE

Based on the most recent CLI version: Speakeasy v2.361.11 (opens in a new tab)

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