QuerySource is a Library for Querying Databases. QuerySource Query parser and generator.
Project description
QuerySource
QuerySource is a powerful Python library designed to streamline access to multiple databases and external APIs through a single, unified interface. Utilizing the proxy design pattern, QuerySource allows developers to seamlessly integrate various data sources into their projects without worrying about the complexities of managing multiple connections.
Features
- Unified interface for querying multiple databases (Redis, PostgreSQL, MySQL, Oracle, SQL Server, InfluxDB, CouchDB, Druid)
- Support for external APIs (Salesforce, ShopperTrack, ZipCodeAPI, etc.)
- Easy-to-use API for executing queries
- Extensible design, allowing for easy addition of new data sources
Installation
$ pip install querysource
---> 100%
Successfully installed querysource
Requirements
- Python >= 3.9
- asyncio (https://pypi.python.org/pypi/asyncio/)
Basic Usage
QuerySource can be used in several ways, one is using QS object itself:
from querysource.queries.qs import QS
query = QS(
query='SELECT * FROM tests',
output_format='pandas'
)
result, error = await query.query()
Extending QuerySource
To add support for a new data source, create a new class inheriting from the BaseProvider or BaseAPI class and implement the required methods (prepare_connection, query, close). Then, register the new data source in the QuerySource class by adding it to the appropriate dictionary (_supported_databases or _supported_apis).
Contributing
We welcome contributions to QuerySource! If you'd like to contribute, please follow these steps:
- Fork the repository
- Create a new branch for your feature or bugfix
- Implement your changes
- Add tests covering your changes
- Create a pull request against the original repository
Contribution guidelines
- Writing tests
- Code review
- Other guidelines
License
QuerySource is released under the BSD License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for querysource-3.11.20-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6590a80ca9f97cd8562f49e153ee99245e940dd563d2cc945fd26fc68e79b7b4 |
|
MD5 | b34ddead44c1ab4534fed1930d7b67ce |
|
BLAKE2b-256 | e94b0d46351b37b2560ba389f115621c4f6cefe8ebb494ca33c06bc121235d9d |
Hashes for querysource-3.11.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ea0509de8731b7514bdb7a8763b55c955334c7ca2d605a6dbd39c5ea7c16eb9 |
|
MD5 | 13f994ec155e53dca2ae696140cdb89e |
|
BLAKE2b-256 | cdfd3bdc9a123ce0cb100d14cb7d6d258632a8814d62530a70729b216cb9426b |
Hashes for querysource-3.11.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787443cc8b66440d87fa70e4ba018fe5cc443df8e21ac0879f4784f99529f2ee |
|
MD5 | 8d4de853839d3dec3d06a316203f970a |
|
BLAKE2b-256 | 5870182904f2d08d3c924390b02a43b5ceda07db352ecc356e5f508668761e6e |
Hashes for querysource-3.11.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9a455e84fd6290ff524a7bca442fb552fe23ef7f2fb47d714b592e3387ced4a |
|
MD5 | fc65552866c53ec0c5adfaeae5012ed4 |
|
BLAKE2b-256 | 92db8eab13fbbc9a361f9d4a7bbe878d5dcd82a3bbea77cd142d63ba39b57b8a |