Skip to content

Conversation

@scottanderson-smartsheet

🚧 Work In Progress - Proof of Concept

This PR adds async/await support to the Smartsheet Python SDK to resolve event loop blocking issues in FastMCP and other async frameworks.

What's Included

PoC Scope

  • AsyncSmartsheet client with async context manager support
  • AsyncSheets.add_rows() method
  • AsyncWorkspaces.list_workspaces() method
  • ✅ Shared operation builders (zero code duplication)
  • ✅ Comprehensive async tests (25+ tests)
  • ✅ FastMCP integration tests
  • ✅ Complete documentation

Architecture

  • Uses httpx for unified sync/async HTTP client
  • Shared operation builders in smartsheet/operations/
  • Both sync and async classes use same operation building logic
  • Zero duplication of operation logic
  • 100% backward compatible

Key Features

  • ✅ Non-blocking async/await API
  • ✅ Resolves FastMCP event loop blocking
  • ✅ Zero code duplication via shared operations
  • ✅ 100% backward compatible
  • ✅ Production-ready (error handling, retry logic, SSL/TLS)

Testing

pytest tests/test_async_poc.py tests/test_async_fastmcp_integration.py -v

Documentation

Next Steps

  • Review architecture and approach
  • Expand to additional API methods
  • Performance benchmarking
  • Additional integration testing

Related Issues

Resolves event loop blocking in FastMCP services.

@roomote
Copy link
Contributor

roomote bot commented Jan 8, 2026

Rooviewer Clock   Follow along on Roo Cloud

Reviewing your PR now. Feedback on the way!

- Implement AsyncSmartsheet client with async/await support
- Add async versions of Sheets.add_rows() and Workspaces.list_workspaces()
- Create shared operation builders to eliminate code duplication
- Refactor sync classes to use shared operations
- Add comprehensive async tests including async framework integration tests
- Add documentation: async-quickstart.md, ASYNC_MIGRATION.md, examples
- Resolves event loop blocking issues in async frameworks

PoC scope: Foundation + add_rows + list_workspaces
Dependencies: httpx>=0.27.0, pytest-asyncio>=0.21.0
asyncio.run(main())
```

### Installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The details about async should be in ADVANCED.md

Async support requires the `httpx` library:

```bash
pip install smartsheet-python-sdk httpx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should look into optional dependencies for python packages. This way the customer can install a package using pip install smartsheet-python-sdk[async] which would install httpx instead of requests.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants