{"id":15723183,"url":"https://github.com/bachya/aioridwell","last_synced_at":"2025-05-13T03:59:54.654Z","repository":{"id":39619637,"uuid":"415392855","full_name":"bachya/aioridwell","owner":"bachya","description":"♻️ A Python3, asyncio-based API for interacting with Ridwell waste recycling","archived":false,"fork":false,"pushed_at":"2025-05-12T06:51:43.000Z","size":1434,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-05-13T03:59:48.448Z","etag":null,"topics":[],"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/bachya.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}},"created_at":"2021-10-09T18:38:31.000Z","updated_at":"2024-11-12T18:00:53.000Z","dependencies_parsed_at":"2023-09-26T00:32:18.645Z","dependency_job_id":"7b7ee83f-7d71-4cc7-b352-84d0e6f3d801","html_url":"https://github.com/bachya/aioridwell","commit_stats":{"total_commits":131,"total_committers":5,"mean_commits":26.2,"dds":0.5190839694656488,"last_synced_commit":"6eb5cc080f49e61034dd0fa1c13678911d3f8241"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":"bachya/pypi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faioridwell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faioridwell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faioridwell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faioridwell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachya","download_url":"https://codeload.github.com/bachya/aioridwell/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870860,"owners_count":21976612,"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":"2024-10-03T22:10:34.512Z","updated_at":"2025-05-13T03:59:54.636Z","avatar_url":"https://github.com/bachya.png","language":"Python","funding_links":["https://www.buymeacoffee.com/bachya1208P"],"categories":[],"sub_categories":[],"readme":"# ♻️ aioridwell: A Python3, asyncio-based API for interacting with Ridwell\n\n[![CI][ci-badge]][ci]\n[![PyPI][pypi-badge]][pypi]\n[![Version][version-badge]][version]\n[![License][license-badge]][license]\n[![Code Coverage][codecov-badge]][codecov]\n[![Maintainability][maintainability-badge]][maintainability]\n\n\u003ca href=\"https://www.buymeacoffee.com/bachya1208P\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n`aioridwell` is a Python 3, asyncio-friendly library for interacting with\n[Ridwell][ridwell] to view information on upcoming recycling pickups.\n\n- [Installation](#installation)\n- [Python Versions](#python-versions)\n- [Usage](#usage)\n- [Contributing](#contributing)\n\n# Installation\n\n```bash\npip install aioridwell\n```\n\n# Python Versions\n\n`aioridwell` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Usage\n\n## Creating and Using a Client\n\nThe `Client` is the primary method of interacting with the API:\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n    # ...\n\n\nasyncio.run(main())\n```\n\nBy default, the library creates a new connection to the API with each coroutine. If\nyou are calling a large number of coroutines (or merely want to squeeze out every second\nof runtime savings possible), an [`aiohttp`][aiohttp] `ClientSession` can be used for\nconnection pooling:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom aiowatttime import Client\n\n\nasync def main() -\u003e None:\n    async with ClientSession() as session:\n        client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\", session=session)\n        # ...\n\n\nasyncio.run(main())\n```\n\n## Getting the User's Dashboard URL\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n    client.get_dashboard_url()\n    # \u003e\u003e\u003e https://www.ridwell.com/users/userId1/dashboard\n\n\nasyncio.run(main())\n```\n\n## Getting Accounts\n\nGetting all accounts associated with this email address is easy:\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n\n    accounts = await client.async_get_accounts()\n    # \u003e\u003e\u003e {\"account_id_1\": RidwellAccount(...), ...}\n\n\nasyncio.run(main())\n```\n\nThe `RidwellAccount` object comes with some useful properties:\n\n- `account_id`: the Ridwell ID for the account\n- `address`: the address being serviced\n- `email`: the email address on the account\n- `full_name`: the full name of the account owner\n- `phone`: the phone number of the account owner\n- `subscription_id`: the Ridwell ID for the primary subscription\n- `subscription_active`: whether the primary subscription is active\n\n## Getting Pickup Events\n\nGetting pickup events associated with an account is easy, too:\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n\n    accounts = await client.async_get_accounts()\n    for account in accounts.values():\n        events = await account.async_get_pickup_events()\n        # \u003e\u003e\u003e [RidwellPickupEvent(...), ...]\n\n        # You can also get just the next pickup event from today's date:\n        next_event = await account.async_get_next_pickup_event()\n        # \u003e\u003e\u003e RidwellPickupEvent(...)\n\n\nasyncio.run(main())\n```\n\nThe `RidwellPickupEvent` object comes with some useful properties:\n\n- `pickup_date`: the date of the pickup (in `datetime.date` format)\n- `pickups`: a list of `RidwellPickup` objects\n- `state`: an `EventState` enum whose name represents the current state of the pickup event\n\nLikewise, the `RidwellPickup` object comes with some useful properties:\n\n- `category`: a `PickupCategory` enum whose name represents the type of pickup\n- `name`: the name of the item being picked up\n- `offer_id`: the Ridwell ID for this particular offer\n- `priority`: the pickup priority\n- `product_id`: the Ridwell ID for this particular product\n- `quantity`: the amount of the product being picked up\n\n### Opting Into or Out Of a Pickup Event\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n\n    accounts = await client.async_get_accounts()\n    for account in accounts.values():\n        events = await account.async_get_pickup_events()\n        # \u003e\u003e\u003e [RidwellPickupEvent(...), ...]\n\n        await events[0].async_opt_in()\n        await events[0].async_opt_out()\n\n\nasyncio.run(main())\n```\n\n### Calculating a Pickup Event's Estimated Add-on Cost\n\n```python\nimport asyncio\n\nfrom aioridwell import async_get_client\n\n\nasync def main() -\u003e None:\n    client = await async_get_client(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\")\n\n    accounts = await client.async_get_accounts()\n    for account in accounts.values():\n        events = await account.async_get_pickup_events()\n        # \u003e\u003e\u003e [RidwellPickupEvent(...), ...]\n\n        event_1_cost = await events[0].async_get_estimated_addon_cost()\n        # \u003e\u003e\u003e 22.00\n\n\nasyncio.run(main())\n```\n\n# Contributing\n\nThanks to all of [our contributors][contributors] so far!\n\n1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].\n2. [Fork the repository][fork].\n3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`\n4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`\n5. Install the dev environment: `script/setup`\n6. Code your new feature or bug fix on a new branch.\n7. Write tests that cover your new functionality.\n8. Run tests and ensure 100% code coverage: `poetry run pytest --cov aioridwell tests`\n9. Update `README.md` with any new documentation.\n10. Submit a pull request!\n\n[aiohttp]: https://github.com/aio-libs/aiohttp\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/bachya/aioridwell/test.yml\n[ci]: https://github.com/bachya/aioridwell/actions\n[codecov-badge]: https://codecov.io/gh/bachya/aioridwell/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/aioridwell\n[contributors]: https://github.com/bachya/aioridwell/graphs/contributors\n[fork]: https://github.com/bachya/aioridwell/fork\n[issues]: https://github.com/bachya/aioridwell/issues\n[license-badge]: https://img.shields.io/pypi/l/aioridwell.svg\n[license]: https://github.com/bachya/aioridwell/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/9c1dcc1c991cecb06eda/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/aioridwell/maintainability\n[new-issue]: https://github.com/bachya/aioridwell/issues/new\n[new-issue]: https://github.com/bachya/aioridwell/issues/new\n[pypi-badge]: https://img.shields.io/pypi/v/aioridwell.svg\n[pypi]: https://pypi.python.org/pypi/aioridwell\n[ridwell]: https://ridwell.com\n[version-badge]: https://img.shields.io/pypi/pyversions/aioridwell.svg\n[version]: https://pypi.python.org/pypi/aioridwell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faioridwell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachya%2Faioridwell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faioridwell/lists"}