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.7.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5173668f075ec5043fa24230f4ca1e235befc9acda31439f6e66e5403b875d2 |
|
MD5 | 3044cf34a80be8cbc545c39c18ca5a41 |
|
BLAKE2b-256 | 897764d4b94163f025771f60b096a8968b7669560890695152970d2277b6b660 |
Hashes for querysource-3.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55010163ac6cd7b7a548c5496355356babc232196562dd82e7e60af9e6715036 |
|
MD5 | 07da5232fea40e11d9199cdf0945fb9d |
|
BLAKE2b-256 | 234a865b907db18431d0469d48050b32124086ef7004df99622c6e87f015e048 |
Hashes for querysource-3.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16240ae486562025b6f01381bf1be5c0464662e49fe31278e359ab41b0fe500e |
|
MD5 | b2e468b46bb6509478a9ed1b6ebdd677 |
|
BLAKE2b-256 | 4e6bdd60baf0bc29b219cdb77e5da7d09625cef1b387bc0870b9be0d424bc169 |