Skip to content

Instantly share code, notes, and snippets.

@bugcy013
Created March 4, 2022 08:52
Show Gist options
  • Save bugcy013/46c05e4963df92c2f073e1bb93e40290 to your computer and use it in GitHub Desktop.
Save bugcy013/46c05e4963df92c2f073e1bb93e40290 to your computer and use it in GitHub Desktop.
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