1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] How can I obtain a comprehensive list of OECD database abbreviations for API...

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024 às 13:12.

  1. Stack

    Stack Membro Participativo

    I am currently using the OECD API to download data from various databases. However, I am struggling to find a comprehensive list of the abbreviations for the databases that the OECD provides for API downloads.

    The list of databases in my code below was generated with the help of ChatGPT, but I've noticed that some of the databases it suggested either don't exist (commented out of the code) or are incorrect. I believe there are additional databases available that aren't in this list.

    Does anyone have a comprehensive list of these abbreviations or a link to such a list?

    Here is the relevant part of my code:

    oecd_databases = [
    "MEI_FIN", # Main Economic Indicators - Financial Indicators
    "MEI_CLI", # Main Economic Indicators - Composite Leading Indicators
    "MEI_REAL", # Main Economic Indicators - Real-time indicators
    #"MEI_PRICES", # Main Economic Indicators - Prices
    "EO", # OECD Economic Outlook
    #"PDB", # OECD Productivity Database
    #"TIVA", # Trade in Value Added
    #"ENV", # OECD Environmental Data
    #"SNA", # National Accounts
    "QNA", # Quarterly National Accounts
    #"LFS", # Labour Force Statistics
    #"HEALTH_STAT", # Health Data
    #"EDU", # Education Statistics
    "ITS", # International Trade Statistics
    "GFS", # Government Finance Statistics
    "PAG", # Pensions Statistics
    "SOCX" # Social Expenditure Database
    ]

    def get_from_oecd(sdmx_query):
    return pd.read_csv(f"https://stats.oecd.org/SDMX-JSON/data/{sdmx_query}?contentType=csv")

    # Loop through each database name in the oecd_databases list
    for index in oecd_databases:
    print(index)
    # Retrieve the DataFrame using the get_from_oecd function
    df = get_from_oecd(index)

    # Save the DataFrame as a separate variable in the global environment
    globals()[f'df_{index}'] = df

    # Now you can access each DataFrame directly as df_MEI_FIN, df_MEI_CLI, etc.


    Any pointers or links to the official list would be much appreciated!

    Continue reading...

Compartilhe esta Página