Skip to main content

Python Query Language PQL

PQL is a python wrapper of the sql sintax based in SQLalchemy and pandas, this code introduces a new syntax to use in your code when calling a database table.

Requirements

You only need a distribution of python3 installed.

⚙️Installation:

You can install the requirements (preferably in an environment) using:

pip install PythonQueryLanguage

Basic Usage:

PQL is managed by a class called SQLManager, to instanciated you will need to pass your connection strings in a dictionary and the enviroment you are willoing to use

connection_dict = {'test_env': 'connection string from engine', 'prod_env': 'mssql+pyodbc://ur@prod.com/url2?driver=ODBC+Driver+17+for+SQL+Server' } env = 'test_env' pql = SQLManager(connection_dict,env)

Once you have instanciated the class you can use it with his convenient functions that will wrap SQL expresions.

pql.select_all('tableA','id','myid') = SELECT * FROM tableA WHERE id = 'myid

PQL supports searchs in arrays:

pql.select_all('tableA','id',['myid','myid2']) = SELECT * FROM tableA WHERE id IN ('myid','myid2')

PQL cast the data in a inteligent manner:

pql.select_all('tableA',['id','name'],['myid','myName']) = SELECT * FROM tableA WHERE id = 'myid' AND myName = 'myid2'

PQL accepts adiotional arguments:

pql.select('column','tableA',['id','name'],['myid','myName'],'OR') = SELECT column FROM tableA WHERE id = 'myid' OR myName = 'myid2'

PQL accepts direct evaluation or raw sql expressions (thougt only recommended in edge cases)

pql.query("SELECT * FROM tableA WHERE id = 'myid") = SELECT * FROM tableA WHERE id = 'myid'

PQL accepst function and Store procedure evaluations.

Multy enviroment usage.

PQL is built to support working with different db environments at the same time, this multi enviroment work can be done in different ways:

    1. Instanciate the PQLmanager with different enviroments and run them.
    1. Changing the enviroment of the class with the change_enviroment method.
    1. Using scoped functions.

Example of scoped functions:

You are working in a database test enviroment but you need to extract some data from the production enviroment without changing the enviroment of the PQLmanager Then you can query the table at producion using a scope:

pql.select_all('TableA',env='prod')

This function will run in the production environment and retrieve the information from it without changing your global environment.

IUD

PQL supports Insert Update Delete Operations, all these operations are based in pandas dataframes.

Interactive.

PQL is thought to be used in a jupyter notebook as well as used in real code. PQL contains different functionalities that allows the user to know what query will be executed in the database and confirmation security.

Metadata

Release files for pythonquerylanguage 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythonquerylanguage 0.1.8
File Size Uploaded Provenance Actions
pythonquerylanguage-0.1.8.tar.gz 7.7 kB Without provenance Details for pythonquerylanguage-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pythonquerylanguage 0.1.8
File Interpreter ABI Platform Actions
pythonquerylanguage-0.1.8-py3-none-any.whl Python 3 none any Details for pythonquerylanguage-0.1.8-py3-none-any.whl

Total release size: 16.1 kB

Release files / pythonquerylanguage-0.1.8.tar.gz

Download URL pythonquerylanguage-0.1.8.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7f006fd13ff9fe68d948e2cbb3c670e41f25fe75475ee4ffaebb8d28166862db
BLAKE2b-256 checksum
How to use checksums
2e201275b03809da82fafcce9c653a24a35c7b8f10ce7cad234497fc9eb1da11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.2 Linux/6.2.0-20-generic

Release files / pythonquerylanguage-0.1.8-py3-none-any.whl

Download URL pythonquerylanguage-0.1.8-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
956fad18a1cde5ed615e7b6cd9ab6051a15b118c3341e07571656899a5d51953
BLAKE2b-256 checksum
How to use checksums
f51a2f828f40fabd137507c87ec1ed1a33160ec1fa5e67590199f6b34626c3bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.2 Linux/6.2.0-20-generic

Security for pythonquerylanguage 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page