{"id":15722961,"url":"https://github.com/bachya/aiorecollect","last_synced_at":"2025-04-15T21:22:42.057Z","repository":{"id":40415951,"uuid":"310726379","full_name":"bachya/aiorecollect","owner":"bachya","description":"🗑 A Python 3, asyncio-based library for the Recollect Waste API","archived":false,"fork":false,"pushed_at":"2025-03-27T06:23:48.000Z","size":1705,"stargazers_count":4,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-03-29T01:23:54.160Z","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":"2020-11-06T23:20:18.000Z","updated_at":"2024-12-24T16:12:51.000Z","dependencies_parsed_at":"2023-10-17T00:04:23.977Z","dependency_job_id":"3c2121cc-173b-4a02-8bfc-5046eec70c3c","html_url":"https://github.com/bachya/aiorecollect","commit_stats":{"total_commits":137,"total_committers":6,"mean_commits":"22.833333333333332","dds":"0.45985401459854014","last_synced_commit":"db7ddf99266fc34122de13ea7c7f79f993456007"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiorecollect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiorecollect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiorecollect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiorecollect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachya","download_url":"https://codeload.github.com/bachya/aiorecollect/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249154860,"owners_count":21221487,"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:09:50.561Z","updated_at":"2025-04-15T21:22:42.039Z","avatar_url":"https://github.com/bachya.png","language":"Python","funding_links":["https://www.buymeacoffee.com/bachya1208P"],"categories":[],"sub_categories":[],"readme":"# 🗑 aiorecollect: A Python 3 Library for Pinboard\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`aiorecollect` is a Python 3, asyncio-based library for the ReCollect Waste API. It allows\nusers to programmatically retrieve schedules for waste removal in their area, including\ntrash, recycling, compost, and more.\n\nSpecial thanks to @stealthhacker for the inspiration!\n\n# Installation\n\n```bash\npip install aiorecollect\n```\n\n# Python Versions\n\n`aiorecollect` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Place and Service IDs\n\nTo use `aiorecollect`, you must know both your ReCollect Place and Service IDs.\n\nIn general, cities/municipalities that utilize ReCollect will give you a way to\nsubscribe to a calendar with pickup dates. If you examine the iCal URL for this\ncalendar, the Place and Service IDs are embedded in it:\n\n```\nwebcal://recollect.a.ssl.fastly.net/api/places/PLACE_ID/services/SERVICE_ID/events.en-US.ics\n```\n\n# Usage\n\n```python\nimport asyncio\nfrom datetime import date\n\nfrom aiorecollect import Client\n\n\nasync def main() -\u003e None:\n    \"\"\"Run.\"\"\"\n    client = await Client(\"\u003cPLACE ID\u003e\", \"\u003cSERVICE ID\u003e\")\n\n    # The client has a few attributes that you can access:\n    client.place_id\n    client.service_id\n\n    # Get all pickup events on the calendar:\n    pickup_events = await client.async_get_pickup_events()\n\n    # ...or get all pickup events within a certain date range:\n    pickup_events = await client.async_get_pickup_events(\n        start_date=date(2020, 10, 1), end_date=date(2020, 10, 31)\n    )\n\n    # ...or just get the next pickup event:\n    next_pickup = await client.async_get_next_pickup_event()\n\n\nasyncio.run(main())\n```\n\n## The `PickupEvent` Object\n\nThe `PickupEvent` object that is returned from the above calls comes with three\nproperties:\n\n- `date`: a `datetime.date` that denotes the pickup date\n- `pickup_types`: a list of `PickupType` objects that will occur with this event\n- `area_name`: the name of the area in which the event is occurring\n\n## The `PickupType` Object\n\nThe `PickupType` object contains the \"internal\" name of the pickup type _and_ a\nhuman-friendly representation when it exists:\n\n- `name`: the internal name of the pickup type\n- `friendly_name`: the humany-friendly name of the pickup type (if it exists)\n\n## Connection Pooling\n\nBy default, the library creates a new connection to ReCollect 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 aiorecollect import Client\n\n\nasync def main() -\u003e None:\n    \"\"\"Run.\"\"\"\n    async with ClientSession() as session:\n        client = await Client(\"\u003cPLACE ID\u003e\", \"\u003cSERVICE ID\u003e\", session=session)\n\n        # Get to work...\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 aiorecollect 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/aiorecollect/test.yml\n[ci]: https://github.com/bachya/aiorecollect/actions\n[codecov-badge]: https://codecov.io/gh/bachya/aiorecollect/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/aiorecollect\n[contributors]: https://github.com/bachya/aiorecollect/graphs/contributors\n[fork]: https://github.com/bachya/aiorecollect/fork\n[issues]: https://github.com/bachya/aiorecollect/issues\n[license-badge]: https://img.shields.io/pypi/l/aiorecollect.svg\n[license]: https://github.com/bachya/aiorecollect/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/65fe7eb308dca67c1038/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/aiorecollect/maintainability\n[new-issue]: https://github.com/bachya/aiorecollect/issues/new\n[new-issue]: https://github.com/bachya/aiorecollect/issues/new\n[pypi-badge]: https://img.shields.io/pypi/v/aiorecollect.svg\n[pypi]: https://pypi.python.org/pypi/aiorecollect\n[version-badge]: https://img.shields.io/pypi/pyversions/aiorecollect.svg\n[version]: https://pypi.python.org/pypi/aiorecollect\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faiorecollect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachya%2Faiorecollect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faiorecollect/lists"}