--- id: modern-treasury version: "1.79.0" license: MIT license_treatment: permissive maintenance: active --- # modern-treasury — The official Python library for the Modern Treasury API License: permissive · Maintenance: active · Downloads: 635.8K/mo ## What it is and what it does Modern Treasury is the official Python SDK for the Modern Treasury REST API, a financial operations platform. It wraps HTTP calls to manage counterparties, external accounts, payments, and other treasury functions, offering both sync and async clients powered by httpx. The library includes full type hints (TypedDict for requests, Pydantic models for responses) and auto-paginating iterators for list endpoints, so you can work with typed data and let the SDK handle pagination automatically. The package is designed for Python 3.9+ applications that need to integrate with Modern Treasury's API. It requires credentials (organization_id and api_key) passed as environment variables or constructor arguments. Dependencies are lightweight and standard (httpx for HTTP, pydantic for validation, anyio and sniffio for async support). The library handles error cases with specific exception types (APIConnectionError, RateLimitError, APIStatusError) and supports file uploads via bytes or PathLike objects. Use it for: - Create and manage counterparties (vendors, customers) in a financial system programmatically. - Build async payment processing workflows that fetch and process paginated lists of transactions. - Integrate treasury operations (external accounts, payments) into a Python web application or backend service. - Automate document uploads associated with financial entities using the file upload interface. - Handle API errors gracefully with typed exception classes for connection, rate limit, and status errors. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a typed Python client library for the Modern Treasury REST API, with both synchronous and asynchronous interfaces for managing financial operations like counterparties and external accounts. Yes. This is the official SDK for Modern Treasury's API, actively maintained with no known vulnerabilities, low install friction, and permissive licensing. Install it if you need to integrate with Modern Treasury in Python 3.9+. The typed interface and async support make it suitable for both simple scripts and production services. ## Install pip install modern-treasury uv add modern-treasury poetry add modern-treasury ## Installing modern-treasury Before you install: Low friction: pure Python wheel with six common dependencies (httpx, pydantic, anyio, distro, sniffio, typing-extensions). Actively maintained—last commit 2026-08-13, released 2026-07-27, no known vulnerabilities. License in practice: MIT license (permissive): you can use, modify, and distribute this library freely in commercial and private projects, with minimal restrictions. Quickstart: pip install modern-treasury import os from modern_treasury import ModernTreasury client = ModernTreasury( organization_id=os.environ.get("MODERN_TREASURY_ORGANIZATION_ID"), api_key=os.environ.get("MODERN_TREASURY_API_KEY"), ) counterparty = client.counterparties.create(name="my first counterparty") print(counterparty.id) Requires Python 3.9 or later; API credentials (organization_id and api_key) must be set via environment variables. Verify before relying: - Whether aiohttp backend option (mentioned in docs) is included in the base install or requires a separate extra. - Rate limiting and retry behavior specifics beyond the error types documented. - File upload streaming behavior and memory footprint for large files. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 635.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags modern treasury api client, python financial api library, treasury management sdk, async rest api client, typed api wrapper, payment operations api, counterparty management, api-client, async-support, typed [View on SkillFed](https://skillfed.io/packages/modern-treasury) · [View on PyPI](https://pypi.org/project/modern-treasury/)