{"id":16802954,"url":"https://github.com/coady/futured","last_synced_at":"2025-09-01T22:38:34.668Z","repository":{"id":20667164,"uuid":"90562501","full_name":"coady/futured","owner":"coady","description":"Functional interface for concurrent futures, including async coroutines.","archived":false,"fork":false,"pushed_at":"2024-11-19T00:13:00.000Z","size":790,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T12:14:40.835Z","etag":null,"topics":["async","asyncio","concurrent","functional","futures","processes","threads"],"latest_commit_sha":null,"homepage":"https://coady.github.io/futured","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coady.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-07T21:18:24.000Z","updated_at":"2024-12-16T07:18:50.000Z","dependencies_parsed_at":"2023-11-23T20:21:06.518Z","dependency_job_id":"360e641e-8b5d-4288-82be-abfbdd64aa63","html_url":"https://github.com/coady/futured","commit_stats":{"total_commits":85,"total_committers":2,"mean_commits":42.5,"dds":0.08235294117647063,"last_synced_commit":"c3ffcfd0048dfa386c21f8a8603af84b7ee9ba00"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/coady/futured","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coady%2Ffutured","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coady%2Ffutured/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coady%2Ffutured/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coady%2Ffutured/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coady","download_url":"https://codeload.github.com/coady/futured/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coady%2Ffutured/sbom","scorecard":{"id":294962,"data":{"date":"2025-08-11","repo":{"name":"github.com/coady/futured","commit":"bccb9fbc2b5ceb2eccdf9e6b92904ee9b138af2e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/coady/futured/release.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:36","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:46","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:18","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T19:15:58.386Z","repository_id":20667164,"created_at":"2025-08-17T19:15:58.386Z","updated_at":"2025-08-17T19:15:58.386Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273203230,"owners_count":25063275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asyncio","concurrent","functional","futures","processes","threads"],"created_at":"2024-10-13T09:41:08.987Z","updated_at":"2025-09-01T22:38:34.663Z","avatar_url":"https://github.com/coady.png","language":"Python","readme":"[![image](https://img.shields.io/pypi/v/futured.svg)](https://pypi.org/project/futured/)\n![image](https://img.shields.io/pypi/pyversions/futured.svg)\n[![image](https://pepy.tech/badge/futured)](https://pepy.tech/project/futured)\n![image](https://img.shields.io/pypi/status/futured.svg)\n[![build](https://github.com/coady/futured/actions/workflows/build.yml/badge.svg)](https://github.com/coady/futured/actions/workflows/build.yml)\n[![image](https://codecov.io/gh/coady/futured/branch/main/graph/badge.svg)](https://codecov.io/github/coady/futured)\n[![CodeQL](https://github.com/coady/futured/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/coady/futured/actions/workflows/github-code-scanning/codeql)\n[![image](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)\n\nFutured provides a consistent interface for concurrent functional programming in Python. It wraps any callable to return a `concurrent.futures.Future`, wraps any async coroutine with a compatible `Task` interface, and provides concurrent iterators and context managers for futures.\n\n## Usage\n### threaded, processed\nTransform any callable into one which runs in a thread or process pool, and returns a future.\n\n```python\nfrom futured import threaded, processed\nimport httpx\n\nfetch = threaded(httpx.Client().get)\nfetch(url)  # return Future\n\nfs = (fetch(url + path) for path in paths)\nthreaded.results(fs)  # generate results from futures\nthreaded.results(fs, timeout=...)  # generate results as completed\n\nfetch.map(urls)  # generate results in order\nfetch.map(urls, timeout=...)  # generate results as completed\nfetch.mapzip(urls)  # generate (url, result) pairs as completed\n```\n\nThread and process pool executors may be used as context managers, customized with options, and reused with different callables.\n\n```python\nthreaded(max_workers=...)(func, ...)\nprocessed(max_workers=...)(func, ...)\n```\n\n`futured` classes have a `waiting` context manager which collects results from tasks. Futures can be registered at creation, or appended to the list of tasks.\n\n```python\nwith threaded.waiting(*fs) as tasks:\n    tasks.append(future)\ntasks  # list of completed results\n```\n\n`futured` classes provide a `tasks` interface which generalizes `futures.as_completed` and `futures.wait`, while allowing the set of tasks to be modified, e.g., for retries.\n\n```python\nthreaded.tasks(fs, timeout=...)  # mutable set of running tasks which iterate as completed\n```\n\n### asynced\nThe same interface works for `asyncio`.\n\n```python\nfrom futured import asynced\nimport httpx\n\nfetch = asynced(httpx.AsyncClient().get)\nfetch(url)  # return coroutine\n\nasynced.results(fs)  # generate results from futures\nasynced.results(fs, timeout=...)  # generate results as completed\n\nfetch.map(urls)  # generate results in order\nfetch.map(urls, timeout=...)  # generate results as completed\nfetch.mapzip(urls)  # generate (url, result) pairs as completed\n```\n\n`asynced` provides utilities for calling coroutines from a synchronous context. `waiting` is similar to [trio's nursery](https://trio.readthedocs.io/en/latest/reference-core.html#nurseries-and-spawning), but returns results from a synchronous `with` block.\n\n```python\nasynced.run(async_func, ...)  # call and run until complete\nasynced.run(async_gen, ...)  # call and run synchronous iterator\nwith asynced.waiting(*fs) as tasks:  # concurrent coroutines completed in a block\nasynced.tasks(fs, timeout=...)  # mutable set of running tasks which iterate as completed\n```\n\n### extensions\nThere is also support for [dask distributed](https://distributed.dask.org/) clients and [gevent](http://www.gevent.org/) greenlets.\n\n```python\nfrom futured import distributed, greened\n```\n\n### decorators\nNaturally `futured` wrappers can be used as decorators, but arguments can also be partially bound.\n\n```python\n@threaded\ndef slow():\n   ...\n\nfetch = threaded(httpx.Client().get, url)\nfetch(params=...)\n```\n\nMethods are supported, as well as a `decorated` utility for automatically subclassing.\n\n```python\nfrom futured import decorated\n\nFutureClient = decorated(httpx.Client, request=threaded)\n\n # equivalent to\nclass FutureClient(httpx.Client):\n    request = threaded(httpx.Client.request)\n```\n\n### command\n`command` wraps `subprocess.Popen` to provide a `Future` compatible interface.\n\n```python\nfrom futured import futured, command\n\ncommand('ls').result()  # return stdout or raises stderr\ncommand('ls').pipe('wc')  # pipes into next command, or | ('wc',... )\nfor line in command('ls'):  # iterable lines\ncommand.coroutine('ls')  # return coroutine\n\nfutured(command, 'ls')  # supports `map` interface\nasynced(command.coroutine, 'ls')  # supports `map` interface with timeout\n```\n\n### forked\n`forked` allows iteration in separate child processes.\n\n```python\nfrom futured import forked\n\nfor value in forked(values, max_workers=...):\n    # in a child process\n # in parent after children have exited\n```\n\n## Installation\n```console\npip install futured\n```\n\n## Tests\n100% branch coverage.\n\n```console\npytest [--cov]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoady%2Ffutured","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoady%2Ffutured","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoady%2Ffutured/lists"}