Skip to main content

A client library for interacting with the ImportIO API

Project description

ImportIO Client

A Python client library for interacting with the ImportIO API. This client provides an easy-to-use interface for managing extractors and crawl runs.

Installation

You can install the ImportIO Client using pip:

pip install importio-client

Usage

Here's a quick start guide to using the ImportIO Client:

from importio_client import ImportIOClient

# Initialize the client
client = ImportIOClient(api_key="your_api_key_here")

# Working with extractors
extractor_id = "your_extractor_id"

# Set inputs for an extractor
client.extractor.set_inputs(extractor_id, "https://example.com")

# Set inputs with default attributes
client.extractor.set_inputs(
    extractor_id,
    ["https://example.com", "https://another.com"],
    default_attributes={"Max Screens": 50, "Browser": "chrome"}
)

# Start a run
run_info = client.extractor.start_run(extractor_id)
print(run_info)

# Get extractor history
history = client.extractor.get_history(extractor_id)
print(history)

# Working with crawl runs
crawl_run_id = "your_crawl_run_id"

# Get crawl run information
crawl_info = client.crawl_run.get_info(crawl_run_id)
print(crawl_info)

# Get a file from a crawl run
from importio_client import FileType
file_content = client.crawl_run.get_file(crawl_run_id, FileType.CSV)

Features

  • Easy-to-use interface for ImportIO API
  • Support for extractor operations (set inputs, start/stop runs, get history)
  • Support for crawl run operations (get info, retrieve files)
  • Flexible input handling for extractors, including support for default attributes
  • Built-in error handling and response parsing

API Reference

ImportIOClient

The main client class for interacting with the ImportIO API.

Methods:

  • __init__(api_key: str): Initialize the client with your API key.

ExtractorEndpoint

Accessible via client.extractor.

Methods:

  • set_inputs(extractor_id: str, inputs: Union[str, List[str], Dict[str, Any], List[Dict[str, Any]]], default_attributes: Dict[str, Any] = None) -> Dict[str, Any]: Set inputs for an extractor.
  • get_inputs(extractor_id: str) -> List[Dict[str, Any]]: Get current inputs for an extractor.
  • get_history(extractor_id: str) -> Dict[str, Any]: Get run history for an extractor.
  • start_run(extractor_id: str) -> Dict[str, Any]: Start a new run for an extractor.
  • stop_run(extractor_id: str) -> Dict[str, Any]: Stop the current run for an extractor.

CrawlRunEndpoint

Accessible via client.crawl_run.

Methods:

  • get_info(crawl_run_id: str) -> Dict[str, Any]: Get information about a specific crawl run.
  • get_file(crawl_run_id: str, file_type: FileType) -> bytes: Get a specific file type for a crawl run.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

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

importio_client-0.2.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

importio_client-0.2.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file importio_client-0.2.2.tar.gz.

File metadata

  • Download URL: importio_client-0.2.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for importio_client-0.2.2.tar.gz
Algorithm Hash digest
SHA256 217ab1287485c4aa9cd9732df7c360ff6569357c3d8a359fc879d7ac93328b8f
MD5 3aa9199a83571ce7d2aa9562102b14eb
BLAKE2b-256 e1407630fa8f8cdb9e85a0712e08d23e6dbc7baca00375f67d636ac8047dd351

See more details on using hashes here.

File details

Details for the file importio_client-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for importio_client-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd1c202c17c04d9ef38165994f55fde1e579fed47a5adfc6c2b4b7d958039e3
MD5 6f6630c8f60b7db024de47db9c6b08fc
BLAKE2b-256 3b8b23ba5ebb557bb6e469e32bdb6946de8e20b5f9c4f4fce6c1ee5be04b3913

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