Python client for the eventstudytools.com research apps: run abnormal-return event studies (and the other research apps) straight from Python. No third-party dependencies — standard library only, Python 3.8+.
pip install git+https://github.com/EventStudyTools/python-wrapper.gitRequest your free API key at
eventstudytools.com/api-key.
Pass it as EventStudyAPI("...") or set the EST_API_KEY environment
variable.
from eventstudytools import EventStudyAPI, ARCInput
api = EventStudyAPI("YOUR_API_KEY")
results = api.run(
ARCInput(benchmark_model="mm", return_type="log"),
files={
"request_file": "01_RequestFile.csv",
"firm_data": "02_FirmData.csv",
"market_data": "03_MarketData.csv",
},
dest_dir="results",
)
for rf in results:
print(rf.name, "->", rf.local_path)A complete runnable example with sample data (20 US firms, S&P 500
benchmark) lives in examples/.
run() wraps the five protocol steps; you can also drive them yourself:
api = EventStudyAPI("YOUR_API_KEY")
api.authenticate() # create task, obtain task token
api.configure(ARCInput()) # send analysis configuration
api.upload("request_file", "01_RequestFile.csv")
api.upload("firm_data", "02_FirmData.csv")
api.upload("market_data", "03_MarketData.csv")
api.commit() # server-side input validation
api.process() # launch calculation
api.download_results("results") # poll + downloadSemicolon-separated CSV files without header rows, dates as dd.mm.yyyy.
Request file (one row per event):
| Column | Content |
|---|---|
| 1 | Event ID (unique integer) |
| 2 | Firm ID (must match firm data) |
| 3 | Market/index ID (must match market data) |
| 4 | Event date (dd.mm.yyyy) |
| 5 | Grouping variable (for grouped AAR/CAAR results) |
| 6 | Event window start (e.g. -10) |
| 7 | Event window end (e.g. 10) |
| 8 | Estimation window end (e.g. -11) |
| 9 | Estimation window length (e.g. 120) |
Firm data: Firm ID; Date; Closing price — Market data:
Market ID; Date; Index value.
| Parameter | Values | Default |
|---|---|---|
benchmark_model |
mm, mm-sw, mam, cpmam, ff3fm, ffm4fm, ff5fm, garch, egarch, capm |
mm |
return_type |
log, simple |
log |
non_trading_days |
later, earlier, keep, skip |
later |
result_file_type |
csv, xls, xlsx, ods |
csv |
test_statistics |
see eventstudytools.ARC_TEST_STATISTICS |
six workhorse statistics |
AVCInput— abnormal volume calculatorAVyCInput— abnormal volatility calculatorCATAInput— content analysis (news analytics); uploadstext_data+keywords_dataEDIInput— event date identification; uploadstext_data
ar_results.csv, car_results.csv, aar_results.csv,
caar_results.csv, analysis_report.csv, results_table_export.txt.
MIT