How to use the traffic.data.session.get function in traffic

To help you get started, we’ve selected a few traffic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xoolive / traffic / traffic / data / basic / airways.py View on Github external
def download_data(self) -> None:  # coverage: ignore
        from .. import session

        c = session.get(base_url + "/earth_awy.dat")
        c.raise_for_status()
        b = BytesIO(c.content)
        self._data = pd.read_csv(b, sep=" ", header=None)
        self._data.columns = ["route", "id", "navaid", "latitude", "longitude"]
        self._data.to_pickle(self.cache_dir / "traffic_airways.pkl")