--- id: querysource version: "4.5.11" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # querysource — Aiohttp web service for querying several databases easily License: permissive · Maintenance: active · Downloads: 110.3K/mo ## What it is and what it does QuerySource is an async Python library that abstracts away the complexity of connecting to and querying multiple databases and external APIs. Instead of writing separate connection logic for PostgreSQL, Redis, Salesforce, and other sources, you define a single QS object with your query and output format, then await the result. It uses the proxy design pattern to route queries to the appropriate backend handler. The library carries substantial dependency weight—65 runtime packages including database drivers (psycopg2-binary, sqlalchemy), web automation tools (selenium, playwright), API clients (hubspot-api-client, simple_salesforce), and async utilities. This breadth reflects its goal to support many data sources out of the box, but means you inherit all those dependencies even if you only use a subset of backends. It targets Python 3.10.1 and above, is actively maintained (last commit 2026-08-07), and carries no known vulnerabilities. Use it for: - Build a data pipeline that pulls from PostgreSQL, Redis, and Salesforce without managing separate connection pools. - Create an async web service that queries multiple databases and APIs through a single unified interface. - Prototype rapid data integrations by leveraging pre-built connectors for common sources like ShopperTrack and ZipCodeAPI. - Extend QuerySource with custom data sources by inheriting BaseProvider or BaseAPI and registering the new handler. - Execute parameterized queries across heterogeneous backends and normalize results into a common format (e.g., pandas). ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. QuerySource provides a unified async interface to query multiple databases (PostgreSQL, MySQL, Redis, Oracle, InfluxDB, CouchDB, Druid, SQL Server) and external APIs (Salesforce, ShopperTrack, ZipCodeAPI) through a single proxy-based abstraction layer. Yes, if you need to query multiple heterogeneous data sources (databases and APIs) in an async context and can absorb the 65-dependency footprint. The active maintenance, recent release, permissive license, and zero known vulnerabilities support adoption. No, if you only need a single database driver or want a minimal dependency footprint—the proxy abstraction is not worth the overhead for single-source use cases. ## Install pip install querysource uv add querysource poetry add querysource ## Installing querysource Before you install: Medium install friction due to 65 runtime dependencies including database drivers (psycopg2-binary, sqlalchemy), web clients (selenium, playwright, httpx), and specialized connectors (hubspot-api-client, simple_salesforce). Recent release (9 days old) and active maintenance signal confidence in the codebase. License in practice: BSD-3-Clause is permissive and imposes minimal restrictions; you may use, modify, and distribute QuerySource in commercial projects provided you retain the license notice and disclaimer. Quickstart: from querysource.queries.qs import QS query = QS( query='SELECT * FROM tests', output_format='pandas' ) result, error = await query.query() Requires Python >= 3.10.1 and < 3.14; async/await context required; database or API credentials must be configured separately. Verify before relying: - How to configure connections for specific databases or APIs (documentation link provided but content not verified). - Whether all 65 runtime dependencies are always required or if they are optional per data source. - Performance characteristics and query latency across different backend types. - Extent of type hints coverage (marked 'Typed' but depth unknown). ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 110.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unified database query interface, multi-database abstraction layer, async database connector, query multiple data sources, database proxy pattern, salesforce postgresql redis query, async data source aggregation, async-query-abstraction, multi-backend-connector [View on SkillFed](https://skillfed.io/packages/querysource) · [View on PyPI](https://pypi.org/project/querysource/)