{"id":15044041,"url":"https://github.com/gauge-sh/pare","last_synced_at":"2025-04-12T15:02:03.003Z","repository":{"id":249859369,"uuid":"831125013","full_name":"gauge-sh/pare","owner":"gauge-sh","description":"Pare is the easiest way to deploy Python Lambdas alongside your primary web application.","archived":false,"fork":false,"pushed_at":"2024-08-23T22:41:41.000Z","size":346,"stargazers_count":54,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T02:00:05.848Z","etag":null,"topics":["continuous-deployment","deployments","developer-tools","devops","lambda","library","open-source","package","programming","python","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gauge-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-07-19T18:06:34.000Z","updated_at":"2025-04-01T21:41:46.000Z","dependencies_parsed_at":"2024-08-14T03:08:41.263Z","dependency_job_id":"93beebaa-ab6e-4e39-b62a-9b777c63ace9","html_url":"https://github.com/gauge-sh/pare","commit_stats":null,"previous_names":["gauge-sh/gauge-serverless","gauge-sh/pare"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fpare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fpare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fpare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fpare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauge-sh","download_url":"https://codeload.github.com/gauge-sh/pare/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586249,"owners_count":21128997,"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":["continuous-deployment","deployments","developer-tools","devops","lambda","library","open-source","package","programming","python","serverless"],"created_at":"2024-09-24T20:49:59.575Z","updated_at":"2025-04-12T15:02:02.940Z","avatar_url":"https://github.com/gauge-sh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔪 Pare\n\n[![version](https://img.shields.io/pypi/v/pare.svg)](https://pypi.Python.org/pypi/pare)\n[![license](https://img.shields.io/pypi/l/pare.svg)](https://pypi.Python.org/pypi/pare)\n[![python](https://img.shields.io/pypi/pyversions/pare.svg)](https://pypi.Python.org/pypi/pare)\n[![ci](https://github.com/gauge-sh/pare/actions/workflows/ci.yml/badge.svg)](https://github.com/gauge-sh/pare/actions/workflows/ci.yml)\n[![pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)\n[![ruff](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\nPare is the easiest way to deploy Python Lambdas alongside your primary web application.\n\n[Discord](https://discord.gg/Kz2TnszerR)\n\n![pare_demo](https://github.com/user-attachments/assets/2513eb92-51f3-45c6-9eb3-0b71dafe8a48)\n\n\n## Why use Pare?\n\nPare is built to allow web developers to independently scale parts of a web application.\nMore specifically, Pare is useful if you have functions which are:\n\n- compute intensive\n- blocking\n- isolated\n- parallel\n\nSome examples are **document parsing**, **data aggregation**, **webhook handling** and **image processing**.\n\nWith Pare, you can offload these tasks from your main web server, while also getting automatic scaling for concurrent requests.\n\n## Quickstart\n\n```shell\n\u003e pip install pare\n```\n\nFirst, mark the function you want to deploy onto a Lambda:\n\n```python\nimport pare\n\n@pare.endpoint(name=\"quickstart\")\ndef my_function(*args, **kwargs):\n    ...\n```\n\nThis will tell Pare to use this function as the Lambda handler.\n\nCalling the function in your code will still execute locally, but the decorator adds additional methods to make calls to the deployed Lambda.\n\n```python\nfrom my_module import my_function\n\nmy_function(*args, **kwargs)  # local function call\n\nmy_function.invoke(*args, **kwargs)  # remote Lambda call\n\nawait my_function.invoke_async(*args, **kwargs)  # async remote Lambda call\n```\n\n\nNext, login with Github to get a Pare API Key:\n\n```shell\n\u003e pare login\nPlease visit: https://github.com/login/device\nand enter code: 1111-1111\n```\n\nFollowing the on-screen instructions will authorize Gauge to retrieve your Github username and email for the purposes of account creation. The token has no other permissions.\n\nAfter logging in, you can run a deploy of your function into the Pare Cloud:\n\n```shell\n\u003e pare deploy my_module.py\n```\n\n\u003e [!NOTE]\n\u003e This generally takes between 3s (when heavily cached) and 60s (no cache, heavy dependencies)\n\n\u003e [!NOTE]\n\u003e Make sure you are in a git repository. Pare uses the latest git hash to tag your deploy.\n\nOnce the deploy is finished, you can verify with `pare status`:\n\n```shell\n\u003e pare status\n                      Deployment Data                      \n┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓\n┃ Name                   ┃ Git Hash ┃ Created At          ┃\n┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩\n│ quickstart             │ 8a4096b  │ 2024-08-19 22:55:51 │\n└────────────────────────┴──────────┴─────────────────────┘\n```\n\nThat's it! Your function is now serverless.\n\n\nTo delete a deployed function, use `pare delete`:\n\n```shell\n\u003e pare delete quickstart\n```\n\n\n## Notes on Deployment\n\nThe `pare deploy` command accepts a sequence of file patterns (filepaths, directories, or glob paths).\nThe corresponding files will be collected into a single bundle, which will be built and deployed with each function.\n\nThe entrypoint for each function will be defined by `pare.endpoint`, and it is critical that\nall of the entrypoint's imports are included in the bundle.\n\nThird party dependencies are bundled\nwith each function individually, see the section below for more details.\n\nIn the future, we plan to use the technology behind [Tach] to automatically determine\nthe transitive dependencies in your project and create a complete bundle. Reach out on [Discord](https://discord.gg/Kz2TnszerR)\nif this is an important feature for you!\n\n\n## Advanced Usage\n\n\n### 3rd Party Dependencies\n\nPare allows installing 3rd party dependencies from PyPI for each deployed function.\n\nUse the `dependencies` kwarg in the `endpoint` decorator to specify the dependencies for a function,\nand they will automatically be installed during the deploy.\n\n```python\n@pare.endpoint(name=\"3rd-party-deps\", dependencies=[\"pydantic\", ...])\n```\n\nThe dependency names can specify version numbers as well, just as if they were listed in `requirements.txt`.\n\n```python\n@pare.endpoint(name=\"3rd-party-deps\", dependencies=[\"pydantic==2.8.2\", ...])\n```\n\n\u003e [!TIP]\n\u003e If you want to quickly determine the 3rd party dependencies used by a set of files, consider using [Tach](https://github.com/gauge-sh/tach) with [`tach report-external`](https://docs.gauge.sh/usage/commands#tach-report-external)\n\n### Environment Variables\n\nPare allows setting environment variables for your functions during the deploy.\n\nUse the `-e` option to set environment variables:\n\n```shell\n\u003e pare deploy my_module.py -e MY_VARIABLE=myvalue -e OTHER_VARIABLE=othervalue [...]\n```\n\n\n### Atomic Deployment\n\nPare supports 'atomic deployment' of services based on a git hash.\n\nWhen atomic deployment is disabled (the default),\nthe Pare API will route requests by name to the latest deployed version of your function.\n\nWhen atomic deployment is enabled, the Pare SDK will include the git hash in its requests to your deployed functions,\nand the Pare API will route your request to the service with a matching git hash.\n\nThis feature is enabled on the client-side with the environment variable `PARE_ATOMIC_DEPLOYMENT_ENABLED`.\n\nSince your main application likely will not have access to `git` to determine its git hash at runtime,\nyou will need to set the `PARE_GIT_HASH` environment variable during your build and deployment pipeline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauge-sh%2Fpare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauge-sh%2Fpare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauge-sh%2Fpare/lists"}