Skip to content

Downloader

BayWheelsDownloader

Bases: BaseDownloader

Class to download historical trips from BayBikes in San Francisco.

Index for all the historical trips found here.

Source code in lyft_bikes/historical/downloader.py
class BayWheelsDownloader(BaseDownloader):
    """Class to download historical trips from BayBikes in San Francisco.

    Index for all the historical trips found <a href="https://s3.amazonaws.com/baywheels-data/index.html">here</a>.

    """

    base_url = "https://s3.amazonaws.com/baywheels-data"

    def file_name(self, date: datetime.date, suffix: str) -> str:
        return f"{date:%Y%m}-baywheels-tripdata.{suffix}"

    def url(self, date: datetime.date):
        return f"{self.base_url}/{self.file_name(date=date, suffix='csv.zip')}"

CapitalBikeshareDownloader

Bases: BaseDownloader

Class to download historical trips from Capital Bikeshare in Washington DC.

Index for all the historical trips found here.

Source code in lyft_bikes/historical/downloader.py
class CapitalBikeshareDownloader(BaseDownloader):
    """Class to download historical trips from Capital Bikeshare in Washington DC.

    Index for all the historical trips found <a href="https://s3.amazonaws.com/capitalbikeshare-data/index.html">here</a>.

    """

    base_url = "https://s3.amazonaws.com/capitalbikeshare-data"

    def file_name(self, date: datetime.date, suffix: str) -> str:
        return f"{date:%Y%m}-capitalbikeshare-tripdata.{suffix}"

CitiBikesDownloader

Bases: BaseDownloader

Class to download historical trips from CitiBikes in New York City.

Index for all the historical trips found here.

Source code in lyft_bikes/historical/downloader.py
class CitiBikesDownloader(BaseDownloader):
    """Class to download historical trips from CitiBikes in New York City.

    Index for all the historical trips found <a href="https://s3.amazonaws.com/tripdata/index.html">here</a>.

    """

    base_url = "https://s3.amazonaws.com/tripdata"

    def file_name(self, date: datetime.date, suffix: str) -> str:
        return f"{date:%Y%m}-citibike-tripdata.{suffix}"

    def url(self, date: datetime.date):
        return f"{self.base_url}/{self.file_name(date=date, suffix='csv.zip')}"

CoGoDownloader

Bases: BaseDownloader

Class to download historical trips from CoGo in Columbus.

Index for all the historical trips found here.

Source code in lyft_bikes/historical/downloader.py
class CoGoDownloader(BaseDownloader):
    """Class to download historical trips from CoGo in Columbus.

    Index for all the historical trips found <a href="https://cogo-sys-data.s3.amazonaws.com/index.html">here</a>.

    """

    base_url = "https://cogo-sys-data.s3.amazonaws.com"

    def file_name(self, date: datetime.date, suffix: str) -> str:
        return f"{date:%Y%m}-cogo-tripdata.{suffix}"

DivvyDownloader

Bases: BaseDownloader

Class to download historical trips from Divvy in Chicago.

Index for all the historical trips found here.

Currently only supports the files with the form %Y%m-divvy-tripdata.zip that go back until April 2020

Source code in lyft_bikes/historical/downloader.py
class DivvyDownloader(BaseDownloader):
    """Class to download historical trips from Divvy in Chicago.

    Index for all the historical trips found <a href="https://divvy-tripdata.s3.amazonaws.com/index.html">here</a>.

    Currently only supports the files with the form `%Y%m-divvy-tripdata.zip` that go back until
    April 2020

    """

    base_url = "https://divvy-tripdata.s3.amazonaws.com"

    def file_name(self, date: datetime.date, suffix: str) -> str:
        return f"{date:%Y%m}-divvy-tripdata.{suffix}"