Forecasting Tools

raw JSON →
0.2.90 verified Sat May 09 auth: no python

AI forecasting and research tools to help humans reason about and forecast the future. Current version 0.2.90, requires Python >=3.11, <4.0. Maintained actively on GitHub by Metaculus.

pip install forecasting-tools
error ImportError: cannot import name 'ForecastingTools' from 'forecasting_tools'
cause Class was renamed from ForecastingTools to ForecastTools in v0.2.0.
fix
Use 'from forecasting_tools import ForecastTools'.
error ValueError: API key not provided. Set METACULUS_API_KEY environment variable.
cause No API key passed or set in environment.
fix
Set METACULUS_API_KEY=your_key in environment or pass api_key='your_key'.
error AttributeError: 'ForecastTools' object has no attribute 'predict'
cause Function 'predict' was removed in v0.2.5, replaced by 'forecast'.
fix
Use ft.forecast(...) instead.
breaking Class renamed from 'ForecastingTools' to 'ForecastTools' in v0.2.0. Old import breaks.
fix Use 'from forecasting_tools import ForecastTools'.
deprecated Function 'predict' deprecated in v0.2.5, replaced by 'forecast'.
fix Use ft.forecast(...) instead of ft.predict(...).
gotcha API key required; if not set, ForecastTools raises ValueError. Many users forget to set environment variable.
fix Set METACULUS_API_KEY environment variable or pass api_key argument.

Initialize with API key and run a forecast.

import os
from forecasting_tools import ForecastTools

api_key = os.environ.get('METACULUS_API_KEY', '')
ft = ForecastTools(api_key=api_key)
result = ft.forecast(question='Will AGI be achieved by 2030?')
print(result)