Skip to main content

A Python client for interacting with the APCloudy platform

Project description

APCloudy

PyPI version Python versions License: MIT Documentation Status Downloads Code style: black

A Python client library for interacting with the APCloudy platform. This library provides a simple and intuitive interface for managing projects, spiders, and jobs on the APCloudy web scraping platform.

📚 Documentation

Complete documentation is available at apcloudy.readthedocs.io

Features

  • Project Management: Create, update, and manage your APCloudy projects
  • Spider Management: Deploy and manage web scraping spiders
  • Job Management: Start, monitor, and manage scraping jobs
  • Authentication: Secure API key-based authentication
  • Error Handling: Comprehensive error handling with custom exceptions
  • Rate Limiting: Built-in rate limiting support

Installation

Install apcloudy using pip:

pip install apcloudy

Quick Start

from apcloudy import APCloudyClient

# Initialize the client with your API key
client = APCloudyClient("your-api-key-here")

# Get all projects
projects = client.get_projects()

# Get a specific project
project = client.get_project("project-id")

# List spiders in a project
spiders = client.get_spiders("project-id")

# Start a job
job = client.start_job("project-id", "spider-name")

# Get job status
job_status = client.get_job("job-id")

API Reference

APCloudyClient

The main client class for interacting with the APCloudy API.

Methods

  • get_projects(): List all projects
  • get_project(project_id): Get a specific project
  • get_spiders(project_id): List spiders in a project
  • get_spider(project_id, spider_name): Get a specific spider
  • start_job(project_id, spider_name, **kwargs): Start a new job
  • get_job(job_id): Get job details
  • get_jobs(project_id): List jobs for a project
  • stop_job(job_id): Stop a running job

Models

  • Project: Represents an APCloudy project
  • Spider: Represents a spider within a project
  • Job: Represents a scraping job
  • JobState: Enumeration of possible job states

Exceptions

  • APIError: Base exception for API errors
  • AuthenticationError: Raised when authentication fails
  • ProjectNotFoundError: Raised when a project is not found
  • SpiderNotFoundError: Raised when a spider is not found
  • JobNotFoundError: Raised when a job is not found
  • RateLimitError: Raised when rate limits are exceeded

Development

Installing for Development

git clone https://github.com/yourusername/apcloudy.git
cd apcloudy
pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black apcloudy/
flake8 apcloudy/

Type Checking

mypy apcloudy/

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

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

apcloudy-0.1.3.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

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

apcloudy-0.1.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file apcloudy-0.1.3.tar.gz.

File metadata

  • Download URL: apcloudy-0.1.3.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for apcloudy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b0489327f65b6165169070b42a8f903cde3bc1448898a2c4a3de023880c0ac6a
MD5 8ae8f5fc5785c5530e8cf2ae6b60be73
BLAKE2b-256 8ec10174fb20a2dc4dc681b5ba852fae9643e46feda44460f1928d7c8c392ad0

See more details on using hashes here.

File details

Details for the file apcloudy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: apcloudy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for apcloudy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7a38cffb1d3ebb633645a1dae30b7e441ed0010cab2b7e4bdcda4f7f8ef8d8ea
MD5 1a6f372142803159a05ccc0bbd7a70cd
BLAKE2b-256 daae50cc0a3aa3fe2dc17375a805a9d0af823e3e13db07e6b3d6c931554b2f10

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