Skip to content

Commit

Permalink
Add schemas to constants file
Browse files Browse the repository at this point in the history
  • Loading branch information
flpmonteiro committed Apr 12, 2024
1 parent cb0fd3c commit 502169a
Showing 1 changed file with 64 additions and 5 deletions.
69 changes: 64 additions & 5 deletions nyc_citibike/assets/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
BIKE_RIDES_FILE_PATH = "data/raw/bike_rides_{}.csv"
DOWNLOAD_URL = "https://s3.amazonaws.com/tripdata/JC-{}-citibike-tripdata.csv.zip"
RAW_FILE_PATH = "data/raw"

DATE_FORMAT = "%Y%m"
START_DATE = "202301"
END_DATE = "202312"
RAW_FILE_NAME = "bike_rides_{}.csv"

# HISTORIC_DOWNLOAD_URL = "https://s3.amazonaws.com/tripdata/{}-citibike-tripdata.zip"
HISTORIC_DOWNLOAD_URL = 'http:https://127.0.0.1:8000/{}-citibike-tripdata.zip'

CURRENT_DOWNLOAD_URL = "https://s3.amazonaws.com/tripdata/{}-citibike-tripdata.csv.zip"

START_DATE = "202401"
END_DATE = "202403"

HISTORIC_START_YEAR = "2020"
HISTORIC_END_YEAR = "2024"

SCHEMA = {"ride_id": "STRING",
"rideable_type": "STRING",
"start_time": "TIMESTAMP",
"stop_time": "TIMESTAMP",
"start_station_name": "STRING",
"start_station_id": "STRING",
"end_station_name": "STRING",
"end_station_id": "STRING",
"start_station_latitude": "NUMERIC",
"start_station_longitude": "NUMERIC",
"end_station_latitude": "NUMERIC",
"end_station_longitude": "NUMERIC",
"user_type": "STRING",
"trip_duration": "NUMERIC",
"bike_id": "INTEGER",
"gender": "STRING",
"birth_year": "STRING"
}

SCHEMA_OLD = {"ride_id": "STRING",
"rideable_type": "STRING",
"started_at": "TIMESTAMP",
"ended_at": "TIMESTAMP",
"start_station_name": "STRING",
"start_station_id": "STRING",
"end_station_name": "STRING",
"end_station_id": "STRING",
"start_lat": "NUMERIC",
"start_lng": "NUMERIC",
"end_lat": "NUMERIC",
"end_lng": "NUMERIC",
"member_casual": "STRING"
}


SCHEMA_NEW = {
"ride_id": "STRING",
"rideable_type": "STRING",
"started_at": "STRING",
"ended_at": "STRING",
"start_station_name": "STRING",
"start_station_id": "STRING",
"end_station_name": "STRING",
"end_station_id": "STRING",
"start_lat": "STRING",
"start_lng": "STRING",
"end_lat": "STRING",
"end_lng": "STRING",
"member_casual": "STRING",
}

0 comments on commit 502169a

Please sign in to comment.