Skip to content

Commit

Permalink
updates readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
frabarz committed May 6, 2022
1 parent 8ba3410 commit 111bc07
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 44 deletions.
18 changes: 9 additions & 9 deletions PACKAGE.md
@@ -1,17 +1,17 @@
This package contains functions to calculate Economic Complexity indicators.
The functions use data in `pandas.DataFrame` objects.
The functions handle the data through `pandas.DataFrame` objects.

<a href="https://github.com/Datawheel/tesseract-python">
<img src="https://flat.badgen.net/github/release/Datawheel/tesseract-python" />
<a href="https://github.com/Datawheel/py-economic-complexity">
<img src="https://flat.badgen.net/github/release/Datawheel/py-economic-complexity" />
</a>
<a href="https://github.com/Datawheel/tesseract-python/blob/master/LICENSE">
<img src="https://flat.badgen.net/github/license/Datawheel/tesseract-python" />
<a href="https://github.com/Datawheel/py-economic-complexity/blob/master/LICENSE">
<img src="https://flat.badgen.net/github/license/Datawheel/py-economic-complexity" />
</a>
<a href="https://github.com/Datawheel/tesseract-python/">
<img src="https://flat.badgen.net/github/checks/Datawheel/tesseract-python" />
<a href="https://github.com/Datawheel/py-economic-complexity/">
<img src="https://flat.badgen.net/github/checks/Datawheel/py-economic-complexity" />
</a>
<a href="https://github.com/Datawheel/tesseract-python/issues">
<img src="https://flat.badgen.net/github/issues/Datawheel/tesseract-python" />
<a href="https://github.com/Datawheel/py-economic-complexity/issues">
<img src="https://flat.badgen.net/github/issues/Datawheel/py-economic-complexity" />
</a>

## Installation
Expand Down
83 changes: 50 additions & 33 deletions README.md
Expand Up @@ -2,49 +2,66 @@

Economic Complexity studies the geography and dynamics of economic activities using methods inspired in ideas from complex systems, networks, and computer science.

This package allows to calculate Economic Complexity measures. For further references about methodology and implicances of Economic Complexity itself, you can visit [oec.world](https://oec.world/en/resources/methods#economic-complexity).
This package allows to calculate Economic Complexity measures. For further references about methodology and implicances of Economic Complexity itself, you can visit the Observatory of Economic Complexity at [oec.world](https://oec.world/en/resources/methods#economic-complexity).

## Requirements
> used in the development
* python 3.8.2
* numpy 1.18.2
* pandas 1.1.1
We also have [a brief Tutorial](./docs/TUTORIAL.ipynb), using data from the OEC, to get started on how to use the basic functions of this package.

## Install
<a href=""><img src="https://flat.badgen.net/github/license/Datawheel/py-economic-complexity" /></a>
<a href=""><img src="https://flat.badgen.net/github/issues/Datawheel/py-economic-complexity" /></a>
<a href=""><img src="https://flat.badgen.net/pypi/v/economic-complexity" /></a>

After clone the repository, install the **setuptools** and **wheel** packages
```sh
python3 -m pip install --user --upgrade setuptools wheel
## Usage

This package contain the following functions:

* RCA:
- `rca`
* Economic/Product Complexity:
- `complexity`
* Product-space:
- `distance`
- `opportunity_gain`
- `proximity`
- `relatedness`
* Cross-space:
- `cross_proximity`
- `cross_relatedness`

Each module is documented by docstring. Write in your python IDLE the module's name and question symbol to read the documentation.
> ex. if you import the complexity package as `import economic_complexity as ecplx` then the command `ecplx.rca?` shows you the information about rca module)
## Installation

The `pyproject.toml` file in this repository contains settings to use with [`poetry`](https://python-poetry.org/). You can generate an installable wheel file using the `build` command:

```bash
$ poetry build --format wheel
```

next compile the package in its directory
```sh
python3 setup.py sdist bdist_wheel
The package is also available on pypi.org, under the name `economic-complexity`.

```bash
$ poetry install economic-complexity
```

Now we have two new folders in our directory **dist** and **complexity_pkg.egg-info**. **dist** folder contains a **.whl** file that is our compiled package which we will install.
## Development

To install the package we have to run the follwing command:
```sh
pip install **some-package**.whl
After cloning the repo, install the dependencies with the command:

```bash
$ poetry install
```

## Functions available
## References

This package contain the following modules and functions:
* Hidalgo, César A. (2021). Economic complexity theory and applications. _Nature Reviews Physics, 3_(2), 92–113. https://doi.org/10.1038/s42254-020-00275-1

* rca:
- rca
* complexity:
- complexity
* product_space:
- distance
- opportunity_gain
- proximity
- relatedness
* cross_space:
- cross_proximity
- cross_relatedness
* Catalán, P., Navarrete, C., & Figueroa, F. (2020). The scientific and technological cross-space: Is technological diversification driven by scientific endogenous capacity? _Research Policy, 104016_, 104016. https://doi.org/10.1016/j.respol.2020.104016

Each module is documented by docstring. Write in your python IDLE the module's name and question symbol to read the documentation.
> ex. if you import the complexity package as `import economic_complexity as ecplx` then the command `ecplx.rca?` shows you the information about rca module)
* Hidalgo, César A., & Hausmann, R. (2009). The building blocks of economic complexity. _Proceedings of the National Academy of Sciences of the United States of America, 106_(26), 10570–10575. https://doi.org/10.1073/pnas.0900943106

* Hidalgo, C. A., Klinger, B., Barabási, A.-L., & Hausmann, R. (2007). The product space conditions the development of nations. _Science (New York, N.Y.), 317_(5837), 482–487. https://doi.org/10.1126/science.1144581

---
&copy; 2022 [Datawheel, LLC.](https://www.datawheel.us/)
This project is licensed under [MIT](./LICENSE).
5 changes: 3 additions & 2 deletions pyproject.toml
@@ -1,22 +1,23 @@
[tool.poetry]
name = "economic-complexity"
version = "0.1.0"
description = "Functions to compute Economic Complexity measures."
description = "Functions to calculate Economic Complexity indicators."
authors = [
"Jelmy Hermosilla <jelmy@datawheel.us>",
"Marcos Perez <marcos@datawheel.us>",
]
license = "MIT"
readme = "PACKAGE.md"

[tool.poetry.dependencies]
python = "^3.7.9"
numpy = "^1.18.0"
pandas = "^1.1.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.4"
flake8 = "^3.9.2"
ipykernel = "^6.0.3"
pytest = "^6.2.4"
pytest-cov = "^3.0.0"

[build-system]
Expand Down

0 comments on commit 111bc07

Please sign in to comment.