### Install PocketBase Python SDK using pip Source: https://github.com/vaphes/pocketbase/blob/master/README.md This command installs the PocketBase Python SDK globally using pip, the standard Python package installer. It ensures the necessary libraries are available for developing applications that interact with PocketBase. ```shell python3 -m pip install pocketbase ``` -------------------------------- ### Install Development Dependencies with Poetry Source: https://github.com/vaphes/pocketbase/blob/master/README.md This command installs all project dependencies specified in the `pyproject.toml` file using Poetry. It sets up the local development environment for the PocketBase Python SDK. ```shell poetry install ``` -------------------------------- ### Set Up and Run PocketBase Integration Tests Source: https://github.com/vaphes/pocketbase/blob/master/README.md These commands set up a temporary directory for email, start a sandboxed PocketBase instance for integration testing, and then execute the pytest suite, including tests that interact with the running sandbox. This allows for real-world testing against a live PocketBase backend. ```shell export TMP_EMAIL_DIR=`mktemp -d` bash ./tests/integration/pocketbase pytest ``` -------------------------------- ### Install PocketBase Python SDK in Editable Mode with pip Source: https://github.com/vaphes/pocketbase/blob/master/README.md This command installs the PocketBase Python SDK in editable mode using pip. This is useful for local development, allowing changes to the source code to be reflected without reinstallation. ```shell python3 -m pip install -e . ``` -------------------------------- ### Authenticate and Interact with PocketBase using Python SDK Source: https://github.com/vaphes/pocketbase/blob/master/README.md This Python snippet demonstrates how to initialize the PocketBase client, authenticate as a regular user or admin, check token validity, list and filter collection records, and create new records including file uploads. It showcases common operations for interacting with a PocketBase backend. ```python from pocketbase import PocketBase # Client also works the same from pocketbase.client import FileUpload client = PocketBase('http://127.0.0.1:8090') # authenticate as regular user user_data = client.collection("users").auth_with_password( "user@example.com", "0123456789") # check if user token is valid user_data.is_valid # or as admin admin_data = client.admins.auth_with_password("test@example.com", "0123456789") # check if admin token is valid admin_data.is_valid # list and filter "example" collection records result = client.collection("example").get_list( 1, 20, {"filter": 'status = true && created > "2022-08-01 10:00:00"'}) # create record and upload file to image field result = client.collection("example").create( { "status": "true", "image": FileUpload(("image.png", open("image.png", "rb"))), }) ``` -------------------------------- ### Build PocketBase Python SDK Package with Poetry Source: https://github.com/vaphes/pocketbase/blob/master/README.md This command builds the distributable package for the PocketBase Python SDK using Poetry. It generates the necessary files for publishing or distributing the library. ```shell poetry build ``` -------------------------------- ### Execute Tests with Pytest via Poetry Source: https://github.com/vaphes/pocketbase/blob/master/README.md This command runs the project's test suite using pytest, managed by Poetry. It executes all defined tests to ensure the SDK's functionality and stability. ```shell poetry run pytest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.