Skip to main content

JobPoller

A Python library for polling and processing jobs from API endpoints.

Installation

pip install superbright-jobpoller

Features

  • Configurable API endpoints and authentication
  • Flexible job processing with customizable scripts
  • Robust logging and error handling
  • Simple interface for creating job processing services

Usage

Basic Usage

from jobpoller import JobProcessor, JobConfig

# Create configuration
config = JobConfig(
    api_url="https://api.example.com",
    api_key="your-api-key",
    poll_endpoint="/queue/next",
    log_dir="queue_logs"
)

# Create job processor
processor = JobProcessor(
    config=config,
    logger_name="QueueProcessor",
    process_script="process_job.py",
    script_executor="python"
)

# Run the processor
processor.run()

Custom Job Processing

from jobpoller import JobProcessor, JobConfig

# Create configuration
config = JobConfig(
    api_url="https://api.example.com",
    api_key="your-api-key",
    poll_endpoint="/renders/next",
    log_dir="render_logs"
)

# Custom job parser function
def parse_render_job(job_data):
    job_id = job_data.get("msgId")
    message = json.loads(job_data.get("message"))
    return {
        "job_id": job_id,
        "floorPlanId": message.get("floorPlanId"),
        "styleId": message.get("styleId")
    }

# Create job processor
processor = JobProcessor(
    config=config,
    logger_name="RenderProcessor",
    process_script="process_blend_automated.sh",
    script_executor="bash",
    job_parser=parse_render_job
)

# Run the processor
processor.run()

Publish the package:

python -m build
twine upload dist/*

License

MIT

Metadata

Release files for superbright-jobpoller 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superbright-jobpoller 0.3.0
File Size Uploaded Provenance Actions
superbright_jobpoller-0.3.0.tar.gz 6.6 kB Without provenance Details for superbright_jobpoller-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for superbright-jobpoller 0.3.0
File Interpreter ABI Platform Actions
superbright_jobpoller-0.3.0-py3-none-any.whl Python 3 none any Details for superbright_jobpoller-0.3.0-py3-none-any.whl

Total release size: 13.6 kB

Release files / superbright_jobpoller-0.3.0.tar.gz

Download URL superbright_jobpoller-0.3.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c257c019a95f64045ce9bcf973704764e470a05e9ae51c30037449737d3ba00f
BLAKE2b-256 checksum
How to use checksums
64ce20f7ff50d413e40840421b2780c225fbaaf552239d045bf95713406116e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.13

Release files / superbright_jobpoller-0.3.0-py3-none-any.whl

Download URL superbright_jobpoller-0.3.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8957f8a1a9b78ace0fbf65154f9ffd30513f638a67e0776f16aa787f723f9ea
BLAKE2b-256 checksum
How to use checksums
736627dce639e406dd976db5c82a166e4f54a5583322e74da9c8418ccda5c351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.13

Security for superbright-jobpoller 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page