Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stellenbosch-econometrics/samadb-issues
South Africa Macroeconomic Database (SAMADB): Report issues with the database or APIs for R, Python and Julia
https://github.com/stellenbosch-econometrics/samadb-issues
api database julia macroeconomic-indicators open-data python r south-africa
Last synced: about 1 month ago
JSON representation
South Africa Macroeconomic Database (SAMADB): Report issues with the database or APIs for R, Python and Julia
- Host: GitHub
- URL: https://github.com/stellenbosch-econometrics/samadb-issues
- Owner: Stellenbosch-Econometrics
- Created: 2023-05-14T17:30:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-02T07:52:44.000Z (over 1 year ago)
- Last Synced: 2024-05-21T04:50:54.985Z (6 months ago)
- Topics: api, database, julia, macroeconomic-indicators, open-data, python, r, south-africa
- Homepage:
- Size: 38.1 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# South Africa Macroeconomic Database
[![CRAN status](https://www.r-pkg.org/badges/version/samadb)](https://cran.r-project.org/package=samadb)
[![cran checks](https://badges.cranchecks.info/worst/samadb.svg)](https://cran.r-project.org/web/checks/check_results_samadb.html)
![downloads per month](https://cranlogs.r-pkg.org/badges/samadb?color=blue)
![downloads](https://cranlogs.r-pkg.org/badges/grand-total/samadb?color=blue)
![pypi](https://img.shields.io/pypi/v/samadb.svg)
![versions](https://img.shields.io/pypi/pyversions/samadb.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/samadb)
[![Julia version](https://juliahub.com/docs/General/SAMaDB/stable/version.svg)](https://juliahub.com/ui/Packages/General/SAMaDB)The South Africa Macroeconomic Database (SAMADB) is an open relational database with ~10,000 macroeconomic time series for South Africa, obtained from the South African Reserve Bank (SARB) and Statistics South Africa (STATSSA) and updated on a weekly basis via [EconData]() and automated scraping of the [SARB]() and [STATSSA]() websites. It is accessible through API packages for [R](https://CRAN.R-project.org/package=samadb), [Python](https://pypi.org/project/samadb/) and [Julia](https://juliahub.com/ui/Packages/General/SAMaDB). While the source code for SAMADB and the APIs remains private, this public repo provides guidance on API installation and allows you to report issues with the database or APIs. Each API has its own built-in documentation. More information about SAMADB is available in the introductory [presentation]().
## SAMADB Installation and Usage
### R API
To install from CRAN, use
```r
install.packages("samadb")
```
Then attach the package with
```r
library(samadb)
help("samadb") # Open Documentation
```*Notes*: The R API offers the broadest functionality, including the possibility to transpose data and export data to Excel. In the wide format, variable labels are attached to the series as attributes, and can be received using `collapse::vlabels()` or, together with names, using `collapse::namlab()`. Functions return a [data.table]().
***
### Python API
To install from pypi, open a terminal and execute
```
pip install samadb
```
Then import the package with```python
import samadb as sm
help(sm) # Overview of Package Functions
```*Notes*: The python package returns [polars]() DataFrame's. These can be converted to [pandas]() DataFrame's using the `.to_pandas()` method. The Python API is a bit different than the R API, due to the greater difficulty of dealing with variable labels in Python. It also presently has no options to transpose or export to Excel, which can however be achieved by converting to pandas and using the `.to_excel()` method.
***
### Julia APITo install from the Julia package registry, use
```julia
using Pkg; Pkg.add("SAMaDB")
```
Then import the package with```julia
import SAMaDB as sm
?sm # Overview of Package Functions
```*Notes*: The Julia API returns [DataFrame's](), and is pretty much identical to the Python API i.e. you should access functions using *qualified names* as in Python, e.g. `sm.datasets()`. No functions are exported.