Metadata-Version: 2.1
Name: pocketpybase
Version: 0.1.5
Summary: A Python package for interacting with PocketBase
Author: Champ
Author-email: cs@two02.io
Description-Content-Type: text/markdown
Requires-Dist: httpx

# PocketBase Python Client

A Python client for interacting with PocketBase, a backend for your next SaaS and Mobile app.

## Installation

To install the PocketBase Python client, use pip:

```
pip install pocketpybase
```

## Usage

First, import and initialize the PocketBase client:

```python
from pocketbase import PocketBase

pb = PocketBase('https://your-pocketbase-url.com', 'your_username', 'your_password')
```

### Creating a record

```python
record = {
    'field1': 'value1',
    'field2': 'value2'
}
created_record = pb.create_record('your_collection_name', record)
```

### Getting a record by ID

```python
record = pb.get_record_by_id('your_collection_name', 'record_id')
```

### Updating a record

```python
updated_record = {
    'field1': 'new_value1',
    'field2': 'new_value2'
}
pb.update_record('your_collection_name', 'record_id', updated_record)
```

### Deleting a record

```python
pb.delete_record('your_collection_name', 'record_id')
```

### Creating a collection

```python
collection_name = 'new_collection'
db_type = 'base'
schema = [
    {
        'name': 'field1',
        'type': 'text',
        'required': True
    },
    {
        'name': 'field2',
        'type': 'number',
        'required': False
    }
]
pb.create_collection(collection_name, db_type, schema)
```

### Getting an authentication token

```python
token = pb.get_token()
```

## Features

- Create, read, update, and delete records
- Create new collections
- Authenticate and retrieve tokens
- Easily extensible for additional PocketBase features

## Dependencies

- httpx

## License

[MIT License](LICENSE)
