{"id":26907028,"url":"https://github.com/python-effect/effect-examples","last_synced_at":"2025-04-01T11:37:15.824Z","repository":{"id":31749440,"uuid":"35315539","full_name":"python-effect/effect-examples","owner":"python-effect","description":"Examples for using Effect","archived":false,"fork":false,"pushed_at":"2019-11-24T02:16:26.000Z","size":13,"stargazers_count":9,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-12-14T21:10:55.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-effect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-09T04:48:55.000Z","updated_at":"2023-12-14T21:10:55.577Z","dependencies_parsed_at":"2022-08-29T14:01:15.980Z","dependency_job_id":null,"html_url":"https://github.com/python-effect/effect-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-effect%2Feffect-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-effect%2Feffect-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-effect%2Feffect-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-effect%2Feffect-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-effect","download_url":"https://codeload.github.com/python-effect/effect-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246634940,"owners_count":20809324,"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","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":[],"created_at":"2025-04-01T11:37:15.281Z","updated_at":"2025-04-01T11:37:15.817Z","avatar_url":"https://github.com/python-effect.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effect Examples\n\nThis repository contains examples of using Effect. They demonstrate basic use\nof Effect to isolate side-effects from code, but also to provide alternative\nimplementations of those side-effecting actions without requiring changes to\ncore application logic.\n\nThis package isn't meant to be installed, but rather just copied to your local\ndev environment and tinkered with. To install dependencies use ``pip install -r\nrequirements.txt``.\n\n## ehttp\n\nThe [`ehttp`](ehttp) directory contains a very simple `HTTPRequest` intent and\nperformers using common HTTP client libraries:\n[requests](http://warehouse.python.org/project/requests/) and\n[treq](https://warehouse.python.org/project/treq/).\n\ntreq is a Twisted-based library, showing that Effect can be used (with the\nadditional [txeffect](https://github.com/python-effect/txeffect) package) to\nwrite generic code that can use either Twisted-based asynchronous IO or normal\nblocking IO. Other asynchronous frameworks (such as Python 3's ``asyncio``)\ncould also be used in this way.\n\n## readline_intent\n\nThe [`readline_intent.py`](readline_intent.py) file has a simple `ReadLine`\nintent that uses `raw_input` (or `input` in Py3) to prompt the user for input.\n\n## github\n\nThe `github` directory contains a simple application that lets the user input a\nGitHub username and prints out a list of all repositories that that user has\naccess to. It depends on the `ehttp` and `readline_intent` modules.\n\nNote that if you run this example too rapidly, GitHub might temporarily block\nyour IP from making anonymous API requests for some short period of time.\n\nThere are two entrypoints into the example:\n[`github.sync_main`](github/sync_main.py) and\n[`github.twisted_main`](github/twisted_main.py). `sync_main` does\ntypical blocking IO, and `twisted_main` uses asynchronous IO. Note that the\nvast majority of the code doesn't need to care about this difference; the only\npart that cares about it is the `*_main.py` files. All of the logic in\n[`core.py`](github/core.py) is generic.\n\nTo run them:\n\n    python -m github.sync_main\n\nor\n\n    python -m github.twisted_main\n\n\nNote that the twisted example does not run on Python 3, but all other examples\ndo.\n\n\nThe github example app has unit tests in\n[`test_core.py`](github/test_core.py). They can be discovered and run simply by\nrunning ``py.test`` in the top-level directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-effect%2Feffect-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-effect%2Feffect-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-effect%2Feffect-examples/lists"}