APF (API Payment Forecasting) is a project that demonstrates how to use Facebook Prophet and GARCH models for forecasting transaction volumes in an API payment system. This project includes fetching real-time transaction data from Alpha Vantage and visualizing the forecast results.
- Python 3.x
- Golang
- pip (Python package installer)
- Clone the repository:
git clone https://github.com/renatosaksanni/apf.git
cd apf
- Install Python packages:
pip install prophet arch matplotlib pandas requests
- Install Go packages:
go mod tidy
- Set up the Alpha Vantage API key:
export ALPHA_VANTAGE_API_KEY=your_api_key
To fetch real-time data from Alpha Vantage:
go run cmd/main.go --fetch --symbol=AAPL
To generate a forecast using Prophet:
go run cmd/main.go --model=prophet --data=data/real_time_data.csv --periods=30
To generate a forecast using GARCH:
go run cmd/main.go --model=garch --data=data/real_time_data.csv --periods=30
To visualize the forecast data:
python3 internal/infra/forecasting/visualize_forecast.py prophet
python3 internal/infra/forecasting/visualize_forecast.py garch
To run the unit tests:
go test ./...
This project uses GitHub Actions for Continuous Integration. The CI workflow is defined in .github/workflows/ci.yml and includes steps to set up Python and Go, install dependencies, and run tests.
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
pip install prophet arch matplotlib pandas requests
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Verify Go installation
run: go version
- name: Install Go dependencies
run: go mod tidy
- name: Run tests
run: go test ./...
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.