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.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b928cefcd2abeeb707c67e9b9abd805f4b7f97ba9317cb1ede59ea250a8a4f57 |
|
MD5 | 8b48794d968652e1638dc2238422e8b6 |
|
BLAKE2b-256 | 146b807c3372ef1f7199ac0e11fcebd7045beb9abced62bb9700cdcfcf9d997b |
Hashes for querysource-3.11.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d16842cbc0af35c06c16770d6416de0c2903915ba59e62dc4e2c9da75a435c9 |
|
MD5 | 786a8390ff7e63b295c3e41d1221796e |
|
BLAKE2b-256 | f4ec67533b0dd07ad51dc41e24bc0c18b87c59cdbf91adf9d729fce9291aa187 |
Hashes for querysource-3.11.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02366f0747deddf02c0d71124f3307331912d0ca5893939380173b8a8b8b2f9 |
|
MD5 | df56b2321d3f713f5f36de2afbb4af40 |
|
BLAKE2b-256 | 47d53fa36d3dc279be26e3d987f2ff0385350cccb855352fc35a96b723748536 |
Hashes for querysource-3.11.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d3edfd0e515060c9abd17481e947e0d7c37433f7aaa3a1e0231b153677c129 |
|
MD5 | ceab719b9bdb6818f99ca0350a7fc042 |
|
BLAKE2b-256 | 526507770ade7cfb406c2e9b086af4141430955fbdf877c23c92ee20b12fb38d |