Coder Social home page Coder Social logo

dbt-project's Introduction

Airbnb Data Analysis with dbt

This project uses dbt (Data Build Tool) to transform and analyze Airbnb listings and reviews data. The project includes models for data aggregation and analysis.

Project Structure

├── models/
│   ├── stg_listings.sql
│   ├── stg_reviews.sql
│   ├── listings_aggregates.sql
│   ├── room_type_aggregates.sql
├── analyses/
│   └── identify_missing_values.sql
├── schemas/
│   └── schema.yml
├── dbt_project.yml
├── README.md

Models

  • stg_listings.sql: Staging model for listings data.
  • stg_reviews.sql: Staging model for reviews data.
  • listings_aggregates.sql: Model that performs aggregations on listings and reviews data.
  • room_type_aggregates.sql: Model that performs aggregations by room type and neighborhood.

Analyses

  • identify_missing_values.sql: SQL script to identify missing values in the staging tables.

Schema

  • schema.yml: Defines tests for the source tables and models.

Setup

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_directory>
  2. Install dbt:

    pip install dbt
  3. Set up your dbt profile: Create a profiles.yml file in the ~/.dbt/ directory with the following content:

    airbnb:
      target: dev
      outputs:
        dev:
          type: snowflake
          account: <your_account>
          user: <your_username>
          password: <your_password>
          role: <your_role>
          database: <your_database>
          warehouse: <your_warehouse>
          schema: dev
          threads: 4
  4. Run dbt:

    dbt run
  5. Run tests:

    dbt test

Usage

  • To run the models and create the transformed tables/views, use:

    dbt run
  • To test the models, use:

    dbt test
  • To generate documentation, use:

    dbt docs generate
  • To serve the documentation, use:

    dbt docs serve

Models

stg_listings.sql

Staging model for the listings table from the source data.

stg_reviews.sql

Staging model for the reviews table from the source data.

listings_aggregates.sql

Aggregates listings and reviews data to calculate the average price and total reviews by neighborhood.

room_type_aggregates.sql

Aggregates listings data to calculate the average price, total listings, and average availability by room type and neighborhood.

Analyses

identify_missing_values.sql

Identifies missing values in the stg_listings and stg_reviews tables.

Customizing

You can customize the models and analyses to fit your specific needs. Modify the SQL scripts in the models and analyses directories as needed.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contributions

Contributions are welcome! Please create a pull request or open an issue to discuss the changes.

Contact

For any questions or issues, please contact [Abhijeet Singh] at [[email protected]].

dbt-project's People

Contributors

abhijeetgithu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.