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.6.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a847ee5fbfba2b0cbd5be53da5adc23b33588c9b9c6e0783f5ea6b3cc36b25 |
|
MD5 | 79315eeab6436a4abd84e9afb215737b |
|
BLAKE2b-256 | d8817fce816e290253c0e177ec3bbed472ae551f59caea21a2e5d08ddf73d64f |
Hashes for querysource-3.6.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e5e82ff512d947534f9cca5fd037d58f2028eb0ea8270eafcc50f4862c94c9 |
|
MD5 | 0e276886ebfa41c922185007de5d7b26 |
|
BLAKE2b-256 | a76ecb6e4bf215323ca27d5d5f5e8e6a5cc52935a9d9cdb0c8a7581d1378c1c8 |
Hashes for querysource-3.6.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cc32b17d909f68f7dc19b9f607bb6079fb34a813ff0de0210665da8e5a9fbdb |
|
MD5 | 74d5fc40a9700384846f8dae21a1a3f1 |
|
BLAKE2b-256 | aa08dcc1c5896e83bc4ec081963d7f9f644114d8756ae6952604fccf2b0843d8 |