Skip to main content

Lightweight package exposing only OpenAI's Python types as `openai_types`

Project description

OpenAI Python Types

Tiny package that exposes only the openai SDK's types as openai_types, keeping install size as small as possible while staying in sync with upstream.

Install

  • pip install openai-python-types

Usage

  • Instead of from openai.types.realtime.realtime_audio_formats import RealtimeAudioFormats use from openai_types.realtime.realtime_audio_formats import RealtimeAudioFormats.

What’s Included

  • Only the upstream src/openai/types tree, vendored under openai_types/types.
  • A tiny _models.BaseModel shim (pydantic v2) needed by the generated types.
  • Auto-generated import proxies so openai_types.<module> maps to openai_types.types.<module>.

What’s Not Included

  • No client logic, transport, or other openai SDK files — keeping the wheel minimal.

Syncing with Upstream

  • A GitHub Action (.github/workflows/sync.yml) runs hourly and on demand to:
    • Fetch the latest OpenAI Python release tag
    • Copy src/openai/types into this repo
    • Generate import proxies
    • Bump this package version to match upstream
    • Open a PR with changes
    • Build a wheel and run a smoke import test against it

Releasing

  • On PR merge to main, a workflow (.github/workflows/tag-on-merge.yml) tags the repo as v<version> if pyproject.toml version changed.
  • Publishing workflow (.github/workflows/release.yml) automatically uploads to PyPI on tag push v*.*.*.
  • Configure repository secret PYPI_API_TOKEN for automated publishing.

Local Development

  • Run python scripts/sync_types.py to sync locally.
  • Build locally with python -m build.

Notes

  • Requires Python 3.8+ and pydantic>=2 at runtime.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_python_types-1.107.2.tar.gz (206.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_python_types-1.107.2-py3-none-any.whl (643.8 kB view details)

Uploaded Python 3

File details

Details for the file openai_python_types-1.107.2.tar.gz.

File metadata

  • Download URL: openai_python_types-1.107.2.tar.gz
  • Upload date:
  • Size: 206.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for openai_python_types-1.107.2.tar.gz
Algorithm Hash digest
SHA256 d6acb5ae72b626c959a6887f30aa14d59bad12ffee012160912556dcb6f29ced
MD5 5a4de7ba9ef7376dc6fe550b7448bf8a
BLAKE2b-256 18f42e0c31ab0c485b5d4cdc0cb0a9a0628cbd1de21e8416ea0cd80fe74983c9

See more details on using hashes here.

File details

Details for the file openai_python_types-1.107.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_python_types-1.107.2-py3-none-any.whl
Algorithm Hash digest
SHA256 36599d4845e60f184edd786b7a3cf81dac2e9bde3980818296c08f280efce65c
MD5 ff2f589703e1dc66f6d1ac39381c8bde
BLAKE2b-256 06a3c9f802ed5dc51e280cb849508a071060d79f697966703bedf2ce76fc9ea6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page