semvec/pypi-packages huggingface dataset:
google-flight-scraper 0.2.0
A library to scrape and analyze Google Flight data
License: MIT
Requires Python: >=3.10,<3.13

# google-flight-scraper
A library to scrape and analyze Google Flight data

# Installing
Clone the repository into your local drive. This project was developed with [Poetry](https://python-poetry.org/) as the dependency manager. Simply run `poetry install` in the cloned directory to install the required dependencies.

# Using the library

## Quickstart
First define our travel plans:
```python
from google_flight_scraper.query import TravelPlan, FlightQuery

seattle_vacation = TravelPlan(
    origin="SFO",
    destination="SEA",
    departure_dates=[
        f"2023-10-{day}" for day in range(2, 12)
    ],
    num_adults=2,
    num_children=1
)

queries = FlightQuery.from_travel_plans(seattle_vacation)
```
This will set up the library to search for all one-way flights from San Francisco to Seattle/Tacoma between October 2, 2023 and October 12, 2023. Pass the travel plans into `FlightQuery` for it to construct all the pertinent queries. Any number of travel plans can be provided.

Lastly, we define the webdriver we'd like to use to scrape. A `Driver` class is provided for easily switching between different browsers and their associated webdrivers.
```python
from selenium import webdriver
from google_flight_scraper.driver import Driver
from google_flight_scraper.scraper import Scraper

with Driver(webdriver.Firefox, webdriver.FirefoxOptions) as driver:
    df = Scraper(timeout_seconds=5)(driver, queries)
```
Scraped data will be in the `df` DataFrame for further analysis.

## One-way vs return trip behaviour
There is a difference in the way that the library queries return trips and returning one-way flights (return trip, two one-way tickets). The reason for doing this is that the latter may have cheaper flight combinations. We can set up both searches by providing multiple `TravelPlan` to `FlightQuery`:
```python
# ...
FlightQuery.from_travel_plans(
    # Searches for return trip tickets on Google Flights
    TravelPlan(
        "SFO",
        "SEA",
        departure_dates=[f"2023-12-{d}" for d in range(1, 10)],
        return_dates=[f"2023-12-{d}" for d in range(11, 20)],
    ),
    # Searches to-and-fro one-way tickets on Google Flights
    TravelPlan(
        "SFO",
        "SEA",
        departure_dates=[f"2023-12-{d}" for d in range(1, 10)],
    ),
    TravelPlan(
        "SEA",
        "SFO",
        departure_dates=[f"2023-12-{d}" for d in range(11, 20)],
    ),
)
```
bmt-lite-v3.6.0 2.3.0
A zero-dependency near-clone of common bmt capabilities
License: MIT
Requires Python: >=3.9

# Biolink model toolkit - lite!

_bmt-lite_ is a zero-dependency near-clone of a subset of [_bmt_](https://github.com/biolink/biolink-model-toolkit).
It is backed by a pre-populated cache of input/output pairs for many of the more commonly used _bmt_ methods.

_bmt_ alone occupies ~127 KB on disk, but with all of its dependencies it takes up ~36.2 MB. On the other hand, _bmt-lite-1.8.2_ is ~295 KB on disk, of which ~254 KB is the cached data. To initialize a Toolkit from _bmt_ takes ~2 seconds, while initializing a Toolkit from _bmt-lite_ takes ~2e-7 seconds. Because all of _bmt-lite_'s behavior is pre-cached, it does not require the internet at run time.

|   | bmt | bmt-lite (-1.8.2) |
|---|---|---|
| size | 127 KB | 295 KB |
| size w/ deps | 36.2 MB | 295 KB |
| init time | 2 sec | 2e-7 sec |

_* all measurements made on a typical laptop on a random Tuesday afternoon_

Note: _bmt-lite_ does not implement all of the functionality of _bmt_. Feature requests (or pull requests?!) are welcome. In addition, the existing functionality may differ slightly; for example, _bmt-lite_'s element-name/id format conversions are known to differ for some special cases.

# Installation

You must install a specific "flavor" of bmt-lite corresponding to the Biolink model version that you want.
Versions 1.7.0 - 2.2.5 are currently available.

For example,
```bash
pip install bmt-lite-1.8.2
```

# Usage

Use bmt-lite almost exactly like you would use bmt itself: https://github.com/biolink/biolink-model-toolkit#usage

# Development

### Building

```bash
pip install -rrequirements-build.txt
./build.sh
```

### Testing

```bash
pip install -rrequirements-test.txt
tox
```

### Publishing

```bash
pip install twine
twine upload dist/*
```