Get CSV data from URL using Pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
years = [2022, 2023] | |
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | |
account_token = '52106c49-445d-44b4-b88b-1b9a636a1ab2' | |
for year in years: | |
for month in months: | |
month_string = str(month).zfill(2) | |
url = f'https://mercadoradar-datashare.s3.us-east-2.amazonaws.com/{year}/{month_string}/01/{account_token}.csv' | |
df = pd.read_csv(url) | |
df.to_csv(f'./{year}_{month_string}_MERCADORADAR.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment