polling2


Namepolling2 JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttp://github.com/ddmee/polling2
SummaryUpdated polling utility with many configurable options
upload_time2021-07-19 18:06:54
maintainer
docs_urlNone
authorDonal Mee
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            [![Build Status](https://travis-ci.com/ddmee/polling2.svg?branch=master)](https://travis-ci.org/ddmee/polling2)
[![PyPI](https://img.shields.io/pypi/dm/polling2.svg)]()
[![PyPI](https://img.shields.io/pypi/v/polling2.svg)]()

# polling2

_Never write another polling function again!_

Documentation available at [Read the Docs](https://polling2.readthedocs.io)

You can install the package from [Pypi](https://pypi.org/project/polling2/)

Polling2 is a powerful python utility used to wait for a function to return a certain expected condition.

Some possible uses cases include:

- Wait for API response to return with code 200
- Wait for a file to exist (or not exist)
- Wait for a thread lock on a resource to expire

Polling2 is handy for getting rid of all that duplicated polling-code. Often, applications require retrying until the correct response is returned. Why re-implement the ability to poll again and again? Use Polling2!

Polling2 is a fork of the original [polling](https://github.com/justiniso/polling). It was forked when the original maintainer failed to respond to issues or PRs. 

Polling2 is _under active development_. Would you like to see a particular feature? Ask and thou shall recieve.

## Installation

```
pip install polling2
```

## Development installation

```shell
# install lib, but use system links from the repo into sitepackages.
python setup.py develop
# install test dependenices.
python setup.py test
# run the tests
pytest tests
```

## Example:

```python
# This call will wait until the file exists, checking every 0.1 seconds and stopping after 3 seconds have elapsed
file_handle = polling2.poll(
    lambda: open('/tmp/myfile.txt'),
    ignore_exceptions=(IOError,),
    timeout=3,
    step=0.1)

# Polling will return the value of your polling function, so you can now interact with it
file_handle.close()
```

There are [more examples](https://polling2.readthedocs.io/en/latest/examples) in the documentation.

## API and user guide at [Read the Docs](https://polling2.readthedocs.io)

[![Read the Docs](https://raw.githubusercontent.com/ddmee/polling2/master/ext/read_the_docs.png)](https://polling2.readthedocs.io)



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/ddmee/polling2",
    "name": "polling2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Donal Mee",
    "author_email": "mee.donal@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/04/9d/6a560ab95e1b92dfce97321d8ffc9f20d352fa4b12a91525d4c575df1c74/polling2-0.5.0.tar.gz",
    "platform": "",
    "description": "[![Build Status](https://travis-ci.com/ddmee/polling2.svg?branch=master)](https://travis-ci.org/ddmee/polling2)\n[![PyPI](https://img.shields.io/pypi/dm/polling2.svg)]()\n[![PyPI](https://img.shields.io/pypi/v/polling2.svg)]()\n\n# polling2\n\n_Never write another polling function again!_\n\nDocumentation available at [Read the Docs](https://polling2.readthedocs.io)\n\nYou can install the package from [Pypi](https://pypi.org/project/polling2/)\n\nPolling2 is a powerful python utility used to wait for a function to return a certain expected condition.\n\nSome possible uses cases include:\n\n- Wait for API response to return with code 200\n- Wait for a file to exist (or not exist)\n- Wait for a thread lock on a resource to expire\n\nPolling2 is handy for getting rid of all that duplicated polling-code. Often, applications require retrying until the correct response is returned. Why re-implement the ability to poll again and again? Use Polling2!\n\nPolling2 is a fork of the original [polling](https://github.com/justiniso/polling). It was forked when the original maintainer failed to respond to issues or PRs. \n\nPolling2 is _under active development_. Would you like to see a particular feature? Ask and thou shall recieve.\n\n## Installation\n\n```\npip install polling2\n```\n\n## Development installation\n\n```shell\n# install lib, but use system links from the repo into sitepackages.\npython setup.py develop\n# install test dependenices.\npython setup.py test\n# run the tests\npytest tests\n```\n\n## Example:\n\n```python\n# This call will wait until the file exists, checking every 0.1 seconds and stopping after 3 seconds have elapsed\nfile_handle = polling2.poll(\n    lambda: open('/tmp/myfile.txt'),\n    ignore_exceptions=(IOError,),\n    timeout=3,\n    step=0.1)\n\n# Polling will return the value of your polling function, so you can now interact with it\nfile_handle.close()\n```\n\nThere are [more examples](https://polling2.readthedocs.io/en/latest/examples) in the documentation.\n\n## API and user guide at [Read the Docs](https://polling2.readthedocs.io)\n\n[![Read the Docs](https://raw.githubusercontent.com/ddmee/polling2/master/ext/read_the_docs.png)](https://polling2.readthedocs.io)\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Updated polling utility with many configurable options",
    "version": "0.5.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3dee5bf2556ebd6db12590788207575c7c75b1de62f5ddc8b4916b668e04e6b",
                "md5": "87b5e02c4d9a4284ac21682624ed82f3",
                "sha256": "ad86d56fbd7502f0856cac2d0109d595c18fa6c7fb12c88cee5e5d16c17286c1"
            },
            "downloads": -1,
            "filename": "polling2-0.5.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87b5e02c4d9a4284ac21682624ed82f3",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 6431,
            "upload_time": "2021-07-19T18:06:53",
            "upload_time_iso_8601": "2021-07-19T18:06:53.681824Z",
            "url": "https://files.pythonhosted.org/packages/a3/de/e5bf2556ebd6db12590788207575c7c75b1de62f5ddc8b4916b668e04e6b/polling2-0.5.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "049d6a560ab95e1b92dfce97321d8ffc9f20d352fa4b12a91525d4c575df1c74",
                "md5": "72d101f9432ece5d218b6a5546d8a921",
                "sha256": "90b7da82cf7adbb48029724d3546af93f21ab6e592ec37c8c4619aedd010e342"
            },
            "downloads": -1,
            "filename": "polling2-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "72d101f9432ece5d218b6a5546d8a921",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6549,
            "upload_time": "2021-07-19T18:06:54",
            "upload_time_iso_8601": "2021-07-19T18:06:54.951448Z",
            "url": "https://files.pythonhosted.org/packages/04/9d/6a560ab95e1b92dfce97321d8ffc9f20d352fa4b12a91525d4c575df1c74/polling2-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-19 18:06:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ddmee",
    "github_project": "polling2",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "test_requirements": [
        {
            "name": "mock",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "polling2"
}
        
Elapsed time: 0.03185s