Driver for Polypheny
Project description
# Polypheny Connector for Python
This enables Python programs to access Polypheny databases, using an API that is compliant with the [Python Database API Specification v2.0 (PEP 249)](https://www.python.org/dev/peps/pep-0249/).
## Installation
The recommended way to install the Python Connector for Polypheny is via pip:
```bash
pip install polypheny
```
Alternatively, if you prefer to install the package manually you can also download the latest [release](https://github.com/polypheny/Polypheny-Connector-Python/releases/), extract the archive and install it manually:
```bash
cd /path/to/polyphney-connector-python-x.y.z/
python setup.py install
```
## Getting Started
A few examples of the most common functionalities provided by the adapter:
```python3
import polypheny
# Connect to locally running Polypheny via UNIX sockets (on Linux, BSD and macOS)
con = polypheny.connect()
# Unencrypted over the network (all systems)
con = polypheny.connect(
('127.0.0.1', 20590),
username='pa',
password='',
transport='plain',
)
# Get a cursor
cursor = con.cursor()
# Create a new table
cursor.execute("CREATE TABLE dummy (id INT NOT NULL, text VARCHAR(2), num INT, PRIMARY KEY(id))")
# Insert values into table
cursor.execute("INSERT INTO dummy VALUES (407 , 'de', 93)")
con.commit()
# Execute a query
cursor.execute("SELECT * from dummy")
print("\nRelational results from SQL")
for row in cursor:
print("\t", row)
# Accessing data using MQL
cursor.executeany('mongo', 'db.dummy.find()', namespace='public')
print("\nDocument results from MQL (as Python dicts)")
for doc in cursor:
print("\t", doc)
cursor.execute("DROP TABLE dummy")
# Close the connection
con.close()
```
An in-depth and more detailed documentation can be found [here](https://docs.polypheny.com/en/latest/drivers/python/overview).
## Tests
Run the tests with coverage report:
```
coverage run --source polypheny -m pytest && coverage report -m
```
## Roadmap
See the [open issues](https://github.com/polypheny/Polypheny-DB/labels/A-python) for a list of proposed features (and known issues).
## Contributing
We highly welcome your contributions to the _Polypheny Connector for Python_. If you would like to contribute, please fork the repository and submit your changes as a pull request. Please consult our [Admin Repository](https://github.com/polypheny/Admin) and our [Website](https://polypheny.org) for guidelines and additional information.
Please note that we have a [code of conduct](https://github.com/polypheny/Admin/blob/master/CODE_OF_CONDUCT.md). Please follow it in all your interactions with the project.
## License
The Apache 2.0 License
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 Distribution
polypheny-1.0.0.tar.gz
(15.2 kB
view details)
File details
Details for the file polypheny-1.0.0.tar.gz.
File metadata
- Download URL: polypheny-1.0.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8553a0d50ed45cf365df14ce4e8c21ed55fbff45fdcc1cdd8ee0440d4ffee411
|
|
| MD5 |
6fc4c653d5016dfd6c27d927f32e5d9c
|
|
| BLAKE2b-256 |
1b3477fcd1f3b63d965d25543921423fdc24e1ff0cc530be5a2bf9ee17c0f904
|
Provenance
The following attestation bundles were made for polypheny-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on polypheny/Polypheny-Connector-Python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polypheny-1.0.0.tar.gz -
Subject digest:
8553a0d50ed45cf365df14ce4e8c21ed55fbff45fdcc1cdd8ee0440d4ffee411 - Sigstore transparency entry: 167815591
- Sigstore integration time:
-
Permalink:
polypheny/Polypheny-Connector-Python@21b8bedae563676c025ce7275ddae420e48e5e4a -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/polypheny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@21b8bedae563676c025ce7275ddae420e48e5e4a -
Trigger Event:
release
-
Statement type: