htchirp


Namehtchirp JSON
Version 3.0 PyPI version JSON
download
home_pagehttps://htcondor.org
SummaryPure Python Chirp client for HTCondor
upload_time2023-11-22 17:20:45
maintainer
docs_urlNone
authorJason Patton
requires_python
licenseASL 2.0
keywords htcondor chirp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HTChirp

Pure Python Chirp client for HTCondor

## Installation

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 [`htchirp.py`](htchirp/htchirp.py)
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**):
```python
>>> 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
'CONDOR'
>>> using_chirp
'true'
```

Using manual connection and disconnection (*not recommended*):
```python
>>> import htchirp
>>> chirp = htchirp.HTChirp()
>>> chirp.connect()
>>> chirp.write('Important output 1\n', '/tmp/my-job-output', 'cwa')
19
>>> chirp.write('Important output 2\n', '/tmp/my-job-output', 'cwa')
19
>>> chirp.read('/tmp/my-job-output', 1024)
'Important output 1\nImportant output 2\n'
>>> chirp.fetch('/tmp/my-job-output', './my-job-output')
38
>>> 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`](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html)
utility, either by including
`htchirp.py` with your job or by installing the HTChirp package inside a
virtual environment inside your job.

Using `htchirp.py` from within the working directory:
```
$ python htchirp.py ulog "Logging use of Chirp in Python"
$ python htchirp.py whoami
CONDOR
$ python htchirp.py set_job_attr UsingPythonChirp True
$ python htchirp.py get_job_attr UsingPythonChirp
True
```

