A python API for managing postgresql database
Install and setup
Install third party packages:
sudo apt install python3-dev libpq-dev unixodbc-dev
To install the package
python3 -m pip install acrocord
use python in the proper environment e.g. in conda powershell
Setup database configuration and connection
SSL connection: if SSL connection is required, put the certificates given by administrator in /home/$USER/.postgresql create the folder if it does not already exist
Default connection configuration can be saved in connections.cfg in the folder /home/$USER/.postgresql/ for linux
user or typically C:\Users\$USER\.postgresql for windows user.
Example of connections.cfg:
[connection-name]
user=USERNAME
dbname=DATABASENAME
port=PORT
host=HOST
ssh=False
password=PASSWORD
Then in python the connection can directly be instantiate using the keyword connection-name
from acrocord import ConnectDatabase
db = ConnectDatabase()
db.connect(connection="connection-name")
Alternatively, you can use the following syntax
from acrocord import ConnectDatabase
db = ConnectDatabase()
connection = dict(
user="USERNAME",
print_sql_cmd=True,
dbname="DATABASENAME",
port="PORT",
host="HOST",
ssh=False
)
db.connect(print_sql_cmd=True, connection=connection)
Simple usage
import pandas as pd
# create schema (i.e. an independent database: requires privileges)
# write table in schema
# read table as pandas dataframe
db.create_schema("SCHEMA")
db.write_table(pd.DataFrame(1, index=[1, 2, 3], columns=[1, 2, 3]), "SCHEMA.NAME")
db.read_table("SCHEMA.NAME")
Other topics
- Deploy database: install postresgql server and create database on premise
- Manage spatial data using postgis: how to install postgis and manipulate spatial data
Author
- Eurobios Mews labs
Metadata
Release files for acrocord 2023.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acrocord-2023.3.4.tar.gz | 34.6 kB | Without provenance | Details for acrocord-2023.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acrocord-2023.3.4-py3-none-any.whl | Python 3 | none | any | Details for acrocord-2023.3.4-py3-none-any.whl |
Total release size: 72.1 kB
Release files / acrocord-2023.3.4.tar.gz
| Download URL | acrocord-2023.3.4.tar.gz |
|---|---|
| Size | 34.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
663e6b5833d31f9b9bc480dcc680537960eb494d9519da2327ff5461a3d6a943
|
|
BLAKE2b-256 checksum How to use checksums |
a9d0b17123b882a9e4239caa03eec4bbc06847e19bb8974b497d20051d67cd99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / acrocord-2023.3.4-py3-none-any.whl
| Download URL | acrocord-2023.3.4-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03ef729bf3564753a8270ce08d3f23cad552a4e38ca0e07e1b6cad4ba8db0748
|
|
BLAKE2b-256 checksum How to use checksums |
1634339ecdf498007acc9a07d1a8bfb91258c5b34697d6531769ed6d5103f382
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for acrocord 2023.3.4
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.