Trade Module of TiMBA
This is an additional module for TiMBA that computes bilateral trade flows per commodity and balances them to the export and import totals. BACI trade data serves as the starting point for bilateral trade; the balancing is done with RAS (iterative proportional fitting).
Workflow
- TiMBA provides the total export and import targets of each country and a growth factor for bilateral trade, based on price developments in both countries.
- The BACI database provides the initial information on bilateral exports.
- The RAS method scales rows and columns alternately until row sums = export targets and column sums = import targets.
- This process is repeated recursively, with each period building on the previous result, until all TiMBA periods are processed.
- The results are returned as a pandas DataFrame or, if the saving flag is activated, saved as a Parquet file.
Notes
- Within the RAS process, an additional RoW (Rest of World) node is added to account for countries that are not represented in TiMBA.
- Countries with a target but no observed trade are moved to RoW.
- RoW absorbs any difference between total exports and total imports.
- RAS settings can be changed in
src/Trade_Module/config/user_config.yml.
Run
There is currently no CLI (planned for the future). The model is started via the src.Trade_Module.main entry point:
python -m src.Trade_Module.main
Logging
The module writes a log file for debugging to src/Trade_Module/data/output/logs (LOG_PATH). The console shows INFO; the log file additionally contains DEBUG details.
Metadata
Release files for TiMBA-Trade 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| timba_trade-0.1.0.tar.gz | 27.6 kB | Without provenance | Details for timba_trade-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| timba_trade-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for timba_trade-0.1.0-py3-none-any.whl |
Total release size: 58.7 kB
Release files / timba_trade-0.1.0.tar.gz
| Download URL | timba_trade-0.1.0.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
737e4ef274b914fd160bdd4b99f4220e06420f2c01bcf51b4c6b9d2fa3979424
|
|
BLAKE2b-256 checksum How to use checksums |
96fdc8eadbac23e6a0e61a50daeecf1f6168f71251cb4f92b9e986dfad3e6d62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / timba_trade-0.1.0-py3-none-any.whl
| Download URL | timba_trade-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c992f741a2751f4d8158d2fb6e113e63cad865a2a6785c770902d5d8826b7672
|
|
BLAKE2b-256 checksum How to use checksums |
8a161c4f2a2d2b9b75d5872e796c7afba01c74135c744d0aa02bba6a226fde96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for TiMBA-Trade 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.