querysource
Aiohttp web service for querying several databases easily
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 on this page — 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
querysource on PyPI
pip
pip install querysourceuv
uv add querysourcepoetry
poetry add querysourceInstalling 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 the current Python release (<3.14,>=3.10.1) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 65 — LivePopularTimes, hubspot-api-client, httpx, h2, oauth2client, google-analytics-data, google-api-python-client, google-auth-oauthlib, sqloxide, aiocsv, lxml, xlsxwriter, odswriter, odfpy, xlrd, reportlab, APScheduler, bs4, simple_salesforce, psycopg2-binary, sqlalchemy, selenium, snapshot-selenium, webdriver-manager, playwright, proxylists, async-notify, navconfig, navigator-api, jsonschema |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,264/month — #12,477 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: querysource-4.5.11-cp310-cp310-manylinux_2_28_x86_64.whl; querysource-4.5.11-cp310-cp310-musllinux_1_2_x86_64.whl; querysource-4.5.11-cp311-cp311-manylinux_2_28_x86_64.whl; querysource-4.5.11-cp311-cp311-musllinux_1_2_x86_64.whl; querysource-4.5.11-cp312-cp312-manylinux_2_28_x86_64.whl; querysource-4.5.11-cp312-cp312-musllinux_1_2_x86_64.whl; querysource-4.5.11-cp313-cp313-manylinux_2_28_x86_64.whl; querysource-4.5.11-cp313-cp313-musllinux_1_2_x86_64.whl
Keywords: querysource, database, query, aiohttp, web service
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
databasesProvides async database access for PostgreSQL,…
permissive · top 5,000 on PyPI
dbstreamdbstream is a meta package designed to provide…
permissive · top 15,000 on PyPI
influxdbClient library for writing to and querying…
permissive · top 5,000 on PyPI
django-db-connection-poolProvides connection pooling for Django database…
permissive · top 15,000 on PyPI
sqlalchemy-jdbcapiSQLAlchemy dialect for JDBC and ODBC database…
permissive · top 15,000 on PyPI
pysqlsyncSynchronize database schemas and bulk-load data…
permissive · top 15,000 on PyPI
postgresProvides a lightweight abstraction layer over…
permissive · top 15,000 on PyPI
CouchDBA Python client library for interacting with…
permissive · top 15,000 on PyPI
cloudantA Python client library for connecting to and…
permissive · top 15,000 on PyPI
dj-database-urlParses DATABASE_URL environment variables into…
permissive · top 5,000 on PyPI