Using `condor_htchirp` after installing HTChirp in an active virtual
environment:
```
$ condor_htchirp ulog "Logging use of Chirp in Python"
$ condor_htchirp whoami
CONDOR
$ condor_htchirp set_job_attr UsingPythonChirp True
$ condor_htchirp get_job_attr UsingPythonChirp
True
```

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
CONDOR
$ python -m htchirp set_job_attr UsingPythonChirp True
$ python -m htchirp get_job_attr UsingPythonChirp
True
```

For a list of commands and arguments, pass `--help` to your preferred
command line invokation, or see the
[`condor_chirp` man page](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html).


            

Raw data

            {
    "_id": null,
    "home_page": "https://htcondor.org",
    "name": "htchirp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "htcondor chirp",
    "author": "Jason Patton",
    "author_email": "jpatton@cs.wisc.edu",
    "download_url": "https://files.pythonhosted.org/packages/5e/0e/83fa678ba98d3f323d5cbc567c990ec1d2bf3f8a14de34b4c1cf6c80d298/htchirp-3.0.tar.gz",
    "platform": null,
    "description": "# HTChirp\n\nPure Python Chirp client for HTCondor\n\n## Installation\n\nThe latest release is available on PyPI:\n\n`pip install htchirp`\n\nHowever, if HTCondor job sandbox space is a premium, most of HTChirp's\nfunctionality can be accessed from [`htchirp.py`](htchirp/htchirp.py)\nas a standalone script or module.\n\n## Example Usage\n\nThere are multiple ways to invoke HTChirp inside a HTCondor job\nenvironment.\n\n### Using HTChirp inside Python\nFirst, you can use an HTChirp object as part of a larger Python workflow\nconnect to the Chirp server and issue commands:\n\nUsing context management (**recommended**):\n```python\n>>> import htchirp\n>>> with htchirp.HTChirp() as chirp:\n>>>     chirp.ulog('Logging use of Chirp in Python')\n>>>     me = chirp.whoami()\n>>>     chirp.set_job_attr('UsingPythonChirp', 'True')\n>>>     using_chirp = chirp.get_job_attr('UsingPythonChirp')\n>>> me\n'CONDOR'\n>>> using_chirp\n'true'\n```\n\nUsing manual connection and disconnection (*not recommended*):\n```python\n>>> import htchirp\n>>> chirp = htchirp.HTChirp()\n>>> chirp.connect()\n>>> chirp.write('Important output 1\\n', '/tmp/my-job-output', 'cwa')\n19\n>>> chirp.write('Important output 2\\n', '/tmp/my-job-output', 'cwa')\n19\n>>> chirp.read('/tmp/my-job-output', 1024)\n'Important output 1\\nImportant output 2\\n'\n>>> chirp.fetch('/tmp/my-job-output', './my-job-output')\n38\n>>> chirp.disconnect()\n```\n\nFor more information on the available commands, see `help(htchirp.HTChirp)`.\n\n\n### Using HTChirp on the command line\nSecond, you can use HTChirp on the command line with the same commands\nand arguments supported by the\n[`condor_chirp`](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html)\nutility, either by including\n`htchirp.py` with your job or by installing the HTChirp package inside a\nvirtual environment inside your job.\n\nUsing `htchirp.py` from within the working directory:\n```\n$ python htchirp.py ulog \"Logging use of Chirp in Python\"\n$ python htchirp.py whoami\nCONDOR\n$ python htchirp.py set_job_attr UsingPythonChirp True\n$ python htchirp.py get_job_attr UsingPythonChirp\nTrue\n```\n\nUsing `condor_htchirp` after installing HTChirp in an active virtual\nenvironment:\n```\n$ condor_htchirp ulog \"Logging use of Chirp in Python\"\n$ condor_htchirp whoami\nCONDOR\n$ condor_htchirp set_job_attr UsingPythonChirp True\n$ condor_htchirp get_job_attr UsingPythonChirp\nTrue\n```\n\nUsing `python -m htchirp` after installing HTChirp in an active\nvirtual environment:\n```\n$ python -m htchirp ulog \"Logging use of Chirp in Python\"\n$ python -m htchirp whoami\nCONDOR\n$ python -m htchirp set_job_attr UsingPythonChirp True\n$ python -m htchirp get_job_attr UsingPythonChirp\nTrue\n```\n\nFor a list of commands and arguments, pass `--help` to your preferred\ncommand line invokation, or see the\n[`condor_chirp` man page](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html).\n\n",
    "bugtrack_url": null,
    "license": "ASL 2.0",
    "summary": "Pure Python Chirp client for HTCondor",
    "version": "3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/htcondor/htchirp/issues",
        "Homepage": "https://htcondor.org",
        "Source": "https://github.com/htcondor/htchirp/"
    },
    "split_keywords": [
        "htcondor",
        "chirp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff8922b880adae452b82a759658f736cb0527ee16201d50ba960f742e199885e",
                "md5": "8114d3a93be1cb2021a4a1fb32adc070",
                "sha256": "5aefcc784a4037490fc74e879756e16b849e6e9658cbb0c3d20edffa65019e0d"
            },
            "downloads": -1,
            "filename": "htchirp-3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8114d3a93be1cb2021a4a1fb32adc070",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 18277,
            "upload_time": "2023-11-22T17:20:44",
            "upload_time_iso_8601": "2023-11-22T17:20:44.559793Z",
            "url": "https://files.pythonhosted.org/packages/ff/89/22b880adae452b82a759658f736cb0527ee16201d50ba960f742e199885e/htchirp-3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e0e83fa678ba98d3f323d5cbc567c990ec1d2bf3f8a14de34b4c1cf6c80d298",
                "md5": "71ea71795bae85f464758c8555c5a475",
                "sha256": "e036cbf772c6597e47ddd1bdb4efcd088b64dbd76f6ae4cfe92ba4bad8eb23af"
            },
            "downloads": -1,
            "filename": "htchirp-3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "71ea71795bae85f464758c8555c5a475",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18691,
            "upload_time": "2023-11-22T17:20:45",
            "upload_time_iso_8601": "2023-11-22T17:20:45.567170Z",
            "url": "https://files.pythonhosted.org/packages/5e/0e/83fa678ba98d3f323d5cbc567c990ec1d2bf3f8a14de34b4c1cf6c80d298/htchirp-3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-22 17:20:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "htcondor",
    "github_project": "htchirp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "htchirp"
}
        
Elapsed time: 0.37602s