Skip to main content

Python client for the AutoCare API

Project description

AutoCare Python Client

A Python client library for interacting with AutoCare Association databases and services.

Features

  • OAuth2 authentication with automatic token refresh
  • Database and table listing
  • Record fetching with pagination support
  • Comprehensive error handling and logging
  • Type safety with dataclasses
  • Context manager support

Installation

git clone <repository-url>
cd autocare-python
uv sync --all-extras

Quick Start

from autocare.client import AutoCareAPI

# Initialize client
with AutoCareAPI(
    client_id="your_client_id",
    client_secret="your_client_secret",
    username="your_username",
    password="your_password"
) as client:
    # List databases
    databases = client.list_databases()

    # List tables
    tables = client.list_tables("VCdb")

    # Fetch records
    records = client.fetch_all_records("VCdb", "Make")

    # Or iterate with pagination
    for record in client.fetch_records("VCdb", "BaseVehicle", limit=1000):
        print(record)

API Reference

Main Methods

  • list_databases() - List available databases
  • list_tables(db_name) - List tables in a database
  • fetch_records(db_name, table_name, limit=None, page_size=None) - Fetch records with pagination
  • fetch_all_records(db_name, table_name) - Fetch all records as a list
  • validate_credentials() - Validate API credentials

Data Classes

  • DatabaseInfo - Database metadata
  • TableInfo - Table metadata
  • APIResponse - API response wrapper

Exceptions

  • AuthenticationError - Authentication failures
  • APIConnectionError - Connection issues
  • APIResponseError - API error responses
  • DataValidationError - Data validation failures

Development

Setup

# Install dev dependencies
just dev-sync

# Install pre-commit hooks
just install-hooks

Commands

just validate    # Run all checks (format, lint, test)
just format      # Format code
just lint        # Run linting
just test        # Run tests

Configuration

Set environment variables or use parameters:

AUTOCARE_CLIENT_ID=your_client_id
AUTOCARE_CLIENT_SECRET=your_client_secret
AUTOCARE_USERNAME=your_username
AUTOCARE_PASSWORD=your_password

Requirements

  • Python 3.13+
  • Valid AutoCare API credentials

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autocare-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autocare-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file autocare-0.1.0.tar.gz.

File metadata

  • Download URL: autocare-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for autocare-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32f7e632c6bcfec60591c26f178ece4399f303e57ae4f6bbd743d5fb029a217e
MD5 8436e76c9352235fbc1104f442453c48
BLAKE2b-256 c6ec52ea95d6b3c3f0b3d8c1cd95e1c85469b666c62b96c58716335ebc7e4e4b

See more details on using hashes here.

File details

Details for the file autocare-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: autocare-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for autocare-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 284249e2cf338766e00eff1806e44116de32a0aabf018e58b3d611be169dc42b
MD5 8cfd943c56e4110cd1f68d066245c859
BLAKE2b-256 addc8b3781ce33272501e7656e9b2e2f5c8e42b4daf0f83d949d9d5acf6de34e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page