FAONet
FAONet is a Python package for building and analyzing bipartite trade networks using data from FAOSTAT.
It provides tools for:
- Importing and filtering trade data.
- Building weighted bipartite networks.
- Calculating structural metrics: degree, strength, clustering, betweenness.
- Visualizing trade matrices, degree distributions, and centrality.
📦 Installation
Clone the repository and install with pip:
git clone https://github.com/galeanojav/FAONet.git
cd FAONet
pip install .
or using PyPi version:
pip install faonet
🚀 Quick Start
from faonet.io import load_file
from faonet.filtering import filter_top_percentile
from faonet.network import build_bipartite_network
from faonet.metrics import compute_degree_and_strength
from faonet.plots import plot_weight_matrix
# Load FAOSTAT CSVs
df = load_file("examples/Data/Green_Coffe_FAO_allyears.csv")
# Filter 90% of the market
df_filtered = filter_top_percentile(df, value_column="Value", percentile=0.9)
# Build a bipartite graph
G, reporters, partners = build_bipartite_network(df_filtered, "Reporter Countries", "Partner Countries", "Value")
# Compute degree and strength
df_exporters, df_importers = compute_degree_and_strength(G, reporters, partners)
# Visualize matrix
plot_weight_matrix(df_filtered)
📁 Example
A complete analysis notebook is available in:
📍 examples/FAONet_example.ipynb
It includes:
- Data loading and filtering
- Network construction
- All main metrics (degree, strength, clustering, betweenness)
- Fitted models and visualizations
The example uses FAOSTAT coffee trade data (CSV files in examples/Data/).
🧪 Testing
Run the test suite with:
pytest tests/
📄 License
MIT License.
Metadata
Release files for faonet 0.2.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 | |
|---|---|---|---|---|
| faonet-0.2.0.tar.gz | 17.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| faonet-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / faonet-0.2.0.tar.gz
| Download URL | faonet-0.2.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84b8ebf58876dd8fe970a54e489afd54711dd4d28f23d3bbea9e9840facbf710
|
|
BLAKE2b-256 checksum How to use checksums |
7184676d7254e9f79cf310255a60d2f6babfcb37baf1d9384fa4ce30c7b2346b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.2
|
Release files / faonet-0.2.0-py3-none-any.whl
| Download URL | faonet-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
373dfd6aba1986a778a7828463530e8188a5f30eaff613ce8c4e0c9ac4332882
|
|
BLAKE2b-256 checksum How to use checksums |
a057eb8b7ac95e451b8623e6c8a3215e9b9c71f9f0e840c2501d0f3bba588ca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.2
|
Security for faonet 0.2.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.