bnbingo 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bnbingo-0.1.0/.github/workflows/release.yml +88 -0
- bnbingo-0.1.0/.github/workflows/tests.yml +29 -0
- bnbingo-0.1.0/.gitignore +18 -0
- bnbingo-0.1.0/.vscode/settings.json +13 -0
- bnbingo-0.1.0/AGENTS.md +43 -0
- bnbingo-0.1.0/CLAUDE.md +1 -0
- bnbingo-0.1.0/GEMINI.md +1 -0
- bnbingo-0.1.0/LICENSE +21 -0
- bnbingo-0.1.0/Makefile +51 -0
- bnbingo-0.1.0/PKG-INFO +149 -0
- bnbingo-0.1.0/README.md +131 -0
- bnbingo-0.1.0/RELEASING.md +39 -0
- bnbingo-0.1.0/bnbingo/__init__.py +1 -0
- bnbingo-0.1.0/bnbingo/amenities.json +34 -0
- bnbingo-0.1.0/bnbingo/amenities.py +412 -0
- bnbingo-0.1.0/bnbingo/auth.py +61 -0
- bnbingo-0.1.0/bnbingo/benchmarks.json +74 -0
- bnbingo-0.1.0/bnbingo/climate.py +157 -0
- bnbingo-0.1.0/bnbingo/config.py +63 -0
- bnbingo-0.1.0/bnbingo/fetcher.py +681 -0
- bnbingo-0.1.0/bnbingo/host_review.py +430 -0
- bnbingo-0.1.0/bnbingo/main.py +1365 -0
- bnbingo-0.1.0/bnbingo/reporter.py +449 -0
- bnbingo-0.1.0/bnbingo/scorer.py +687 -0
- bnbingo-0.1.0/bnbingo/utils.py +184 -0
- bnbingo-0.1.0/pyproject.toml +68 -0
- bnbingo-0.1.0/scripts/check_visitors.py +94 -0
- bnbingo-0.1.0/scripts/setup_hooks.sh +19 -0
- bnbingo-0.1.0/tests/TESTING.md +35 -0
- bnbingo-0.1.0/tests/__init__.py +0 -0
- bnbingo-0.1.0/tests/data/19643333.json +29528 -0
- bnbingo-0.1.0/tests/test_amenities.py +189 -0
- bnbingo-0.1.0/tests/test_caching.py +82 -0
- bnbingo-0.1.0/tests/test_climate.py +78 -0
- bnbingo-0.1.0/tests/test_compact.py +44 -0
- bnbingo-0.1.0/tests/test_config.py +38 -0
- bnbingo-0.1.0/tests/test_fetcher.py +177 -0
- bnbingo-0.1.0/tests/test_host_review.py +227 -0
- bnbingo-0.1.0/tests/test_main.py +123 -0
- bnbingo-0.1.0/tests/test_patch_inventory.py +58 -0
- bnbingo-0.1.0/tests/test_reporter.py +289 -0
- bnbingo-0.1.0/tests/test_scorer.py +458 -0
- bnbingo-0.1.0/tests/test_utils.py +84 -0
- bnbingo-0.1.0/uv.lock +567 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: macos-latest
|
|
14
|
+
outputs:
|
|
15
|
+
version: ${{ steps.version.outputs.version }}
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: astral-sh/setup-uv@v5
|
|
19
|
+
- name: Read and validate version
|
|
20
|
+
id: version
|
|
21
|
+
run: |
|
|
22
|
+
version=$(uv run python -c "import re, pathlib; print(re.search(r'^__version__ = \"([^\"]+)\"', pathlib.Path('bnbingo/__init__.py').read_text(), re.M).group(1))")
|
|
23
|
+
test "v${version}" = "${GITHUB_REF_NAME}" || { echo "Tag ${GITHUB_REF_NAME} does not match __version__ ${version}"; exit 1; }
|
|
24
|
+
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
25
|
+
- name: Run tests
|
|
26
|
+
run: |
|
|
27
|
+
uv sync --locked
|
|
28
|
+
uv run pytest tests/ -q
|
|
29
|
+
- name: Build sdist and wheel
|
|
30
|
+
run: uv build --out-dir dist
|
|
31
|
+
- name: Verify wheel contents
|
|
32
|
+
run: |
|
|
33
|
+
uv run python - <<'PY'
|
|
34
|
+
import glob, zipfile
|
|
35
|
+
wheel = glob.glob("dist/bnbingo-*.whl")[0]
|
|
36
|
+
names = zipfile.ZipFile(wheel).namelist()
|
|
37
|
+
assert "bnbingo/amenities.json" in names, names
|
|
38
|
+
assert "bnbingo/benchmarks.json" in names, names
|
|
39
|
+
assert "bnbingo/host_review.py" in names, names
|
|
40
|
+
entry = next(n for n in names if n.endswith("entry_points.txt"))
|
|
41
|
+
assert "bnbingo = bnbingo.main:main" in zipfile.ZipFile(wheel).read(entry).decode(), entry
|
|
42
|
+
print(f"Verified {wheel}")
|
|
43
|
+
PY
|
|
44
|
+
- name: Smoke-test built wheel
|
|
45
|
+
run: |
|
|
46
|
+
uv tool install --python 3.14 dist/bnbingo-*.whl
|
|
47
|
+
bnbingo --help
|
|
48
|
+
- uses: actions/upload-artifact@v4
|
|
49
|
+
with:
|
|
50
|
+
name: dist
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
publish:
|
|
54
|
+
needs: build
|
|
55
|
+
runs-on: macos-latest
|
|
56
|
+
environment:
|
|
57
|
+
name: pypi
|
|
58
|
+
url: https://pypi.org/project/bnbingo/
|
|
59
|
+
permissions:
|
|
60
|
+
id-token: write
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/download-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: dist
|
|
65
|
+
path: dist/
|
|
66
|
+
- uses: astral-sh/setup-uv@v5
|
|
67
|
+
- name: Publish to PyPI
|
|
68
|
+
run: uv publish --trusted-publishing always dist/*
|
|
69
|
+
|
|
70
|
+
github-release:
|
|
71
|
+
needs: publish
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
permissions:
|
|
74
|
+
contents: write
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/download-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: dist
|
|
79
|
+
path: dist/
|
|
80
|
+
- name: Create GitHub Release
|
|
81
|
+
env:
|
|
82
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
83
|
+
TAG: ${{ github.ref_name }}
|
|
84
|
+
run: |
|
|
85
|
+
gh release create "$TAG" dist/* \
|
|
86
|
+
--title "$TAG — bnbingo release" \
|
|
87
|
+
--generate-notes \
|
|
88
|
+
--verify-tag
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: macos-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: astral-sh/setup-uv@v5
|
|
14
|
+
- name: Install dependencies
|
|
15
|
+
run: uv sync --locked
|
|
16
|
+
- name: Run test suite
|
|
17
|
+
run: uv run pytest tests/ -q
|
|
18
|
+
|
|
19
|
+
package:
|
|
20
|
+
runs-on: macos-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: astral-sh/setup-uv@v5
|
|
24
|
+
- name: Build wheel
|
|
25
|
+
run: uv build --wheel --out-dir dist
|
|
26
|
+
- name: Install wheel as a tool
|
|
27
|
+
run: |
|
|
28
|
+
uv tool install --python 3.14 dist/bnbingo-*.whl
|
|
29
|
+
bnbingo --help
|
bnbingo-0.1.0/.gitignore
ADDED
bnbingo-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Code Standards
|
|
2
|
+
|
|
3
|
+
- **Indentation**: Use **Tabs** exclusively for all code.
|
|
4
|
+
- **Exception**: Use **Spaces (2 or 4)** only for YAML if required by the specification.
|
|
5
|
+
- **Formatting**: Always run `make format` and `make lint` before finishing any task to ensure compliance with the project's Ruff configuration.
|
|
6
|
+
|
|
7
|
+
# Environment & Execution
|
|
8
|
+
|
|
9
|
+
- **CLI Tool**: The primary way to run searches and benchmark listings is the `bnbingo` CLI executable, installed in PATH (`~/.local/bin/bnbingo`). Run `bnbingo --help` for options.
|
|
10
|
+
- **CLI Reinstall Mandate**: The installed CLI is a snapshot of this repo, not a live link. After committing any change under `bnbingo/`, run `uv tool install --force ~/repos/bnbingo` so agents using `bnbingo` execute the updated code; verify with `bnbingo --help` or a single `--room` run before reporting results.
|
|
11
|
+
- **Host Review**: `--host <id|url>` aggregates every listing and review for one host; it accepts numeric IDs and `/h/...`, `/users/...`, `/rooms/...` links.
|
|
12
|
+
- **Scoring Policy**: Benchmarks load from an explicit `--benchmarks PATH`, then `~/.config/bnbingo/benchmarks.json` (`BNBINGO_CONFIG_DIR`), then the packaged default (`bnbingo/benchmarks.json`). A personal `benchmarks.json` must never live in this repo. There is no search-filters config: every search knob is a CLI flag.
|
|
13
|
+
- **Make Targets**: Use `make` commands strictly for development lifecycle tasks: `make format`, `make lint`, and `make test`. Do not create or use a `make run` target.
|
|
14
|
+
|
|
15
|
+
# Testing & Validation
|
|
16
|
+
|
|
17
|
+
- **Test Suite**: Use `make test` to validate changes.
|
|
18
|
+
|
|
19
|
+
# Currency & Domain Standards
|
|
20
|
+
|
|
21
|
+
- **Primary Currency**: Evaluate, search, and report Airbnb prices in **CAD** by default (`--currency` overrides it; the user's standards still mandate CAD on airbnb.ca).
|
|
22
|
+
- **Listing URLs**: Anytime you mention an Airbnb to the user, embed the full `airbnb.ca` link (`https://www.airbnb.ca/rooms/<id>`) with the dates pre-selected (`?check_in=YYYY-MM-DD&check_out=YYYY-MM-DD&adults=1`).
|
|
23
|
+
- **Nightly Rate Requirement**: **ALWAYS** explicitly output and report the nightly rate (e.g. CAD $XX.XX/night or /nt) alongside total prices in CLI outputs and agent summaries, whether presenting a single listing or multiple listings.
|
|
24
|
+
- **Visitor Policy**: **ALWAYS** flag listings whose house rules explicitly ban visitors (e.g. "no visitors", "only registered guests may enter") — the user wants to bring an occasional date over.
|
|
25
|
+
|
|
26
|
+
# pyairbnb Upgrades
|
|
27
|
+
|
|
28
|
+
Local patches in `bnbingo/fetcher.py` override the upstream package at import time; upgrades swap the venv package and never clobber them. When upstream absorbs a patch (merged PR), delete the local copy.
|
|
29
|
+
|
|
30
|
+
1. `uv lock --upgrade-package pyairbnb && uv sync`
|
|
31
|
+
2. `make test` — `tests/test_patch_inventory.py` fails loudly if a local patch stopped applying after the upgrade.
|
|
32
|
+
3. Live smoke: `uv run bnbingo --room <id> --check_in YYYY-MM-DD --check_out YYYY-MM-DD` — price and reviews must return.
|
|
33
|
+
4. `uv tool install --force ~/repos/bnbingo` — the installed CLI is a snapshot with its own venv.
|
|
34
|
+
|
|
35
|
+
# Development Workflow Mandates
|
|
36
|
+
|
|
37
|
+
After every major code change, the following steps MUST be performed in order:
|
|
38
|
+
1. **Format:** Run `make format` to ensure code style compliance.
|
|
39
|
+
2. **Test:** Run `make test` to ensure no regressions were introduced.
|
|
40
|
+
3. **Stage:** Stage all relevant changes.
|
|
41
|
+
4. **Commit:** Provide a detailed commit message and execute the commit.
|
|
42
|
+
|
|
43
|
+
Do not propose or perform a commit until formatting and testing have passed successfully.
|
bnbingo-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
AGENTS.md
|
bnbingo-0.1.0/GEMINI.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
AGENTS.md
|
bnbingo-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Levon Tumanyan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
bnbingo-0.1.0/Makefile
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.PHONY: survey lint format test check setup clean
|
|
2
|
+
|
|
3
|
+
cities ?=
|
|
4
|
+
check_in ?=
|
|
5
|
+
check_out ?=
|
|
6
|
+
currency ?=
|
|
7
|
+
min_rating ?=
|
|
8
|
+
min_reviews ?=
|
|
9
|
+
|
|
10
|
+
survey:
|
|
11
|
+
uv run bnbingo --survey \
|
|
12
|
+
$(if $(cities),--cities "$(cities)") \
|
|
13
|
+
$(if $(check_in),--check_in $(check_in)) \
|
|
14
|
+
$(if $(check_out),--check_out $(check_out)) \
|
|
15
|
+
$(if $(currency),--currency $(currency)) \
|
|
16
|
+
$(if $(min_rating),--min_rating $(min_rating)) \
|
|
17
|
+
$(if $(min_reviews),--min_reviews $(min_reviews))
|
|
18
|
+
|
|
19
|
+
# Run code linting and formatting checks
|
|
20
|
+
lint:
|
|
21
|
+
uv run ruff check .
|
|
22
|
+
uv run ruff format --check .
|
|
23
|
+
|
|
24
|
+
# Automatically fix linting issues and format code
|
|
25
|
+
format:
|
|
26
|
+
uv run ruff check --fix .
|
|
27
|
+
uv run ruff format .
|
|
28
|
+
|
|
29
|
+
# Run tests
|
|
30
|
+
test:
|
|
31
|
+
uv run pytest
|
|
32
|
+
|
|
33
|
+
# Comprehensive check: format, lint, and test
|
|
34
|
+
check: format lint test
|
|
35
|
+
|
|
36
|
+
# Setup git hooks
|
|
37
|
+
setup:
|
|
38
|
+
cp scripts/setup_hooks.sh .git/hooks/pre-commit
|
|
39
|
+
chmod +x .git/hooks/pre-commit
|
|
40
|
+
echo "Git hooks installed successfully."
|
|
41
|
+
|
|
42
|
+
# Remove cached listings older than 7 days
|
|
43
|
+
clean-cache:
|
|
44
|
+
@COUNT=$$(find .cache/listings -name "*.json" -type f -mtime +7 | wc -l); \
|
|
45
|
+
find .cache/listings -name "*.json" -type f -mtime +7 -delete; \
|
|
46
|
+
echo "Cleaned up $$COUNT old cache files."
|
|
47
|
+
|
|
48
|
+
# Remove temporary files and the virtual environment
|
|
49
|
+
clean:
|
|
50
|
+
rm -rf .venv
|
|
51
|
+
find . -type d -name "__pycache__" -exec rm -rf {} +
|
bnbingo-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bnbingo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Search, verify, and score Airbnb stays against your own criteria
|
|
5
|
+
Project-URL: Homepage, https://github.com/levontumanyan/bnbingo
|
|
6
|
+
Project-URL: Repository, https://github.com/levontumanyan/bnbingo
|
|
7
|
+
Project-URL: Issues, https://github.com/levontumanyan/bnbingo/issues
|
|
8
|
+
Author: Levon Tumanyan
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: cryptography>=42.0.0
|
|
13
|
+
Requires-Dist: geopy>=2.4.1
|
|
14
|
+
Requires-Dist: pyairbnb>=2.2.9
|
|
15
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
16
|
+
Requires-Dist: tqdm>=4.66.0
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# bnbingo
|
|
20
|
+
|
|
21
|
+
Search, verify, and score Airbnb stays against **your** criteria. CLI-first, Python-based, with review sentiment analysis, image-based amenity checks, and exact checkout pricing.
|
|
22
|
+
|
|
23
|
+
Unofficial tool — not affiliated with, endorsed by, or connected to Airbnb, Inc.
|
|
24
|
+
|
|
25
|
+
# Features
|
|
26
|
+
|
|
27
|
+
- Search Airbnb with dates, guests, price, property type, amenities, and neighborhood filters
|
|
28
|
+
- Fetch exact fee-inclusive checkout prices (with a clear warning when Airbnb withholds them)
|
|
29
|
+
- Pull listing details, calendars, and reviews
|
|
30
|
+
- Score listings with weighted metrics, penalties, and hard filters you define
|
|
31
|
+
- Review sentiment analysis, including Spanish noise/cleanliness signals
|
|
32
|
+
- Optional Gemini image verification (is that "workspace" actually a desk?)
|
|
33
|
+
- Verified fast Wi-Fi detection and climate enrichment
|
|
34
|
+
- Multi-city market survey mode for comparing destinations
|
|
35
|
+
- Compact table, CSV, and JSON reports
|
|
36
|
+
|
|
37
|
+
# Install
|
|
38
|
+
|
|
39
|
+
From PyPI (recommended):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv tool install bnbingo
|
|
43
|
+
bnbingo --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`uvx bnbingo --help` runs it without installing. Alternatives: `pipx install bnbingo`, or a venv with `python3 -m venv .venv && . .venv/bin/activate && pip install bnbingo`. Prefer a venv or tool installer over a global `pip install`.
|
|
47
|
+
|
|
48
|
+
From a source checkout:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv tool install --force .
|
|
52
|
+
bnbingo --help
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For development, use `uv sync` and `uv run bnbingo --help`.
|
|
56
|
+
|
|
57
|
+
# Setup
|
|
58
|
+
|
|
59
|
+
No config file is required: every search knob is a CLI flag, and scoring uses a packaged default `benchmarks.json` that ships inside the wheel.
|
|
60
|
+
|
|
61
|
+
To customize scoring (weights, penalties, hard filters), either:
|
|
62
|
+
|
|
63
|
+
- put your own `benchmarks.json` in `~/.config/bnbingo/` (override the directory with `BNBINGO_CONFIG_DIR`), or
|
|
64
|
+
- pass any file explicitly with `--benchmarks PATH`.
|
|
65
|
+
|
|
66
|
+
Resolution order is `--benchmarks PATH`, then the config-dir file, then the packaged default. A malformed or missing `--benchmarks` file fails loudly — it never silently scores listings as zero. If you manage dotfiles with stow, keep your personal `benchmarks.json` in your **private** dotfiles repo under `.config/bnbingo/`.
|
|
67
|
+
|
|
68
|
+
All prices default to CAD on airbnb.ca; pass `--currency` to override. `--check_in` and `--check_out` are required for every mode (a `--room` URL may carry them).
|
|
69
|
+
|
|
70
|
+
Reports, cache, and logs are separate from config:
|
|
71
|
+
|
|
72
|
+
- Running from a source checkout: written into the checkout directory
|
|
73
|
+
- Installed tool: `BNBINGO_HOME` if set, otherwise `~/.local/share/bnbingo`
|
|
74
|
+
|
|
75
|
+
`amenities.json` and the default `benchmarks.json` ship inside the Python package — no setup needed.
|
|
76
|
+
|
|
77
|
+
Optional credentials:
|
|
78
|
+
|
|
79
|
+
- `GEMINI_API_KEY` in the environment or a gitignored `.env` in your config directory (enables image verification and LLM sentiment)
|
|
80
|
+
- `AIRBNB_COOKIE` in the environment or `cookies.txt` in your config directory; otherwise `~/.config/airbnb/cookies.txt` is used if present
|
|
81
|
+
|
|
82
|
+
# Usage
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Search a city
|
|
86
|
+
bnbingo --location "Lisbon, Portugal" --check_in 2027-01-10 --check_out 2027-01-24
|
|
87
|
+
|
|
88
|
+
# Per-night cap, scaled to the stay length
|
|
89
|
+
bnbingo --location "Lisbon, Portugal" --check_in 2027-01-10 --check_out 2027-01-24 --max_nightly 90
|
|
90
|
+
|
|
91
|
+
# Whole-stay budget cap, sent as-is
|
|
92
|
+
bnbingo --location "Arequipa, Peru" --check_in 2027-01-11 --check_out 2027-02-08 --max_total 1200
|
|
93
|
+
|
|
94
|
+
# Must-have amenities beyond the benchmarks hard filters
|
|
95
|
+
bnbingo --location "Valdivia, Chile" --check_in 2027-05-03 --check_out 2027-05-17 --amenities "wifi,kitchen"
|
|
96
|
+
|
|
97
|
+
# Multi-city survey (separate cities with ';'; commas inside city names are kept)
|
|
98
|
+
bnbingo --survey --cities "Lima, Peru;Buenos Aires, Argentina" --check_in 2027-03-01 --check_out 2027-03-29
|
|
99
|
+
|
|
100
|
+
# Inspect one listing
|
|
101
|
+
bnbingo --room 123456789 --calendar --reviews --check_in 2027-01-10 --check_out 2027-01-24
|
|
102
|
+
|
|
103
|
+
# Machine-readable output with an explicit scoring policy
|
|
104
|
+
bnbingo --location "Valparaíso, Chile" --limit 10 --compact --json --benchmarks ~/my-benchmarks.json
|
|
105
|
+
|
|
106
|
+
# Consolidated review of a host: every listing, every review
|
|
107
|
+
bnbingo --host 482816256 --check_in 2027-01-10 --check_out 2027-02-07
|
|
108
|
+
bnbingo --host "https://www.airbnb.ca/h/premium-bed-by-olvia-full-equipped-2" --check_in 2027-01-10 --check_out 2027-02-07 --json --compact
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`--min_price` / `--max_price` are deprecated aliases for the nightly flags and print a warning.
|
|
112
|
+
|
|
113
|
+
# Search completeness
|
|
114
|
+
|
|
115
|
+
A city search geocodes the city name to its administrative bounding box and pages through every listing inside it. Airbnb caps the number of pages it will serve per query, so in dense markets the sweep stops early (`SearchResultsTruncatedWarning`) and listings in any neighborhood — not a specific one — can be missed. Pass `--complete` to subdivide the bounding box until every page fits; it is slower and uses many more requests, but avoids the cap. If the subdivision budget is exhausted, the partial results are still returned with a warning.
|
|
116
|
+
|
|
117
|
+
# Host review
|
|
118
|
+
|
|
119
|
+
`--host` accepts a numeric host ID or an Airbnb `/h/...`, `/users/...`, or `/rooms/...` URL. It enumerates every listing owned by that host, fetches all reviews across them, and prints a per-listing breakdown (with full `airbnb.ca` links and CAD total + nightly prices), overall rating distribution, total review count cross-checked against the listing counts, review date range, and recurring praise/issue themes. Listings whose house rules or description restrict visitors are flagged. `--json` keeps the whole report machine-readable; `--compact` drops the individual review texts.
|
|
120
|
+
|
|
121
|
+
# Price filter semantics
|
|
122
|
+
|
|
123
|
+
Airbnb's search API applies `price_max` to a whole-stay figure, so nightly caps are multiplied by the number of nights before being sent. Its server-side filter is loose, though: listings above the requested cap can still come back. `bnbingo` therefore re-checks the fetched exact total against the requested range and skips listings outside it, in both search and survey mode. Listings whose exact price could not be fetched are kept (their search-API estimate is used) rather than dropped silently.
|
|
124
|
+
|
|
125
|
+
Price caps apply to the whole-stay total including fees. A listing with a missing price is not counted against the cap.
|
|
126
|
+
|
|
127
|
+
# Reports and cache
|
|
128
|
+
|
|
129
|
+
Reports (CSV/JSON), cached listings, and logs live in the data directory (source checkout root, `BNBINGO_HOME`, or `~/.local/share/bnbingo`) and are gitignored. Reports merge across runs for the same location and dates; `--json` output is filtered by the current run's price caps, so older over-budget rows do not appear as results. Cookies live in the config directory and are never tracked.
|
|
130
|
+
|
|
131
|
+
# MCP wrapper (roadmap)
|
|
132
|
+
|
|
133
|
+
The CLI stays the primary interface. If an MCP wrapper is added, it will live in this repo as an optional extra and expose small tools (`search`, `listing_details`, `survey`) that call the library functions directly — not by shelling out to the CLI. Long searches are better suited to a CLI than to blocking MCP tool calls.
|
|
134
|
+
|
|
135
|
+
# Development
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
uv sync
|
|
139
|
+
uv run pytest
|
|
140
|
+
make lint
|
|
141
|
+
make check
|
|
142
|
+
make setup # install the lint/test pre-commit hook
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Releases are tag-driven via GitHub Actions; see [RELEASING.md](RELEASING.md).
|
|
146
|
+
|
|
147
|
+
# License
|
|
148
|
+
|
|
149
|
+
MIT — see `LICENSE`.
|
bnbingo-0.1.0/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# bnbingo
|
|
2
|
+
|
|
3
|
+
Search, verify, and score Airbnb stays against **your** criteria. CLI-first, Python-based, with review sentiment analysis, image-based amenity checks, and exact checkout pricing.
|
|
4
|
+
|
|
5
|
+
Unofficial tool — not affiliated with, endorsed by, or connected to Airbnb, Inc.
|
|
6
|
+
|
|
7
|
+
# Features
|
|
8
|
+
|
|
9
|
+
- Search Airbnb with dates, guests, price, property type, amenities, and neighborhood filters
|
|
10
|
+
- Fetch exact fee-inclusive checkout prices (with a clear warning when Airbnb withholds them)
|
|
11
|
+
- Pull listing details, calendars, and reviews
|
|
12
|
+
- Score listings with weighted metrics, penalties, and hard filters you define
|
|
13
|
+
- Review sentiment analysis, including Spanish noise/cleanliness signals
|
|
14
|
+
- Optional Gemini image verification (is that "workspace" actually a desk?)
|
|
15
|
+
- Verified fast Wi-Fi detection and climate enrichment
|
|
16
|
+
- Multi-city market survey mode for comparing destinations
|
|
17
|
+
- Compact table, CSV, and JSON reports
|
|
18
|
+
|
|
19
|
+
# Install
|
|
20
|
+
|
|
21
|
+
From PyPI (recommended):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv tool install bnbingo
|
|
25
|
+
bnbingo --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`uvx bnbingo --help` runs it without installing. Alternatives: `pipx install bnbingo`, or a venv with `python3 -m venv .venv && . .venv/bin/activate && pip install bnbingo`. Prefer a venv or tool installer over a global `pip install`.
|
|
29
|
+
|
|
30
|
+
From a source checkout:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv tool install --force .
|
|
34
|
+
bnbingo --help
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
For development, use `uv sync` and `uv run bnbingo --help`.
|
|
38
|
+
|
|
39
|
+
# Setup
|
|
40
|
+
|
|
41
|
+
No config file is required: every search knob is a CLI flag, and scoring uses a packaged default `benchmarks.json` that ships inside the wheel.
|
|
42
|
+
|
|
43
|
+
To customize scoring (weights, penalties, hard filters), either:
|
|
44
|
+
|
|
45
|
+
- put your own `benchmarks.json` in `~/.config/bnbingo/` (override the directory with `BNBINGO_CONFIG_DIR`), or
|
|
46
|
+
- pass any file explicitly with `--benchmarks PATH`.
|
|
47
|
+
|
|
48
|
+
Resolution order is `--benchmarks PATH`, then the config-dir file, then the packaged default. A malformed or missing `--benchmarks` file fails loudly — it never silently scores listings as zero. If you manage dotfiles with stow, keep your personal `benchmarks.json` in your **private** dotfiles repo under `.config/bnbingo/`.
|
|
49
|
+
|
|
50
|
+
All prices default to CAD on airbnb.ca; pass `--currency` to override. `--check_in` and `--check_out` are required for every mode (a `--room` URL may carry them).
|
|
51
|
+
|
|
52
|
+
Reports, cache, and logs are separate from config:
|
|
53
|
+
|
|
54
|
+
- Running from a source checkout: written into the checkout directory
|
|
55
|
+
- Installed tool: `BNBINGO_HOME` if set, otherwise `~/.local/share/bnbingo`
|
|
56
|
+
|
|
57
|
+
`amenities.json` and the default `benchmarks.json` ship inside the Python package — no setup needed.
|
|
58
|
+
|
|
59
|
+
Optional credentials:
|
|
60
|
+
|
|
61
|
+
- `GEMINI_API_KEY` in the environment or a gitignored `.env` in your config directory (enables image verification and LLM sentiment)
|
|
62
|
+
- `AIRBNB_COOKIE` in the environment or `cookies.txt` in your config directory; otherwise `~/.config/airbnb/cookies.txt` is used if present
|
|
63
|
+
|
|
64
|
+
# Usage
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Search a city
|
|
68
|
+
bnbingo --location "Lisbon, Portugal" --check_in 2027-01-10 --check_out 2027-01-24
|
|
69
|
+
|
|
70
|
+
# Per-night cap, scaled to the stay length
|
|
71
|
+
bnbingo --location "Lisbon, Portugal" --check_in 2027-01-10 --check_out 2027-01-24 --max_nightly 90
|
|
72
|
+
|
|
73
|
+
# Whole-stay budget cap, sent as-is
|
|
74
|
+
bnbingo --location "Arequipa, Peru" --check_in 2027-01-11 --check_out 2027-02-08 --max_total 1200
|
|
75
|
+
|
|
76
|
+
# Must-have amenities beyond the benchmarks hard filters
|
|
77
|
+
bnbingo --location "Valdivia, Chile" --check_in 2027-05-03 --check_out 2027-05-17 --amenities "wifi,kitchen"
|
|
78
|
+
|
|
79
|
+
# Multi-city survey (separate cities with ';'; commas inside city names are kept)
|
|
80
|
+
bnbingo --survey --cities "Lima, Peru;Buenos Aires, Argentina" --check_in 2027-03-01 --check_out 2027-03-29
|
|
81
|
+
|
|
82
|
+
# Inspect one listing
|
|
83
|
+
bnbingo --room 123456789 --calendar --reviews --check_in 2027-01-10 --check_out 2027-01-24
|
|
84
|
+
|
|
85
|
+
# Machine-readable output with an explicit scoring policy
|
|
86
|
+
bnbingo --location "Valparaíso, Chile" --limit 10 --compact --json --benchmarks ~/my-benchmarks.json
|
|
87
|
+
|
|
88
|
+
# Consolidated review of a host: every listing, every review
|
|
89
|
+
bnbingo --host 482816256 --check_in 2027-01-10 --check_out 2027-02-07
|
|
90
|
+
bnbingo --host "https://www.airbnb.ca/h/premium-bed-by-olvia-full-equipped-2" --check_in 2027-01-10 --check_out 2027-02-07 --json --compact
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`--min_price` / `--max_price` are deprecated aliases for the nightly flags and print a warning.
|
|
94
|
+
|
|
95
|
+
# Search completeness
|
|
96
|
+
|
|
97
|
+
A city search geocodes the city name to its administrative bounding box and pages through every listing inside it. Airbnb caps the number of pages it will serve per query, so in dense markets the sweep stops early (`SearchResultsTruncatedWarning`) and listings in any neighborhood — not a specific one — can be missed. Pass `--complete` to subdivide the bounding box until every page fits; it is slower and uses many more requests, but avoids the cap. If the subdivision budget is exhausted, the partial results are still returned with a warning.
|
|
98
|
+
|
|
99
|
+
# Host review
|
|
100
|
+
|
|
101
|
+
`--host` accepts a numeric host ID or an Airbnb `/h/...`, `/users/...`, or `/rooms/...` URL. It enumerates every listing owned by that host, fetches all reviews across them, and prints a per-listing breakdown (with full `airbnb.ca` links and CAD total + nightly prices), overall rating distribution, total review count cross-checked against the listing counts, review date range, and recurring praise/issue themes. Listings whose house rules or description restrict visitors are flagged. `--json` keeps the whole report machine-readable; `--compact` drops the individual review texts.
|
|
102
|
+
|
|
103
|
+
# Price filter semantics
|
|
104
|
+
|
|
105
|
+
Airbnb's search API applies `price_max` to a whole-stay figure, so nightly caps are multiplied by the number of nights before being sent. Its server-side filter is loose, though: listings above the requested cap can still come back. `bnbingo` therefore re-checks the fetched exact total against the requested range and skips listings outside it, in both search and survey mode. Listings whose exact price could not be fetched are kept (their search-API estimate is used) rather than dropped silently.
|
|
106
|
+
|
|
107
|
+
Price caps apply to the whole-stay total including fees. A listing with a missing price is not counted against the cap.
|
|
108
|
+
|
|
109
|
+
# Reports and cache
|
|
110
|
+
|
|
111
|
+
Reports (CSV/JSON), cached listings, and logs live in the data directory (source checkout root, `BNBINGO_HOME`, or `~/.local/share/bnbingo`) and are gitignored. Reports merge across runs for the same location and dates; `--json` output is filtered by the current run's price caps, so older over-budget rows do not appear as results. Cookies live in the config directory and are never tracked.
|
|
112
|
+
|
|
113
|
+
# MCP wrapper (roadmap)
|
|
114
|
+
|
|
115
|
+
The CLI stays the primary interface. If an MCP wrapper is added, it will live in this repo as an optional extra and expose small tools (`search`, `listing_details`, `survey`) that call the library functions directly — not by shelling out to the CLI. Long searches are better suited to a CLI than to blocking MCP tool calls.
|
|
116
|
+
|
|
117
|
+
# Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
uv sync
|
|
121
|
+
uv run pytest
|
|
122
|
+
make lint
|
|
123
|
+
make check
|
|
124
|
+
make setup # install the lint/test pre-commit hook
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Releases are tag-driven via GitHub Actions; see [RELEASING.md](RELEASING.md).
|
|
128
|
+
|
|
129
|
+
# License
|
|
130
|
+
|
|
131
|
+
MIT — see `LICENSE`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
Push a `v*` tag to release. Merging PRs or pushing to `main` only runs CI; nothing is published.
|
|
4
|
+
|
|
5
|
+
## First release: configure PyPI trusted publishing
|
|
6
|
+
|
|
7
|
+
Before the first tag, add a pending publisher at <https://pypi.org/manage/account/publishing/>:
|
|
8
|
+
|
|
9
|
+
- PyPI project name: `bnbingo`
|
|
10
|
+
- Owner: `levontumanyan`
|
|
11
|
+
- Repository name: `bnbingo`
|
|
12
|
+
- Workflow name: `release.yml`
|
|
13
|
+
- Environment name: `pypi`
|
|
14
|
+
|
|
15
|
+
Without this, the `publish` job will fail at `uv publish`.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
1. Bump `__version__` in `bnbingo/__init__.py` (the sole version source; `pyproject.toml` reads it dynamically). Pick a version above the current PyPI release — PyPI versions are immutable.
|
|
20
|
+
2. Commit and push to `main`; wait for CI to pass.
|
|
21
|
+
3. Push a tag matching the version:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
git tag vX.Y.Z && git push origin vX.Y.Z
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If `git push` hangs in a non-interactive shell, create the ref via the API:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
SHA=$(git rev-parse HEAD)
|
|
31
|
+
curl -X POST https://api.github.com/repos/levontumanyan/bnbingo/git/refs \
|
|
32
|
+
-H "Authorization: Bearer $(gh auth token)" \
|
|
33
|
+
-H "Accept: application/vnd.github+json" \
|
|
34
|
+
-d "{\"ref\":\"refs/tags/vX.Y.Z\",\"sha\":\"$SHA\"}"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`.github/workflows/release.yml` then validates the tag against `__version__`, runs tests, builds and verifies the sdist/wheel, smoke-tests the installed wheel, publishes to PyPI via OIDC (environment `pypi`), and creates a GitHub Release with the artifacts attached.
|
|
38
|
+
|
|
39
|
+
Verify at <https://pypi.org/project/bnbingo/> and <https://github.com/levontumanyan/bnbingo/releases>, or with `uv tool install bnbingo && bnbingo --help`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"essentials": {
|
|
3
|
+
"wifi": 4,
|
|
4
|
+
"kitchen": 8,
|
|
5
|
+
"washer": 33,
|
|
6
|
+
"dryer": 34,
|
|
7
|
+
"ac": 5,
|
|
8
|
+
"air_conditioning": 5,
|
|
9
|
+
"heating": 30,
|
|
10
|
+
"dedicated_workspace": 47,
|
|
11
|
+
"tv": 1,
|
|
12
|
+
"iron": 40
|
|
13
|
+
},
|
|
14
|
+
"features": {
|
|
15
|
+
"pool": 7,
|
|
16
|
+
"free_parking": 9,
|
|
17
|
+
"gym": 15,
|
|
18
|
+
"hot_tub": 25,
|
|
19
|
+
"elevator": 21,
|
|
20
|
+
"ev_charger": 41
|
|
21
|
+
},
|
|
22
|
+
"safety": {
|
|
23
|
+
"smoke_alarm": 35,
|
|
24
|
+
"carbon_monoxide_alarm": 36,
|
|
25
|
+
"fire_extinguisher": 39,
|
|
26
|
+
"first_aid_kit": 37
|
|
27
|
+
},
|
|
28
|
+
"services": {
|
|
29
|
+
"breakfast": 16,
|
|
30
|
+
"self_check_in": 51,
|
|
31
|
+
"luggage_drop_off": 73,
|
|
32
|
+
"long_term_stays": 85
|
|
33
|
+
}
|
|
34
|
+
}
|