Created
March 4, 2022 08:52
-
-
Save bugcy013/46c05e4963df92c2f073e1bb93e40290 to your computer and use it in GitHub Desktop.
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 requests | |
import logging | |
import pandas as pd | |
level = "INFO" | |
logging.basicConfig(level=level, format="%(levelname)-10s| %(asctime)-10s | %(funcName)-10s | %(message)s") | |
def get_request(): | |
all_items = [] | |
for offset in range(0, 1000, 100): | |
url = "https://registry.terraform.io/v1/modules?limit=100&provider=azurerm&offset=" + str(offset) | |
response = requests.get(url=url).json()["modules"] | |
all_items.extend(response) | |
print(url) | |
all_items = pd.DataFrame(all_items) | |
all_items.to_csv("azurerm_modules.csv") | |
if __name__ == '__main__': | |
get_request() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment