Created
May 16, 2023 18:38
-
-
Save sandrovw64/f2c209419220a998bbd81d8296dc8f1e to your computer and use it in GitHub Desktop.
Get CSV data from URL using Pandas
This file contains hidden or 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