Skip to main content

Light CLI Oracle, Postgres, Mysql, Mssql

Project description

About

Universal python client for MYSQL, ORACLE, POSTGRES.

Features

  • Inline CLI usage
  • Script usage
  • CSV Export
  • ZIP export result

Requirements

Language: python>=3.6

Install requirements from internet

pip install -r requirements.txt

Install requirements from local

  1. Download package to specific platform
pip download --platform=manylinux1_x86_64 -r requirements.txt
  1. Copy to destination and install from downloaded packages
pip install -r requirements.txt --no-index --find-links file:///path/to/packages

Install pydb package

pip

  1. Download pydb-x.y.z-py3-none-any.whl
  2. Upgrade pip
  3. Install use pip
pip install --upgrade pip
pip install pydb-x.y.z-py3-none-any.whl

NOTE: x.y.z equal pydb package version.

Usage package

CLI example

dbclient -c "postgres://user:password@hostname:port/database"
command> SELECT * FROM systems ORDER BY id;
+----+-----------------+------------+------------+
| id | system          | system_key | system_eng |
+----+-----------------+------------+------------+
| 1  | Анализаторы SNT | SNT        | None       |
| 2  | Капкан          | KAPKAN     | None       |
| 3  | Спайдер         | SPIDER     | SPIDER     |
| 4  | Профит          | PROFIT     | PROFIT     |
+----+-----------------+------------+------------+

Script example

from pydb.exporter import Exporter
from pydb.dbms import UniDbConnector


cfg = dict(host='localhost', port=3306, user='', password='', database='profit', dbms='mysql')
u = UniDbConnector(config=cfg)

q = 'SELECT * FROM table ;'
data = u.fetchall(query=q)

e = Exporter(filename='data')
e.to_csv(data=data)

Build

python -m pip install --upgrade build
python -m build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xdbcli-1.5.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xdbcli-1.5.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file xdbcli-1.5.1.tar.gz.

File metadata

  • Download URL: xdbcli-1.5.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for xdbcli-1.5.1.tar.gz
Algorithm Hash digest
SHA256 8ae1cb1a115305dac1ff2edb43688ee725c679ab2a391442d5f88e4b233299b7
MD5 0d89e0cc578ae638bcac7ffedbbdccd1
BLAKE2b-256 22ea532adbf9ece28cf702854bce3e6a9ecbbbc301ca150d40ec54826fd1706b

See more details on using hashes here.

File details

Details for the file xdbcli-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: xdbcli-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for xdbcli-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a670e85340aac8ce1934d9ba12accf74b8f0cca34b9609739468145066b773b
MD5 fb86f01d073751ae7d04717b5e13b21e
BLAKE2b-256 49c19993711798deab52b1b5815043220dbb13e68494a5dec93b119a7b9abdf4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page