A comprehensive economic data assessment and prediction system for researchers, enterprises, and government agencies.
🚀 Quick Start · 📖 Documentation · 🎯 Features · 📊 Demo · 🤝 Contributing
- Overview
- Features
- Quick Start
- Documentation
- Architecture
- API Reference
- Economic Models
- Data Sources
- Roadmap
- Contributing
- License
- Citation
NEDAP (National Economic Data Analysis Platform) is an open-source platform designed for:
- 🏢 Enterprise Users: Financial analysis, market research, investment decisions
- 🏛️ Government Agencies: Policy evaluation, economic monitoring, regional analysis
- 🔬 Researchers: Academic research, teaching demonstrations, model validation
| 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 |
- Official Sources: Automatic fetching from National Bureau of Statistics, People's Bank of China, Customs, Ministry of Finance
- Real-time Updates: Support scheduled data synchronization
- Historical Data: Access decades of economic time series
- Data Validation: Automatic quality checks and anomaly detection
| 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
- Interactive Charts: Plotly-powered interactive visualizations
- Dashboard: Real-time economic indicators dashboard
- Export: Support PNG, SVG, PDF, Excel formats
- Custom Reports: Generate automated analysis reports
- Python 3.12 or higher
- pip package manager
- (Optional) Git for cloning the repository
git clone https://github.com/badhope/national_stats.git
cd national_stats
pip install -r requirements.txtDownload 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 |
-
Market Research
- Analyze GDP growth trends by region
- Monitor CPI/PPI for pricing decisions
- Track trade data for supply chain planning
-
Financial Analysis
- Calculate fiscal indicators for credit risk assessment
- Use economic models for macro forecasting
- Generate automated reports for stakeholders
-
Investment Decisions
- Monitor PMI for manufacturing sector health
- Analyze money supply (M2) for liquidity conditions
- Track unemployment for consumer sector outlook
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:
- Docker deployment
- Kubernetes configuration
- Load balancing setup
- Security hardening
-
Fiscal Health Monitoring
- Automatic calculation of deficit rate, debt ratio
- Comparison with international warning thresholds
- Historical trend analysis
-
Regional Economic Comparison
- North-South economic divergence analysis
- Provincial GDP comparison
- Urban-rural income gap tracking
-
Economic Early Warning
- Leading indicators (PMI, M2 growth)
- Coincident indicators (GDP, industrial output)
- Lagging indicators (unemployment, CPI)
- All data stored locally (no cloud dependency)
- Support for air-gapped deployment
- Audit logging for all data operations
- Role-based access control (RBAC)
- GDPR compliant (no personal data collected)
- Chinese Data Security Law compliant
- Supports data classification and labeling
-
Teaching Demonstrations
- Interactive economic model visualization
- Step-by-step formula calculations
- Real-world data examples
-
Research Support
- Export data in CSV, Excel formats
- API for automated data collection
- Reproducible analysis workflows
-
Model Validation
- Test economic theories against real data
- Parameter sensitivity analysis
- Monte Carlo simulation support
@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 |
-
Data Cleaning Module
- Automatic missing value detection
- Outlier identification and handling
- Data imputation methods (linear, spline, ML-based)
-
Enhanced Visualization
- Time series decomposition charts
- Correlation heatmaps
- Regional comparison maps
- Interactive dashboards with filters
-
Simulation Module
- Monte Carlo simulation for risk analysis
- Scenario analysis (optimistic, baseline, pessimistic)
- Policy impact simulation
-
Extended Models
- VAR (Vector Autoregression)
- ARIMA time series forecasting
- Machine learning predictions
-
Report Generation
- Automated PDF reports
- PowerPoint presentation generation
- Email report scheduling
-
Multi-language Support
- Full English UI
- Japanese interface
- Custom language packs
-
Cloud Deployment
- Docker images
- Kubernetes Helm charts
- AWS/Azure deployment guides
-
Enterprise Features
- Multi-tenant support
- SSO integration
- Advanced RBAC
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.
- ✅ You can use, study, and modify the software
- ✅ You can distribute the software
- ✅ You can distribute modified versions
⚠️ You must include the original license⚠️ You must state changes made to the source⚠️ Derivative works must also be GPL-3.0 licensed
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.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: nedap@example.com
- AKShare - Economic data API
- FastAPI - Modern web framework
- Streamlit - Data app framework
- All contributors and users
Made with ❤️ by the NEDAP Team