semvec/pypi-packages huggingface dataset:
dbyoke 0.1.3
A library to unify database connections and drivers
License: MIT
Requires Python: >=3.10
Keywords: database connection drivers unification

# DbYoke

DbYoke is a library designed to standardize database connections. It supports multiple drivers (PostgreSQL,
MSSQL, Oracle) and simplifies connection string generation and connection management.

## Features

- Simplified database connection management.
- Support for PostgreSQL, Microsoft SQL Server, and Oracle.
- Unified interface for working with database drivers.
- Connection string generation.

---

## Installation

You can install **DbYoke** using `pip install dbyoke`.

### Install from PyPI

To install the library with all available drivers:

```bash
pip install dbyoke[all]
```
To install only specific drivers, use the following commands:

•	For PostgreSQL:
```bash
pip install dbyoke[postgresql]
```
•	For Oracle:
```bash
pip install dbyoke[oracle]
```
•	For MSSQL:
```bash
pip install dbyoke[mssql]
```

Optional Dependencies

DbYoke provides optional dependencies for different database drivers. You can install the specific drivers you need by using the extras feature of pip. For example, to install support for PostgreSQL, you can use:
```bash
pip install dbyoke[postgresql]
```

## Quick Start

Connecting to a Database

Example for PostgreSQL

```py
from dbyoke.connection import DatabaseConnection

config = {
    "db_type": "postgresql",
    "dbname": "example_db",
    "user": "admin",
    "password": "secret",
    "host": "localhost",
    "port": 5432
}

with DatabaseConnection(config) as db:
    connection = db.connect()
    cursor = connection.cursor()
    cursor.execute("SELECT * FROM my_table")
    print(cursor.fetchall())
```

Example for MSSQL

```py
from dbyoke.connection import DatabaseConnection

config = {
    "db_type": "mssql",
    "dbname": "example_db",
    "user": "admin",
    "password": "secret",
    "host": "localhost",
    "driver": "{ODBC Driver 18 for SQL Server}",
    "trust_certificate": "yes"
}

with DatabaseConnection(config) as db:
    connection = db.connect()
    cursor = connection.cursor()
    cursor.execute("SELECT 1")
    print(cursor.fetchall())
```

Generating a Connection String

```py
from dbyoke.connection_string import ConnectionStringBuilder

config = {
    "db_type": "oracle",
    "user": "system",
    "password": "oracle",
    "host": "localhost",
    "port": 1521,
    "service_name": "XE"
}

builder = ConnectionStringBuilder(config)
print(builder.build())
# Output: "system/oracle@localhost:1521/XE"
```

## Logging

To enable logging, you can use the following utility function:

```py
from dbyoke.utils import configure_logging

logger = configure_logging(level="DEBUG")
```

## Supported Databases

| Database Type | Driver         | Dependency        |
|---------------|----------------|-------------------|
| PostgreSQL    | Psycopg2Driver | `psycopg2-binary` |
| MSSQL         | PyODBCDriver   | `pyodbc`          |
| Oracle        | OracleDriver   | `oracledb`        |
astronomer-e2e-test 0.4.0
Astronomer scripts for internal use
License: MIT
Requires Python: <4.0,>=3.12

# Astronomer end to end testing

This repository contains a set of test files
for validating Astronomer Platform functionality.
It uses the [Python Behave](https://behave.readthedocs.io/en/latest/)
framework to create literate tests and output.

CircleCI: https://circleci.com/gh/astronomer/workflows/astronomer_e2e_test

Docker Hub: https://hub.docker.com/r/astronomerinc/ap-e2e-test

## Tests

See the platform/features directory for details.

Current:

- Auth
  - Login with CLI
  - Login with API
- Workspaces
  - List
  - Create
  - Delete
  - Change Active
- Deployment
  - List
  - Create [local, celery, k8s]
  - Delete

### TODO

- DAGs of various types (will require Docker engine be available)
- Known regressions that should be fixed

### Usage

These tests are used via `helm test` in the astronomer/astronomer repository.

You will need a user on the platform you intend to test.

### With Docker

#### Run

```shell
docker run --rm -it \
  -e ASTRO_USER="name@domain.com" \
  -e ASTRO_PASS="..." \
  -e HOUSTON_URL="https://houston.my-base-domain.com/v1" \
  astronomerinc/ap-e2e-test:latest
```

## Building the package

### Docker image

```sh
docker build -t astronomerinc/ap-e2e-test:latest .
```

### Python wheel

```sh
poetry build -f wheel
```

#### Run

```sh
cd platform

# Run all tests
behave

# Run specific test
behave features/000_auth.feature
```

## Releasing

First, bump the version and show th your changes:

```sh
poetry version <major|minor|patch>
git commit -m "version 9.8.7"  # whatever version shows up in `git diff`
```

```sh
poetry publish --username="$PYPI_USERNAME" --password="$PYPI_PASSWORD"
```