NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Updated : 2026-03-16
ObjServiceCurrency fetches live exchange rates from the
open.er-api.com free API. Rates are stored in data_currency
(latest per pair) and data_currency_history (time-series).
Supports 166 currencies with ZAR as default base.
No API key required. Rates update once daily from ECB data.
Uses the Exchange Rate API free tier:
https://open.er-api.com/v6/latest/{BASE}
| Feature | Value |
|---|---|
| Currencies | 166 |
| Update frequency | Daily |
| Rate limit | None (reasonable use) |
| Authentication | None |
| Data source | European Central Bank |
settings:
api_url: https://open.er-api.com/v6/latest
base_currency: ZAR
min_record_interval_seconds: 3600
tracked_currencies:
- USD
- EUR
- GBP
- JPY
- CNY
- AUD
- CHF
- CAD
- INR
- BRL
- BWP
- MZN
- NAD
- SZL
- ZMW
The tracked_currencies list determines which pairs are stored
in the database when record_rates() is called. All 166 currencies
are available via get_rates() regardless of this list.
The tracked list includes major global currencies plus Southern
African currencies (Botswana Pula, Mozambique Metical, Namibian
Dollar, Swazi Lilangeni, Zambian Kwacha).
Fetch all exchange rates for a base currency. Returns a dict
of 166 currency codes to rates.
Convert an amount between any two currencies. Fetches live rates.
Fetch rates for all tracked currencies and store in DB. Upserts
data_currency (latest) and inserts data_currency_history
(time-series). Default interval is 1 hour.
Latest rate per currency pair (upsert on each record).
| Column | Type | Description |
|---|---|---|
| Guid | VARCHAR(64) | get_uuid("CURRENCY") |
| BaseCurrency | VARCHAR(8) | Base currency code (PK) |
| TargetCurrency | VARCHAR(8) | Target currency code (PK) |
| Rate | DECIMAL(18,8) | Exchange rate |
| Package | VARCHAR(255) | Axion package (PK) |
| Module | VARCHAR(255) | ObjServiceCurrency |
| CreateTime | DATETIME | First recorded |
| UpdateTime | DATETIME | Last updated |
Primary key: (BaseCurrency, TargetCurrency, Package)
Time-series of all rate snapshots for trend analysis.
| Column | Type | Description |
|---|---|---|
| Guid | VARCHAR(64) PK | get_uuid("CURRENCY") |
| BaseCurrency | VARCHAR(8) | Base currency code |
| TargetCurrency | VARCHAR(8) | Target currency code |
| Rate | DECIMAL(18,8) | Exchange rate |
| Package | VARCHAR(255) | Axion package |
| Module | VARCHAR(255) | ObjServiceCurrency |
| CreateTime | DATETIME | Snapshot timestamp |
| Query | Description |
|---|---|
get_all_rates |
All current rates for a base currency |
get_rate |
Single rate for a currency pair |
get_history |
Rate history for a pair in a date range |
get_daily_rates |
Daily avg/min/max per currency |
| Command | Context Keys | Result Key |
|---|---|---|
rates |
base (optional) |
_currency_result (JSON) |
convert |
amount, from, to |
_currency_result (converted amount) |
record |
— | _currency_result |
# Show tracked rates (ZAR base)
python ObjServiceCurrency.py rates
# Show rates for a different base
python ObjServiceCurrency.py rates USD
# Convert between currencies
python ObjServiceCurrency.py convert 1000 ZAR USD
python ObjServiceCurrency.py convert 100 USD EUR
# Record tracked rates to database
python ObjServiceCurrency.py record
Base: ZAR (166 currencies available)
Tracked: 15 pairs, all saved to DB
Rate limit: correctly skips within 3600s interval
Major:
1 ZAR = 0.059205 USD (1 USD = R16.89)
1 ZAR = 0.051802 EUR (1 EUR = R19.30)
1 ZAR = 0.044723 GBP (1 GBP = R22.36)
1 ZAR = 0.046798 CHF (1 CHF = R21.37)
1 ZAR = 9.447119 JPY
1 ZAR = 0.410833 CNY
1 ZAR = 0.084531 AUD (1 AUD = R11.83)
Southern Africa:
1 ZAR = 1.000000 NAD (pegged)
1 ZAR = 1.000000 SZL (pegged)
1 ZAR = 0.814378 BWP (1 BWP = R1.23)
1 ZAR = 3.761487 MZN
1 ZAR = 1.157461 ZMW
Conversions:
1000 ZAR = 59.205 USD
100 USD = 87.4644 EUR
1 GBP = 22.3571 ZAR
500 ZAR = 25.901 EUR
DB verified: 15 rows in data_currency, 15 in data_currency_history
from ObjServiceCurrency import ObjServiceApi
svc = ObjServiceApi()
# Get all rates
rates = svc.get_rates("ZAR")
print(f"ZAR → USD: {rates['USD']}")
# Convert
usd = svc.convert(1000, "ZAR", "USD")
print(f"1000 ZAR = {usd} USD")
# Record to database
svc.record_rates()
Updated : 2026-03-16
cythonize -3 -a -i ObjServiceCurrency.py
Compiling /home/axion/projects/axion/factory.service/package.core/ObjServiceCurrency.py because it changed..[1/1] Cythonizing /home/axion/projects/axion/factory.service/package.core/ObjServiceCurrency.py
Updated : 2026-03-16