Skip to main content

♻️ aioridwell: A Python3, asyncio-based API for interacting with Ridwell

CI PyPI Version License Code Coverage Maintainability

Buy Me A Coffee

aioridwell is a Python 3, asyncio-friendly library for interacting with Ridwell to view information on upcoming recycling pickups.

Installation

pip install aioridwell

Python Versions

aioridwell is currently supported on:

  • Python 3.10
  • Python 3.11
  • Python 3.12

Usage

Creating and Using a Client

The Client is the primary method of interacting with the API:

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")
    # ...


asyncio.run(main())

By default, the library creates a new connection to the API with each coroutine. If you are calling a large number of coroutines (or merely want to squeeze out every second of runtime savings possible), an aiohttp ClientSession can be used for connection pooling:

import asyncio

from aiohttp import ClientSession

from aiowatttime import Client


async def main() -> None:
    async with ClientSession() as session:
        client = await async_get_client("<EMAIL>", "<PASSWORD>", session=session)
        # ...


asyncio.run(main())

Getting the User's Dashboard URL

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")
    client.get_dashboard_url()
    # >>> https://www.ridwell.com/users/userId1/dashboard


asyncio.run(main())

Getting Accounts

Getting all accounts associated with this email address is easy:

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")

    accounts = await client.async_get_accounts()
    # >>> {"account_id_1": RidwellAccount(...), ...}


asyncio.run(main())

The RidwellAccount object comes with some useful properties:

  • account_id: the Ridwell ID for the account
  • address: the address being serviced
  • email: the email address on the account
  • full_name: the full name of the account owner
  • phone: the phone number of the account owner
  • subscription_id: the Ridwell ID for the primary subscription
  • subscription_active: whether the primary subscription is active

Getting Pickup Events

Getting pickup events associated with an account is easy, too:

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")

    accounts = await client.async_get_accounts()
    for account in accounts.values():
        events = await account.async_get_pickup_events()
        # >>> [RidwellPickupEvent(...), ...]

        # You can also get just the next pickup event from today's date:
        next_event = await account.async_get_next_pickup_event()
        # >>> RidwellPickupEvent(...)


asyncio.run(main())

The RidwellPickupEvent object comes with some useful properties:

  • pickup_date: the date of the pickup (in datetime.date format)
  • pickups: a list of RidwellPickup objects
  • state: an EventState enum whose name represents the current state of the pickup event

Likewise, the RidwellPickup object comes with some useful properties:

  • category: a PickupCategory enum whose name represents the type of pickup
  • name: the name of the item being picked up
  • offer_id: the Ridwell ID for this particular offer
  • priority: the pickup priority
  • product_id: the Ridwell ID for this particular product
  • quantity: the amount of the product being picked up

Opting Into or Out Of a Pickup Event

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")

    accounts = await client.async_get_accounts()
    for account in accounts.values():
        events = await account.async_get_pickup_events()
        # >>> [RidwellPickupEvent(...), ...]

        await events[0].async_opt_in()
        await events[0].async_opt_out()


asyncio.run(main())

Calculating a Pickup Event's Estimated Add-on Cost

import asyncio

from aioridwell import async_get_client


async def main() -> None:
    client = await async_get_client("<EMAIL>", "<PASSWORD>")

    accounts = await client.async_get_accounts()
    for account in accounts.values():
        events = await account.async_get_pickup_events()
        # >>> [RidwellPickupEvent(...), ...]

        event_1_cost = await events[0].async_get_estimated_addon_cost()
        # >>> 22.00


asyncio.run(main())

Contributing

Thanks to all of our contributors so far!

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. (optional, but highly recommended) Create a virtual environment: python3 -m venv .venv
  4. (optional, but highly recommended) Enter the virtual environment: source ./.venv/bin/activate
  5. Install the dev environment: script/setup
  6. Code your new feature or bug fix on a new branch.
  7. Write tests that cover your new functionality.
  8. Run tests and ensure 100% code coverage: poetry run pytest --cov aioridwell tests
  9. Update README.md with any new documentation.
  10. Submit a pull request!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioridwell-2025.9.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioridwell-2025.9.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file aioridwell-2025.9.0.tar.gz.

File metadata

  • Download URL: aioridwell-2025.9.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for aioridwell-2025.9.0.tar.gz
Algorithm Hash digest
SHA256 20381f1d170dfb8d2518531a213a2465391d268dcf656b150fe8be81f8947147
MD5 f6f63fc062dbd8b7bb9a365b15a534a3
BLAKE2b-256 8dc9f6f97da91ce9368bf82432fe4e056a673623f5cc928f076bda23fdc41ae4

See more details on using hashes here.

File details

Details for the file aioridwell-2025.9.0-py3-none-any.whl.

File metadata

  • Download URL: aioridwell-2025.9.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for aioridwell-2025.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 384b328ad8b15c4a9604fda0cba5e2c25f88821f8ad857a519003625e3e9fdcb
MD5 22e2cc951b2f655c109d51a6284fe6da
BLAKE2b-256 4d2235bc974520252a2d56c3298f44d9a972aefa2d639eeb1870824312fa66d0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2025.9.0 This release

2 files

2024.1.0

2 files

2023.12.0

2 files

2023.10.0

2 files

2023.8.0

2 files

2023.7.0

2 files

2023.1.0

2 files

2022.11.0

2 files

2022.10.0

2 files

2022.3.0

2 files

2021.12.2

2 files

2021.12.1

2 files

2021.12.0

2 files

2021.10.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page