py-IO-PS
Public repository of developmental Python code related to research on the input-output product space (IO-PS) [Described in Bam, W., & De Bruyne, K. (2019). Improving Industrial Policy Intervention: The Case of Steel in South Africa. The Journal of Development Studies, 55(11), 2460–2475. https://doi.org/10.1080/00220388.2018.1528354]
Package
Installation
The package is available from the Python Package Index: https://pypi.org/project/iops/
pip install iops
pip install ecomplexity
Usage
CEPII-BACI trade data is a required input (.csv). The BACI data is available at: http://www.cepii.fr/CEPII/fr/bdd_modele/presentation.asp?id=37
Full IO-PS analysis requires a value chain input (.csv). Three columns are required: 'Tier', 'Category' and 'HS Trade Code'.
import pandas as pd
from iops import main
tradedata_df = pd.read_csv('BACI_HSXX_YXXXX_V202001.csv')
valuechain_df = pd.read_csv('X_Value_Chain.csv')
main.iops(tradedata_df,valuechain_df)
Value Chain Output
Results are generated at tier, category and product level. Results are written to an Excel spreadsheet and headless CSV for each.
Tier_Results.csv
Tier_Results.xlsx
Product_Category_Results.csv
Product_Category_Results.xlsx
Product_Results.csv
Product_Results.xlsx
Function
def iops(tradedata, valuechain=None, countrycode=710, tradedigit=6, statanorm=False):
""" IO-PS calculation function that writes the results to .xls and .csv
Arguments:
tradedata: pandas dataframe containing raw CEPII-BACI trade data.
valuechain: .csv of the value chain the IO-PS will map.
columns - 'Tier', 'Category', 'HS Trade Code'
default - None
countrycode: integer indicating which country the IO-PS will map.
default - 710
tradedigit: Integer of 6 or 4 to indicate the raw trade digit summation level.
default - 6
statanorm: Boolean indicator of literature based or CID-Harvard STATA normalization.
default - False
"""
Future Considerations
- User error warnings
- Investigate use of ecomplexity package fork
- Additional IO-PS metrics
- ECI and distance alignment
References
IO-PS
- Bam, W., & De Bruyne, K. (2017). Location policy and downstream mineral processing: A research agenda. Extractive Industries and Society, 4(3), 443–447. https://doi.org/10.1016/j.exis.2017.06.009
- Marais, M., & Bam, W. (2019). Developmental potential of the aerospace industry: the case of South Africa. In 2019 IEEE International Conference on Engineering, Technology and Innovation (ICE/ITMC) (pp. 1–9). IEEE. https://doi.org/10.1109/ICE.2019.8792812
Economic Complexity and Product Complexity
This packages uses a modified copy of the Growth Lab at Harvard's Center for International Development py-ecomplexity package. The ecomplexity package is used to calculate economic complexity indices: https://github.com/cid-harvard/py-ecomplexity
Metadata
Release files for iops 0.5.1
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 |
|---|---|---|---|---|
| iops-0.5.1.tar.gz | 10.0 kB | Without provenance | Details for iops-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iops-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for iops-0.5.1-py3-none-any.whl |
Total release size: 19.3 kB
Release files / iops-0.5.1.tar.gz
| Download URL | iops-0.5.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7faa82a8b145845649bcc404b170605431726fc06f2c2d438d7d70be790d0e85
|
|
BLAKE2b-256 checksum How to use checksums |
3b0705bbfac58aa25ef5e35c281cef8fb0bd3689a8f6abeff19bd2e682b93b49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|
Release files / iops-0.5.1-py3-none-any.whl
| Download URL | iops-0.5.1-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fa8a7e5e4e01ca003f503244995fc9303bd27146edbaf5164866479a428a6d8
|
|
BLAKE2b-256 checksum How to use checksums |
73e79ef26d0aab1207468812caca75b0fc8c2123753f5df4877a7af7dadae0da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|
Security for iops 0.5.1
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.