semvec/pypi-packages huggingface dataset:
dbuper-cli 0.1.1.0
A tool for automated database backups and scheduling.
Requires Python: >=3.6

# dbuper
# Getting Started

## Introduction
`dbuper` is a database backup tool designed for seamless, automated backups with support for multiple storage options, including local directories, Google Drive, and Dropbox. It provides a straightforward command-line interface for managing backups, scheduling, and configuration, allowing you to set up regular backups and easily retrieve stored backups when needed.

## Prerequisites
To use `dbuper`, ensure you have:
- **Python 3.8+** installed on your system.
- **pip** or **pipx** for installation.
- **Database Client Tools** like `mysqldump` (for MySQL).
- **Cloud SDKs** (if using cloud storage), such as Google Drive API credentials or Dropbox SDK, configured for seamless integration.

## Installation
You can install `dbuper` globally via pip or pipx:

### Using pip (Recommended for Virtual Environments)
```bash
pip install dbuper
```

### Using pipx (Recommended for Global Installation)
```bash
pip install pipx
pipx install dbuper
```
To verify the installation, run:

```bash
dbuper --version
```

## Usage
### Configuration
Set up a database configuration with dbuper by specifying the required connection details. This configuration makes it easier to reuse and manage multiple backup sources.

```bash
dbuper register --name mydatabase --host localhost --user dbuser --password dbpass
```
### List Configurations
View all registered database configurations to confirm your setup:

```bash
dbuper list
```

### Backup
1. Local Backup:

```bash
dbuper backup --config-name mydatabase --local-path /path/to/backup
```
2. Google Drive Backup:

```bash
dbuper backup --config-name mydatabase --cloud gdrive --gdrive-folder-id your_folder_id --gdrive-config-file path_to_gdrive_config.json
```

3. Dropbox Backup:

```bash
dbuper backup --config-name mydatabase --cloud dropbox --dropbox-token your_dropbox_token
```

### Schedule Backups
1. Local Scheduled Backup:

```bash
dbuper schedule:backup --config-name mydatabase --interval 60 --local-path /path/to/backup
```

2. Google Drive Scheduled Backup:

```bash
dbuper schedule:backup --config-name mydatabase --interval 60 --cloud gdrive --gdrive-folder-id your_folder_id --gdrive-config-file path_to_gdrive_config.json
```

3. Dropbox Scheduled Backup:

```bash
dbuper schedule:backup --config-name mydatabase --interval 60 --cloud dropbox --dropbox-token your_dropbox_token
```

### List Schedules
To view all active backup schedules, use:

```bash
dbuper schedule:list
```

### Version
Check the installed version of dbuper:

```bash
dbuper --version
```

This outline provides a concise and clear guide to getting started with `dbuper`, covering all essential commands for setup and use. Let me know if you’d like more details on any section!
triahr-client 1.0.0
Python client for interacting with the Tria HR API
Requires Python: >=3.7

# Tria HR API Client

A Python client for interacting with the Tria HR API. This library provides easy access to attendance, organization units, and company data.

## Installation

```bash
pip install triahr-client
```

## Configuration

You can initialize the client either directly or using a configuration file.

### Using Configuration File

Create a `config.ini` file:

```ini
[Environment]
stage = https://stage.company.triahr.com
prod = https://company.triahr.com

[OAuth]
client_id = your_client_id
client_secret = your_client_secret
```

Initialize the client:

```python
from triahr import TriaHRAPI

# Initialize using config file (defaults to 'stage' environment)
api = TriaHRAPI.from_config()

# Or specify a different environment
api = TriaHRAPI.from_config(environment='prod')
```

### Direct Initialization

```python
from triahr import TriaHRAPI

api = TriaHRAPI(
    base_url="https://stage.decasport.triahr.com",
    client_id="your_client_id",
    client_secret="your_client_secret"
)
```

## Usage Examples

### Test Connection

```python
response = api.ping()
api.format_response(response)
```

### Get Organization Units

```python
# Get organization units for a specific company
org_units = api.organization_units(company_id="158")
api.format_response(org_units)

# Get attendance organization units
attendance_units = api.attendance_organization_units(company_id="158")
api.format_response(attendance_units)
```

### Get Attendance Plan

```python
attendance = api.attendance_plan(
    date_from="2024-01-01",
    date_to="2024-01-31",
    unit_id=123,
    mode="plan"  # or "reality" for published data
)
api.format_response(attendance)
```

### Save Response to File

```python
response = api.companies()
api.format_response(response, save_to_file="companies.json")
```

### Custom API Requests

```python
# Make a custom GET request
response = api.undefined_request(
    endpoint="/api/v1/custom-endpoint/",
    params={"param1": "value1"}
)

# Make a custom POST request
response = api.undefined_request(
    endpoint="/api/v1/custom-endpoint/",
    method="POST"
)
```

## Available Methods

- `ping()`: Test API connection
- `companies()`: Get list of companies
- `organization_units(company_id)`: Get organization units for a company
- `attendance_organization_units(company_id)`: Get plannable attendance units
- `attendance_plan(date_from, date_to, ...)`: Get attendance plan data
- `undefined_request(endpoint, method, params)`: Make custom API requests

## Authentication

The client handles OAuth2 authentication automatically, including token refresh. You only need to provide the client ID and secret.

## Error Handling

The client will raise `requests.exceptions.HTTPError` for any API errors. Handle these appropriately in your application:

```python
try:
    response = api.companies()
except requests.exceptions.HTTPError as e:
    print(f"API error: {e}")
```