Skip to content

Missing Type Annotations/Stubs (.pyi files) for xero-python SDK #180

@jevonearth

Description

@jevonearth

Problem

The xero-python SDK lacks proper type annotations and stub files (.pyi), causing issues with static type checkers, IDE autocompletion, and making it difficult to use the SDK with modern Python development practices.

Impact

Without proper type hints:

  • IDE autocompletion fails to suggest available methods/properties
  • Static type checkers (mypy, pyright) report false errors
  • SDK method signatures are unclear (esp. OAuth2Token and OAuth2 classes)
  • Developers must use defensive programming with hasattr() checks

Value Proposition

Adding type stubs would:

  • Improve developer experience with better IDE integration
  • Reduce runtime errors by catching type-related issues early
  • Make API changes more visible and less breaking
  • Reduce need for defensive programming patterns

Related Issues

Would help resolve:

Proposed Solution

Add proper type annotations to the SDK or provide separate stub files (.pyi) that define the public API interface with appropriate types.

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