Skip to content

[Enhancement] Add py.typed marker for PEP 561 static type checker discoverability #784

Description

@deepgram-robot

Summary

Add a py.typed marker file to the Deepgram Python SDK package for PEP 561 compliance, enabling static type checkers (mypy, pyright, pytype) to automatically discover and use the SDK's type annotations without requiring separate type stubs.

Problem it solves

Developers using static type checkers in their projects cannot automatically resolve Deepgram SDK types because the package lacks a PEP 561 py.typed marker. This means IDE autocompletion, type inference, and error detection do not work reliably with the SDK. Developers must manually configure type checker paths or suppress type errors, which undermines trust in the SDK's type safety and creates friction in professional Python development workflows where strict type checking is standard.

Proposed API

No API changes — this is a packaging enhancement:

  1. Add an empty py.typed file to the deepgram/ package root
  2. Include py.typed in the package's package_data or MANIFEST.in so it's distributed with the package
  3. Ensure all public-facing types are properly annotated
# After this change, developers get automatic type resolution:
from deepgram import DeepgramClient

client = DeepgramClient()  # mypy/pyright now resolves all methods and return types
response = client.listen.rest.v("1").transcribe_file(payload)
response.results  # IDE shows full type info with autocompletion

Acceptance criteria

  • py.typed marker file exists in the distributed package
  • mypy --strict and pyright can resolve SDK types without configuration
  • Documented with usage example
  • Compatible with existing API
  • Verified with both mypy and pyright in CI

Raised by the DX intelligence system.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions