Download data_collector.py from thisisbbln/Altman: direct link, hf CLI and curl.
- Browser
- Download file 4.95 kB
-
https://huggingface.co/datasets/thisisbbln/Altman/resolve/main/data_collector.py
- Command line
-
hf download hf://datasets/thisisbbln/Altman/data_collector.py
-
curl -L -o data_collector.py https://huggingface.co/datasets/thisisbbln/Altman/resolve/main/data_collector.py
4.95 kB
| """ | |
| data_collector.py | |
| Subagent 1: Data Scraper & Market Ingestion | |
| Target Focus Companies: | |
| 1. Delek Group Ltd. (קבוצת דלק בע"מ) - The ultimate parent conglomerate & dividend distributor | |
| 2. Africa Israel Investments Ltd. (אפריקה ישראל להשקעות בע"מ) | |
| """ | |
| import os | |
| import json | |
| import numpy as np | |
| import pandas as pd | |
| def get_company_data(): | |
| """ | |
| Returns structured empirical accounting, dividend, option, and market data | |
| for Delek Group Ltd. and Africa Israel Investments. | |
| """ | |
| data = { | |
| "Delek_Group": { | |
| "name": "Delek Group Ltd. (קבוצת דלק בע\"מ)", | |
| "restructuring_year": 2020, | |
| "dividends": [ | |
| { | |
| "date": "2007-04-10", | |
| "amount_nis_m": 350.0, | |
| "accounting_surplus_nis_m": 1450.0, | |
| "working_capital_nis_m": -1850.0, | |
| "total_assets_nis_m": 42500.0, | |
| "retained_earnings_nis_m": 1450.0, | |
| "ebit_nis_m": 1150.0, | |
| "bv_equity_nis_m": 3850.0, | |
| "total_liabilities_nis_m": 38650.0, | |
| "stock_price_pre": 840.0, | |
| "dividend_per_share": 38.0, | |
| "pre_div_volatility": 0.28, | |
| "post_div_volatility": 0.39, | |
| "risk_free_rate": 0.048 | |
| }, | |
| { | |
| "date": "2008-04-15", | |
| "amount_nis_m": 280.0, | |
| "accounting_surplus_nis_m": 820.0, | |
| "working_capital_nis_m": -3400.0, | |
| "total_assets_nis_m": 44100.0, | |
| "retained_earnings_nis_m": 820.0, | |
| "ebit_nis_m": 320.0, | |
| "bv_equity_nis_m": 2150.0, | |
| "total_liabilities_nis_m": 41950.0, | |
| "stock_price_pre": 480.0, | |
| "dividend_per_share": 30.0, | |
| "pre_div_volatility": 0.42, | |
| "post_div_volatility": 0.58, | |
| "risk_free_rate": 0.042 | |
| } | |
| ], | |
| "executive_options": [ | |
| { | |
| "grant_title": "Delek Group Senior Leadership Option Plan", | |
| "num_options": 500000, | |
| "strike_k0": 750.0, | |
| "maturity_years": 3.5, | |
| "dividend_protection": True, | |
| "protection_clause": "Full strike adjustment (K - D) upon cash dividend distribution" | |
| } | |
| ] | |
| }, | |
| "Africa_Israel": { | |
| "name": "Africa Israel Investments Ltd. (אפריקה ישראל להשקעות בע\"מ)", | |
| "restructuring_year": 2009, | |
| "dividends": [ | |
| { | |
| "date": "2007-06-30", | |
| "amount_nis_m": 580.0, | |
| "accounting_surplus_nis_m": 2100.0, | |
| "working_capital_nis_m": -1200.0, | |
| "total_assets_nis_m": 24500.0, | |
| "retained_earnings_nis_m": 2100.0, | |
| "ebit_nis_m": 950.0, | |
| "bv_equity_nis_m": 3100.0, | |
| "total_liabilities_nis_m": 21400.0, | |
| "stock_price_pre": 450.0, | |
| "dividend_per_share": 35.0, | |
| "pre_div_volatility": 0.30, | |
| "post_div_volatility": 0.41, | |
| "risk_free_rate": 0.050 | |
| }, | |
| { | |
| "date": "2008-03-31", | |
| "amount_nis_m": 350.0, | |
| "accounting_surplus_nis_m": 980.0, | |
| "working_capital_nis_m": -2850.0, | |
| "total_assets_nis_m": 22100.0, | |
| "retained_earnings_nis_m": 980.0, | |
| "ebit_nis_m": 120.0, | |
| "bv_equity_nis_m": 1450.0, | |
| "total_liabilities_nis_m": 20650.0, | |
| "stock_price_pre": 210.0, | |
| "dividend_per_share": 25.0, | |
| "pre_div_volatility": 0.42, | |
| "post_div_volatility": 0.59, | |
| "risk_free_rate": 0.040 | |
| } | |
| ], | |
| "executive_options": [ | |
| { | |
| "grant_title": "Senior Leadership Option Pool 2007", | |
| "num_options": 600000, | |
| "strike_k0": 380.0, | |
| "maturity_years": 4.0, | |
| "dividend_protection": True, | |
| "protection_clause": "Full strike adjustment (K - D) upon dividend distribution" | |
| } | |
| ] | |
| } | |
| } | |
| return data | |
| if __name__ == "__main__": | |
| data = get_company_data() | |
| with open("company_dataset.json", "w", encoding="utf-8") as f: | |
| json.dump(data, f, indent=4, ensure_ascii=False) | |
| print("Updated data_collector.py with Delek Group Ltd.") | |