Skip to main content

A job queue management system for distributed computing.

Project description

PyGrabber

PyGrabber is a Python script that implements a simple polling mechanism to grab python scripts from a source system and execute it. The script is designed to be run as a standalone process and can be controlled using Unix signals.

Getting started

  1. Clone the repository:
git clone https://github.com/meirm/pygrabber.git
cd pygrabber
  1. Install the requirements:
pip install -r requirements.txt
  1. Poetry build and install:
poetry build
poetry install

You might need to change the clusterpath variable to point to the location of your data cluster, or change the poll_interval variable to control how often the script should poll for data.

  1. Run the script:
python grabber.py

The script will start polling for data and writing it to a file in the data directory.

Usage

PyGrabber uses a simple polling mechanism to grab data from a source system. The main logic of the script is contained in the run method, which is called by the init method when an instance of the PyGrabber class is created.

By default, the script polls for data every second and writes it to a file in the data directory. You can customize the polling interval by changing the poll_interval variable in the init method.

PyGrabber also supports several Unix signals that can be used to control its behavior. Here are the supported signals:

SIGTERM: stops the script, renames the jobs to "interrupted", and exits

SIGUSR1: dumps the current status of the script

SIGUSR2: pauses or resumes the polling loop

To send a signal to a running instance of PyGrabber, use the kill command with the PID of the Python process that's running the script. For example, to send a SIGTERM signal to a PyGrabber instance with PID 1234, run:

kill -SIGTERM 1234

License

PyGrabber is released under the MIT License. See LICENSE 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

script_grabber-0.1.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

script_grabber-0.1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: script_grabber-0.1.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/24.0.0

File hashes

Hashes for script_grabber-0.1.3.tar.gz
Algorithm Hash digest
SHA256 131619c5bd2dbcc90ac245bc35ad83298161556ee37fd7717f05258c6dcf1249
MD5 427ce40eb74cad138afead444a837e7b
BLAKE2b-256 4f7a513fd34eb26868b60d6a69d06d131f77f9e1325a2ab51f0a5cf287b9df58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: script_grabber-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/24.0.0

File hashes

Hashes for script_grabber-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 252fcbe072273c1dc1d25e89461b6826a353334f0af149e589079c0b027c9eef
MD5 54908bc0e5f25521d1bbe260b739f5ae
BLAKE2b-256 f4150daa6c954052876e2083dbac5e651a720b8abba276d0317e8ce443d862d2

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