pebble

Multi threading and processing eye-candy.

https://github.com/noxdafox/pebble

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 19 committers (5.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.7%) to scientific vocabulary

Keywords

asyncio decorators multiprocessing pool python threading
Last synced: 6 months ago · JSON representation

Repository

Multi threading and processing eye-candy.

Basic Info
  • Host: GitHub
  • Owner: noxdafox
  • License: lgpl-3.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 896 KB
Statistics
  • Stars: 614
  • Watchers: 8
  • Forks: 56
  • Open Issues: 1
  • Releases: 12
Topics
asyncio decorators multiprocessing pool python threading
Created over 12 years ago · Last pushed 7 months ago
Metadata Files
Readme License Code of conduct

README.rst

Pebble
======

Pebble provides a neat API to manage threads and processes within an application.

:Source: https://github.com/noxdafox/pebble
:Documentation: https://pebble.readthedocs.io
:Download: https://pypi.org/project/Pebble/

|build badge| |docs badge| |downloads badge|

.. |build badge| image:: https://github.com/noxdafox/pebble/actions/workflows/action.yml/badge.svg
   :target: https://github.com/noxdafox/pebble/actions/workflows/action.yml
   :alt: Build Status
.. |docs badge| image:: https://readthedocs.org/projects/pebble/badge/?version=latest
   :target: https://pebble.readthedocs.io
   :alt: Documentation Status
.. |downloads badge| image:: https://img.shields.io/pypi/dm/pebble
   :target: https://pypistats.org/packages/pebble
   :alt: PyPI - Downloads

Examples
--------

Run a job in a separate thread and wait for its results.

.. code:: python

    from pebble import concurrent

    @concurrent.thread
    def function(foo, bar=0):
        return foo + bar

    future = function(1, bar=2)

    result = future.result()  # blocks until results are ready

Same code with AsyncIO support.

.. code:: python

    import asyncio

    from pebble import asynchronous

    @asynchronous.thread
    def function(foo, bar=0):
        return foo + bar

    async def asynchronous_function():
        result = await function(1, bar=2)  # blocks until results are ready
        print(result)

    asyncio.run(asynchronous_function())

Run a function with a timeout of ten seconds and deal with errors.

.. code:: python

    from pebble import concurrent
    from concurrent.futures import TimeoutError

    @concurrent.process(timeout=10)
    def function(foo, bar=0):
        return foo + bar

    future = function(1, bar=2)

    try:
        result = future.result()  # blocks until results are ready
    except TimeoutError as error:
        print("Function took longer than %d seconds" % error.args[1])
    except Exception as error:
        print("Function raised %s" % error)
        print(error.traceback)  # traceback of the function

Pools support workers restart, timeout for long running tasks and more.

.. code:: python

    from pebble import ProcessPool
    from concurrent.futures import TimeoutError

    TIMEOUT_SECONDS = 3

    def function(foo, bar=0):
        return foo + bar

    def task_done(future):
        try:
            result = future.result()  # blocks until results are ready
        except TimeoutError as error:
            print("Function took longer than %d seconds" % error.args[1])
        except Exception as error:
            print("Function raised %s" % error)
            print(error.traceback)  # traceback of the function

    with ProcessPool(max_workers=5, max_tasks=10) as pool:
        for index in range(0, 10):
            future = pool.schedule(function, index, bar=1, timeout=TIMEOUT_SECONDS)
            future.add_done_callback(task_done)

Owner

  • Name: Matteo Cafasso
  • Login: noxdafox
  • Kind: user
  • Location: Helsinki
  • Company: @getCUJO

GitHub Events

Total
  • Create event: 3
  • Release event: 4
  • Issues event: 22
  • Watch event: 76
  • Issue comment event: 46
  • Push event: 30
  • Pull request event: 6
  • Pull request review comment event: 4
  • Pull request review event: 4
  • Fork event: 5
Last Year
  • Create event: 3
  • Release event: 4
  • Issues event: 22
  • Watch event: 76
  • Issue comment event: 46
  • Push event: 30
  • Pull request event: 6
  • Pull request review comment event: 4
  • Pull request review event: 4
  • Fork event: 5

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 720
  • Total Committers: 19
  • Avg Commits per committer: 37.895
  • Development Distribution Score (DDS): 0.286
