Skip to content

feat: add hotel data parser with cleanup, validation, and db integration - #28

Merged
selvarajuv merged 3 commits into
mainfrom
5-hotel-data-parser
Oct 5, 2026
Merged

selvarajuv merged 3 commits into
mainfrom
5-hotel-data-parser

Conversation

@bhuvanh66

Copy link
Copy Markdown
Collaborator

Summary

Closes #5

We created a HotelDataParser class to centralize running the parser and the required cleaning and validation steps. We have a run function which should just be a command to initiate the hotel parser and it returns the final transformed data. (.venv) bhuvanhospet@Bhuvans-MacBook-Pro backend % export PYTHONPATH=src
(.venv) bhuvanhospet@Bhuvans-MacBook-Pro backend % python src/parsers/hotel_data_parser.py
--input data/2022.csv
--hotel-name "Sample Hotel"
--db-url "postgresql+psycopg2://foresight:foresight@localhost:5433/foresight_db"
2026-09-28 21:08:13,291 - INFO - Hotel data parser started.
2026-09-28 21:08:13,291 - INFO - Loading hotel data...
2026-09-28 21:08:13,295 - INFO - File loaded: data/2022.csv
2026-09-28 21:08:13,295 - INFO - Rows: 365
2026-09-28 21:08:13,295 - INFO - Columns: 32
2026-09-28 21:08:13,295 - INFO - Cleaning hotel data...

also we need to put data in the backend/data folder (added to gitignore)

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code change that neither fixes a bug nor adds a feature
  • perf — performance improvement
  • test — adding or updating tests
  • chore / build / ci — tooling, deps, or pipeline changes

Changes

  • Added hotel parser class and cleaning/validation transforms

Database migrations

  • No schema changes
  • Includes an Alembic migration (just migrate-create "...")
  • Migration runs cleanly (just migrate) and rolls back (just migrate-down)

Checklist

  • Commits follow Conventional Commits
  • Lint passes (just lint) and code is formatted (just format)
  • Pre-commit hooks run clean (just hooks installed)
  • Updated docs / README / .env.example where relevant
  • Tested locally (just dev) and verified the API at http://localhost:8000/docs

How to test

Notes for reviewers

@bhuvanh66
bhuvanh66 force-pushed the 5-hotel-data-parser branch 2 times, most recently from 2cdf285 to da68bbb Compare September 30, 2026 17:50
@bhuvanh66 bhuvanh66 changed the title 5 hotel data parser feat(parser): add hotel data parser with cleanup, validation, and db integration Sep 30, 2026
@bhuvanh66
bhuvanh66 force-pushed the 5-hotel-data-parser branch 2 times, most recently from 09fcce6 to 32ef27b Compare September 30, 2026 17:58
@selvarajuv selvarajuv changed the title feat(parser): add hotel data parser with cleanup, validation, and db integration feat: add hotel data parser with cleanup, validation, and db integration Sep 30, 2026
@selvarajuv
selvarajuv merged commit fe7cbe3 into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hotel data parser

3 participants