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.4.tar.gz (7.2 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.4-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: importio_client-0.2.4.tar.gz
  • Upload date:
  • Size: 7.2 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.4.tar.gz
Algorithm Hash digest
SHA256 e4fb8f8c42b058dc55e0f6f9111abd7f9e0c8745d09f5555791dcae51233d970
MD5 1013fcf3000b167cd5c9218e5e721a65
BLAKE2b-256 a055e9785ca2d79677d7ec168b9271b233156e5009804099086a13ae058ae786

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for importio_client-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d85c274813c925c14bf5c26946517bfe9f501a0caf15fbfdc98284c8f93dba3
MD5 4d07209ba2c373d6d393b85cfc8c4b4e
BLAKE2b-256 10af473ae38d776026095d7bf1b9e3f6f10dee5cbbaf38b0ac4ac171f33411ff

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