Past Year
  • Commits: 44
  • Committers: 4
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.068
Top Committers
Name Email Commits
Matteo Cafasso n****x@g****m 514
cafama m****o@f****m 166
Arthur Pastel a****l@g****m 13
Sam Harding s****2@g****m 5
wim glenn h****y@w****m 4
Philipp Seitz p****z@r****m 3
Steven Heidel s****n@r****m 2
Philipp Seitz p****z@t****e 2
Sandro d****l@p****l 1
Ryan Siemens r****s@z****m 1
Martin Liska m****a@s****z 1
Clemens Brunner c****r@g****m 1
Charles Cazabon c****n 1
Anthony Polloreno a****o@g****m 1
Alan Justino a****o@y****r 1
Ville Lindfors v****i@i****i 1
germn G****N@y****u 1
matoro m****o 1
Émilia Decaudin e****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 111
  • Total pull requests: 32
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 87
  • Total pull request authors: 21
  • Average comments per issue: 3.71
  • Average comments per pull request: 1.72
  • Merged pull requests: 20
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 12
  • Pull requests: 7
  • Average time to close issues: 28 days
  • Average time to close pull requests: about 1 month
  • Issue authors: 8
  • Pull request authors: 4
  • Average comments per issue: 2.17
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • andresriancho (6)
  • marxin (5)
  • noxdafox (4)
  • sergeykk (3)
  • wimglenn (3)
  • emaxx-google (3)
  • csm10495 (2)
  • dcnieho (2)
  • warmspringwinds (2)
  • rsiemens (2)
  • bitsofinfo (2)
  • ghilesmeddour (2)
  • melsabagh (1)
  • vstoleru-uipath (1)
  • HumbleKazoku (1)
Pull Request Authors
  • wimglenn (4)
  • noxdafox (3)
  • penguinpee (2)
  • qiankunli (2)
  • marxin (2)
  • rsiemens (2)
  • emaxx-google (2)
  • schipiga (2)
  • aleph-ra (1)
  • emiliadecaudin (1)
  • germn (1)
  • sam-harding (1)
  • cbrnr (1)
  • ehudhala (1)
  • art049 (1)
Top Labels
Issue Labels
bug (16) feature (5) enhancement (4) duplicate (3) invalid (1)
Pull Request Labels

Packages

  • Total packages: 9
  • Total downloads:
    • pypi 784,200 last-month
  • Total docker downloads: 331
  • Total dependent packages: 43
    (may contain duplicates)
  • Total dependent repositories: 280
    (may contain duplicates)
  • Total versions: 142
  • Total maintainers: 3
pypi.org: pebble

Threading and multiprocessing eye-candy.

  • Versions: 101
  • Dependent Packages: 36
  • Dependent Repositories: 277
  • Downloads: 784,200 Last month
  • Docker Downloads: 331
Rankings
Dependent packages count: 0.4%
Downloads: 0.6%
Dependent repos count: 0.9%
Average: 2.4%
Stargazers count: 2.9%
Docker downloads count: 3.8%
Forks count: 6.0%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-pebble

Multi threading and processing eye-candy

  • Versions: 12
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 10.9%
Dependent packages count: 12.6%
Stargazers count: 13.7%
Forks count: 17.5%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-pebble-pyc

Precompiled Python bytecode for py3-pebble

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 10.9%
Dependent packages count: 12.6%
Stargazers count: 13.7%
Forks count: 17.5%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pebble
  • Versions: 12
  • Dependent Packages: 4
  • Dependent Repositories: 3
Rankings
Dependent packages count: 12.5%
Dependent repos count: 18.1%
Average: 19.0%
Stargazers count: 19.4%
Forks count: 25.9%
Last synced: 6 months ago
spack.io: py-pebble

Threading and multiprocessing eye-candy.

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 11.6%
Forks count: 15.8%
Average: 21.2%
Dependent packages count: 57.3%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-pebble

Multi threading and processing eye-candy

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-pebble-pyc

Precompiled Python bytecode for py3-pebble

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-pebble

Multi threading and processing eye-candy

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-pebble-pyc

Precompiled Python bytecode for py3-pebble

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago