Skip to main content

Airbnb short-term rental pricing analysis package

Project description

BnBInsight — Airbnb Short-Term Rental Pricing Analysis

STAT 386 Final Project — A Python package that demonstrates the full data-science pipeline for short-term rental pricing analysis.


Hypothesis

Primary hypothesis: Listings with more bedrooms, higher ratings, and more amenities have significantly higher nightly prices.

Statement
H₀ Bedrooms, rating, and amenities count have no relationship with nightly price.
H₁ Bedrooms, rating, and amenities count positively predict nightly price.

Statistical model: log_price ~ bedrooms + rating + amenities_count


Data Sources

Source Purpose
Kaggle Airbnb Listings Primary analysis dataset
AirROI API Demonstrates original data acquisition pipeline

Installation

# Clone the repo
git clone https://github.com/mbgardin/BnBInsight.git
cd BnBInsight

# Install dependencies
pip install -r requirements.txt

# Install the package in editable mode
pip install -e .

Project Structure

airbnb-pricing-project/
├── src/bnbinsight/        # Core package modules
│   ├── data_collectionls.py # Load Kaggle CSV & fetch AirROI API
│   ├── cleaning.py        # Clean price, rating, bedrooms, etc.
│   ├── features.py        # Amenity count, log price, feature selection
│   ├── analysis.py        # Summary stats, OLS regression, flagging
│   ├── visualization.py   # Price distribution, scatter, box plots
│   └── utils.py           # Helper utilities
├── scripts/               # Pipeline scripts
│   ├── fetch_data.py      # Fetch AirROI data
│   ├── clean_data.py      # Clean raw → processed
│   └── run_analysis.py    # Run full analysis
├── app/
│   └── streamlit_app.py   # Interactive dashboard
├── data/
│   ├── raw/               # Raw CSV / JSON
│   └── processed/         # Cleaned dataset
├── docs/                  # Quarto documentation
├── tests/                 # Unit tests
├── pyproject.toml
├── requirements.txt
└── README.md

How to Run

1. Place your data

Put the Kaggle Airbnb CSV in data/raw/kaggle_airbnb.csv.

2. (Optional) Fetch API data

export AIRROI_API_KEY=your_key_here
python scripts/fetch_data.py

3. Clean the data

python scripts/clean_data.py

4. Run the analysis

python scripts/run_analysis.py

5. Launch the dashboard

streamlit run app/streamlit_app.py

Run Tests

python -m pytest tests/

Documentation

Full documentation (built with Quarto) is available on GitHub Pages, as well as the hosted streamlit app: https://bnbinsight.streamlit.app/

https://mbgardin.github.io/BnBInsight/


License

This project is for educational purposes (BYU STAT 386).

Project details


Download files

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

Source Distribution

bnbinsight-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

bnbinsight-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file bnbinsight-0.1.0.tar.gz.

File metadata

  • Download URL: bnbinsight-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for bnbinsight-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b24a5c64aa165d765096e3e1ce7769c5bcd36b6ee7d16d6aa9a79bcd30d9efd9
MD5 256cc389c25b84c182f561e2295abc42
BLAKE2b-256 0f100ca8365c34ffd91497162e68ee46c040ccb2132b56053cd32e3f07245ded

See more details on using hashes here.

File details

Details for the file bnbinsight-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bnbinsight-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for bnbinsight-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c73a8fb4c5251b8852ca025884dcac9f130cc71a67d4a6076ad757f03fb0c9eb
MD5 fcc67e3d4452375df7342ab747fe61b6
BLAKE2b-256 f40705bca5bc206ffd29fbfee822974e7b53a03cb8c50937f3123c98e70595f8

See more details on using hashes here.

Supported by

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