Metadata-Version: 2.4
Name: BLAPI
Version: 0.1.0
Summary: A Python library for interacting with Bloret Launcher API
Home-page: https://github.com/bloret/bloret-api-tool
Author: Bloret
Author-email: Bloret <contact@bloret.com>
License: MIT
Project-URL: Homepage, https://github.com/bloret/bloret-api-tool
Project-URL: Bug Tracker, https://github.com/bloret/bloret-api-tool/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Bloret Launcher API Tool

A Python library for interacting with Bloret Launcher API. This library can be used both as a module that you can import in your Python applications and as a command-line tool using the `BLAPI` command.

## Installation

```bash
pip install BLAPI
```

Or install from source:

```bash
pip install .
```

## Usage

### As a Library

```python
from BLAPI import Client, request_api

# Using the Client class
client = Client(base_url="https://api.bloret.com", token="your-token")
response = client.request("GET", "/v1/games")

# Using the convenience function
response = request_api("GET", "/v1/games", token="your-token")
```

### As a Command-Line Tool

After installation, you can use the `BLAPI` command:

```bash
# Make a GET request
BLAPI get /v1/games

# Make a POST request with data
BLAPI post /v1/games --data '{"name": "New Game"}'

# Specify a custom base URL and token
BLAPI --base-url https://api.bloret.com --token your-token get /v1/games

# Save output to a file
BLAPI get /v1/games --output games.json
```

## Commands

- `get` - Make a GET request to an endpoint
- `post` - Make a POST request to an endpoint
- `put` - Make a PUT request to an endpoint
- `delete` - Make a DELETE request to an endpoint

## Options

- `--base-url` - Base URL for the API (default: https://api.bloret.com)
- `--token` - Authorization token for API requests
- `--output`, `-o` - Output file (default: stdout)

## Development

To install the package in development mode:

```bash
pip install -e .
```

To run tests:

```bash
pytest
```

## License

MIT
