diff --git a/.gitignore b/.gitignore index f8e1378..c0a06d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env .venv sec_data/ +CIK* \ No newline at end of file diff --git a/write_to_db.py b/write_to_db.py new file mode 100644 index 0000000..95bd095 --- /dev/null +++ b/write_to_db.py @@ -0,0 +1,23 @@ +import json + +# Step 1: Load the JSON data from a file +with open('CIK0000320193.json', 'r') as file: + data = json.load(file) + +# Step 2: Access the 'facts' section +facts_section = data.get('facts', {}) + +# Step 3: Initialize an empty list to store labels +labels_list = [] + +# Step 4: Iterate over each category in the 'facts' section +for category, facts in facts_section.items(): + for fact_name, fact_data in facts.items(): + label = fact_data.get('label') + if label: + labels_list.append(label) + +# Step 5: Output the list of labels +print("List of all labels:") +for label in labels_list: + print(label)