Skip to main content

Pure Python Chirp client for HTCondor

Project description


Pure Python Chirp client for HTCondor


The latest release is available on PyPI:

pip install htchirp

However, if HTCondor job sandbox space is a premium, most of HTChirp's functionality can be accessed from as a standalone script or module.

Example Usage

There are multiple ways to invoke HTChirp inside a HTCondor job environment.

Using HTChirp inside Python

First, you can use an HTChirp object as part of a larger Python workflow connect to the Chirp server and issue commands:

Using context management (recommended):

>>> import htchirp
>>> with htchirp.HTChirp() as chirp:
>>>     chirp.ulog('Logging use of Chirp in Python')
>>>     me = chirp.whoami()
>>>     chirp.set_job_attr('UsingPythonChirp', 'True')
>>>     using_chirp = chirp.get_job_attr('UsingPythonChirp')
>>> me
>>> using_chirp

Using manual connection and disconnection (not recommended):

>>> import htchirp
>>> chirp = htchirp.HTChirp()
>>> chirp.connect()
>>> chirp.write('Important output 1\n', '/tmp/my-job-output', 'cwa')
>>> chirp.write('Important output 2\n', '/tmp/my-job-output', 'cwa')
>>>'/tmp/my-job-output', 1024)
'Important output 1\nImportant output 2\n'
>>> chirp.fetch('/tmp/my-job-output', './my-job-output')
>>> chirp.disconnect()

For more information on the available commands, see help(htchirp.HTChirp).

Using HTChirp on the command line

Second, you can use HTChirp on the command line with the same commands and arguments supported by the condor_chirp utility, either by including with your job or by installing the HTChirp package inside a virtual environment inside your job.

Using from within the working directory:

$ python ulog "Logging use of Chirp in Python"
$ python whoami
$ python set_job_attr UsingPythonChirp True
$ python get_job_attr UsingPythonChirp

Using condor_htchirp after installing HTChirp in an active virtual environment:

$ condor_htchirp ulog "Logging use of Chirp in Python"
$ condor_htchirp whoami
$ condor_htchirp set_job_attr UsingPythonChirp True
$ condor_htchirp get_job_attr UsingPythonChirp

Using python -m htchirp after installing HTChirp in an active virtual environment:

$ python -m htchirp ulog "Logging use of Chirp in Python"
$ python -m htchirp whoami
$ python -m htchirp set_job_attr UsingPythonChirp True
$ python -m htchirp get_job_attr UsingPythonChirp

For a list of commands and arguments, pass --help to your preferred command line invokation, or see the condor_chirp man page.

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

htchirp-3.0.tar.gz (18.7 kB view hashes)

Uploaded source

Built Distribution

htchirp-3.0-py2.py3-none-any.whl (18.3 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page