Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior when downloading OECD23 multiple times #156

Open
spjuhel opened this issue Feb 10, 2025 · 0 comments
Open

Strange behavior when downloading OECD23 multiple times #156

spjuhel opened this issue Feb 10, 2025 · 0 comments

Comments

@spjuhel
Copy link

spjuhel commented Feb 10, 2025

Running download_oecd for OECDv23 multiple times weirdly renames files within the download folder (with and without overwriting=True). See example below.

I assume there is a problem in the renaming after the extraction of the downloaded zip file here:

if version == "v2023":
for file in os.listdir(storage_folder):
absolute_path = os.path.join(storage_folder, file)
os.rename(
os.path.join(storage_folder, file),
os.path.join(
storage_folder,
"ICIO2023_" + file.replace("_SML", ""),
),
)

download_oecd("~/downloads", years="1995-2000")

contents of "~/downloads":

download_log.json
ICIO2023_1995.csv
ICIO2023_1996.csv
ICIO2023_1998.csv
ICIO2023_1997.csv
ICIO2023_1999.csv
ICIO2023_2000.csv

Running it again:

download_oecd("~/downloads", years="1995-2000")

contents of "~/downloads":

download_log.json
ICIO2023_download_log.json
ICIO2023_1996.csv
ICIO2023_ICIO2023_1997.csv
ICIO2023_ICIO2023_1996.csv
ICIO2023_ICIO2023_1999.csv
ICIO2023_ICIO2023_1995.csv
ICIO2023_ICIO2023_1998.csv
ICIO2023_1999.csv
ICIO2023_1996.csv
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

No branches or pull requests

1 participant