NEDAP (National Economic Data Analysis Platform) is an open-source platform designed for:
| Feature | Description |
|---|---|
| Real Data | Direct integration with official Chinese government data sources (NBS, PBC, Customs, MOF) |
| 14 Indicators | Automatic inference of economic indicators using economic formulas |
| 4 Models | Classic economic models: Phillips Curve, Okun’s Law, Cobb-Douglas, Solow Growth |
| One-Click Start | Single batch file launches both backend and frontend |
| API-First | RESTful API design for easy integration with existing systems |
| Cross-Platform | Works on Windows, macOS, and Linux |
| Indicator | Formula | Description |
|---|---|---|
| Fiscal Deficit | Expenditure - Revenue | Government budget gap |
| Deficit Rate | Deficit / GDP × 100% | International warning line: 3% |
| Macro Tax Burden | Tax Revenue / GDP × 100% | Tax burden level |
| Urban-Rural Gap | Urban Income / Rural Income | Income distribution inequality |
| Consumption Rate | Consumption / Income × 100% | Household consumption propensity |
| Savings Rate | 100% - Consumption Rate | Household savings propensity |
| Trade Balance | Export - Import | Foreign trade surplus/deficit |
| Trade Dependence | (Export + Import) / GDP | Openness to trade |
| R&D Intensity | R&D Expenditure / GDP × 100% | Innovation investment |
| Primary Industry Ratio | Primary Industry / GDP × 100% | Economic structure |
| Secondary Industry Ratio | Secondary Industry / GDP × 100% | Industrial structure |
| Tertiary Industry Ratio | Tertiary Industry / GDP × 100% | Service sector share |
| M2 Efficiency | GDP Growth / M2 Growth | Monetary efficiency |
| Fiscal Self-Sufficiency | Revenue / Expenditure × 100% | Local fiscal health |
π = πₑ - β(u - u*)
Describes the short-run trade-off between unemployment and inflation.
Use Case: Central bank policy analysis, inflation forecasting
(Y - Y*)/Y* = -β(u - u*)
Relates GDP growth to changes in unemployment rate.
Use Case: Labor market analysis, growth forecasting
Y = A × K^α × L^(1-α)
Models the relationship between output and inputs (capital, labor).
Use Case: Productivity analysis, growth accounting
Calculates steady-state capital per worker and output per worker.
Use Case: Long-run growth analysis, development economics
git clone https://github.com/badhope/national_stats.git
cd national_stats
pip install -r requirements.txt
Download from GitHub Releases and extract.
Double-click 启动.bat (or start.bat)
# Terminal 1: Start backend
uvicorn backend.main:app --host 127.0.0.1 --port 8001
# Terminal 2: Start frontend
streamlit run app/streamlit_app.py
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:8501 | Streamlit web interface |
| API Docs | http://localhost:8001/docs | Swagger UI |
| ReDoc | http://localhost:8001/redoc | Alternative API documentation |
import requests
# API endpoint
BASE_URL = "http://your-server:8001/api/v1"
# Get indicators
response = requests.get(f"{BASE_URL}/indicators/?category=gdp")
data = response.json()
# Calculate inference
payload = {
"input_indicators": {"revenue": 200000, "expenditure": 250000, "gdp": 1200000},
"target_indicator": "deficit_rate",
"method": "linear"
}
result = requests.post(f"{BASE_URL}/inference/calculate", json=payload)
print(result.json())
See docs/deployment/enterprise.md for:
@software{nedap2026,
author = {NEDAP Contributors},
title = {National Economic Data Analysis Platform (NEDAP)},
year = {2026},
version = {3.0.0},
url = {https://github.com/badhope/national_stats}
}
┌─────────────────────────────────────────────────────────────┐
│ Streamlit Frontend │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐│
│ │Dashboard│ │Inference│ │ Data │ │ Models │ │ API ││
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘│
└───────┼──────────┼──────────┼──────────┼──────────┼────────┘
│ │ │ │ │
└──────────┴──────────┴──────────┴──────────┘
│
┌─────────┴─────────┐
│ FastAPI Backend │
│ ┌─────────────┐ │
│ │ API Routes │ │
│ └──────┬──────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ │ Services │ │
│ │ ┌─────────┐ │ │
│ │ │Fetcher │ │ │
│ │ │Inference│ │ │
│ │ │Models │ │ │
│ │ └─────────┘ │ │
│ └─────────────┘ │
└─────────┬─────────┘
│
┌─────────┴─────────┐
│ SQLite / CSV │
└───────────────────┘
| Layer | Technology |
|---|---|
| Frontend | Streamlit, Plotly, Pandas |
| Backend | FastAPI, SQLAlchemy, Pydantic |
| Data | AKShare, Requests |
| Models | SciPy, Statsmodels, NumPy |
| Storage | SQLite, CSV, Excel |
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/api/v1/indicators/ |
GET | List indicators |
/api/v1/indicators/{id} |
GET | Get indicator details |
/api/v1/indicators/ |
POST | Create indicator |
/api/v1/inference/available |
GET | List available inference indicators |
/api/v1/inference/calculate |
POST | Calculate inference |
/api/v1/inference/infer_all |
POST | Infer all possible indicators |
/api/v1/inference/models/phillips |
GET | Phillips Curve model |
/api/v1/inference/models/okun |
GET | Okun’s Law model |
/api/v1/inference/models/cobb_douglas |
GET | Cobb-Douglas model |
/api/v1/inference/models/solow |
GET | Solow Growth model |
/api/v1/scrape/ |
POST | Trigger data collection |
/api/v1/scrape/status |
GET | Get scrape status |
/api/v1/scrape/sources |
GET | List data sources |
curl -X POST "http://localhost:8001/api/v1/inference/calculate" \
-H "Content-Type: application/json" \
-d '{
"input_indicators": {
"revenue": 200000,
"expenditure": 250000,
"gdp": 1200000
},
"target_indicator": "deficit_rate",
"method": "linear"
}'
curl "http://localhost:8001/api/v1/inference/models/phillips?unemployment=5.5&natural_unemployment=5.0&expected_inflation=2.0&beta=0.5"
All data is sourced from official Chinese government public data portals:
| Source | Agency | Indicators | URL |
|---|---|---|---|
| NBS | National Bureau of Statistics | GDP, CPI, PPI, PMI, Employment, Population | data.stats.gov.cn |
| PBC | People’s Bank of China | M0, M1, M2, Interest Rates, Social Financing | pbc.gov.cn |
| Customs | General Administration of Customs | Import, Export, Trade Balance | customs.gov.cn |
| MOF | Ministry of Finance | Fiscal Revenue, Expenditure, Deficit | mof.gov.cn |
| Indicator | Frequency | Typical Lag |
|---|---|---|
| GDP | Quarterly | 15 days |
| CPI/PPI | Monthly | 10 days |
| PMI | Monthly | 1 day |
| M2 | Monthly | 10 days |
| Trade Data | Monthly | 7 days |
| Fiscal Data | Monthly | 15 days |
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone repository
git clone https://github.com/badhope/national_stats.git
cd national_stats
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
# Install development dependencies
pip install -r requirements.txt
pip install pytest black flake8
# Run tests
pytest tests/
# Format code
black .
Please read and follow our Code of Conduct.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
This platform is for educational and research purposes only. Analysis results do not constitute investment advice or policy recommendations. Data is sourced from official public channels; please contact us if there are copyright concerns.