amazonasdatahub 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amazonasdatahub-0.2.4/LICENSE +22 -0
- amazonasdatahub-0.2.4/PKG-INFO +209 -0
- amazonasdatahub-0.2.4/README.md +189 -0
- amazonasdatahub-0.2.4/pyproject.toml +31 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/__init__.py +3 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/datasets.py +36 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/docs.py +33 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/agriculture_amazonas.md +109 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/aids_amazonas.md +75 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/gdp_amazonas.md +144 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/humidity_manaus.md +84 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/malaria_amazonas.md +225 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/prf_amazonas.md +167 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/rionegro_amazonas.md +79 -0
- amazonasdatahub-0.2.4/src/amazonasdatahub/documentations/srl_muni.md +132 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Nelson Geraldo Aquino de Carvalho
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amazonasdatahub
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: The goal of amazonasdatahub is to gather various data sets from the state of Amazonas (AM), Brazil, to which Deep Learning can be applied.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: Nelson Geraldo Aquino de Carvalho
|
|
8
|
+
Requires-Python: >=3.12,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Requires-Dist: pandas (>=3.0.2,<4.0.0)
|
|
15
|
+
Requires-Dist: pyarrow (>=24.0.0,<25.0.0)
|
|
16
|
+
Requires-Dist: python-frontmatter (>=1.1.0,<2.0.0)
|
|
17
|
+
Requires-Dist: requests (>=2.33.1,<3.0.0)
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# amazonasdatahub
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
<!-- badges: start -->
|
|
24
|
+
|
|
25
|
+
<!-- badges: end -->
|
|
26
|
+
|
|
27
|
+
The goal of `amazonasdatahub` is to aggregate databases from the State
|
|
28
|
+
of Amazonas (AM), Brazil, for conducting studies and preparing
|
|
29
|
+
educational materials, as well as to facilitate access to organized and
|
|
30
|
+
processed data, thereby supporting research and teaching and enabling
|
|
31
|
+
the application of statistical methods.
|
|
32
|
+
|
|
33
|
+
Full documentation of both Python and R versions is available in the
|
|
34
|
+
following languages/Documentação das versões em Python e R estão
|
|
35
|
+
disponíveis nos seguintes idiomas:
|
|
36
|
+
|
|
37
|
+
- [English
|
|
38
|
+
documentation](https://onelsoncarvalho.github.io/amazonasdatahubsite/en/)
|
|
39
|
+
- [🇧🇷 Documentação em Português
|
|
40
|
+
(BR)](https://onelsoncarvalho.github.io/amazonasdatahubsite/)
|
|
41
|
+
|
|
42
|
+
Python only documentation:
|
|
43
|
+
|
|
44
|
+
- [English documentation for Python
|
|
45
|
+
version](https://onelsoncarvalho.github.io/amazonasdatahubpy/en/)
|
|
46
|
+
- [🇧🇷 Documentação em Português (BR) para versão do
|
|
47
|
+
Python](https://onelsoncarvalho.github.io/amazonasdatahubpy/br/)
|
|
48
|
+
|
|
49
|
+
## Overview
|
|
50
|
+
|
|
51
|
+
This `amazonasdatahub` package provides databases from various types and
|
|
52
|
+
sources, all of which concern the State of Amazonas.
|
|
53
|
+
|
|
54
|
+
List of available datasets:
|
|
55
|
+
|
|
56
|
+
| Dataset | Area | Source |
|
|
57
|
+
|:---|:--:|:---|
|
|
58
|
+
| agriculture_amazonas | Agriculture and Livestock | Institute of Agricultural and Sustainable Forestry Development of the State of Amazonas - 2024 |
|
|
59
|
+
| aids_amazonas | Health | Department of HIV, AIDS, Tuberculosis, Viral Hepatitis, and Sexually Transmitted Infections, 2024 |
|
|
60
|
+
| gdp_amazonas | Economy | Scientific Journal of Applied Social and Clinical Science - TIME SERIES ANALYSIS FOR THE QUARTERLY GROSS DOMESTIC PRODUCT OF AMAZONAS |
|
|
61
|
+
| humidity_manaus | Climate | NASCIMENTO, Leonardo Brandão Freitas; LIMA, Max Sousa; DUCZMAL, Luiz H. P-min-stable regression models for time series with extreme values of limited range. Environmetrics, Issue 2, v. 36, 2025. |
|
|
62
|
+
| malaria_amazonas | Health | Lais Baroni, M. P. (2020). An Integrated Dataset of Malaria Notifications in the Legal Amazon (Dataset). Synapse. <https://doi.org/10.7303/SYN21552203> |
|
|
63
|
+
| prf_amazonas | Road Safety | Brasil. Polícia Rodoviária Federal (PRF). Dados Abertos da PRF: Acidentes de Trânsito |
|
|
64
|
+
| rionegro_amazonas | Environment | Porto de Manaus. Nível do Rio Negro |
|
|
65
|
+
| srl_muni | Education | ALMEIDA, Thiago da Cruz de. Physical Literacy e desempenho em leitura de escolares amazônicos: um estudo de associação. 2024. 104 f. Dissertação (Mestrado em Educação) - Universidade Federal do Amazonas, Manaus, 2024. |
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
To install `amazonasdatahub`, you need the following tools installed on your computer or development environment:
|
|
70
|
+
|
|
71
|
+
- Python 3.14.3
|
|
72
|
+
- `pip` (package manager)
|
|
73
|
+
- Git
|
|
74
|
+
|
|
75
|
+
You can install the development version of `amazonasdatahub` using `git clone` to clone the remote repository into your local environment and `pip` to install it:
|
|
76
|
+
```
|
|
77
|
+
# cloning
|
|
78
|
+
git clone https://github.com/onelsoncarvalho/amazonasdatahubpy amazonasdatahub
|
|
79
|
+
cd amazonasdatahub
|
|
80
|
+
|
|
81
|
+
# installing
|
|
82
|
+
pip install amazonasdatahub
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Usage and Examples
|
|
86
|
+
|
|
87
|
+
### Loading `amazonasdatahub`
|
|
88
|
+
|
|
89
|
+
Use `import` and `from` to require the functions from `datasets` module of `amazonasdatahub`:
|
|
90
|
+
|
|
91
|
+
``` python
|
|
92
|
+
from amazonasdatahub.datasets import get_dataset
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The dataset name should be provided as argument of `get_dataset(dataset: str)` function.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
agriculture_amazonas = get_dataset('agriculture_amazonas')
|
|
99
|
+
aids_amazonas = get_dataset('aids_amazonas')
|
|
100
|
+
gdp_amazonas = get_dataset('gdp_amazonas')
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Get dataset documentation
|
|
104
|
+
|
|
105
|
+
Each dataset has its own documentation to provide the user information about the dataset variables.
|
|
106
|
+
|
|
107
|
+
Use `import` and `from` to require the functions from `docs` module:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from amazonasdatahub.docs import get_doc
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The dataset name should be provided as argument of `get_docs(dataset: str)` function.
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
get_doc('agriculture_amazonas')
|
|
117
|
+
get_doc('aids_amazonas')
|
|
118
|
+
get_doc('gdp_amazonas')
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
<!-- ### Examples
|
|
122
|
+
|
|
123
|
+
#### Disease occurrence
|
|
124
|
+
|
|
125
|
+
The dataset `aids_amazonas` contains data of the AIDS occurrences in
|
|
126
|
+
each municipality from Amazonas.
|
|
127
|
+
|
|
128
|
+
One of the analysis that can be made is: visualize the time series of
|
|
129
|
+
counts filtered by municipality, where each case is grouped by the
|
|
130
|
+
sex/gender of each observation. To do this, we will use the dplyr
|
|
131
|
+
package to structure the data and the ggplot2 package to create and
|
|
132
|
+
customize the chart.
|
|
133
|
+
|
|
134
|
+
``` r
|
|
135
|
+
# Loading dplyr and ggplot to structure the data
|
|
136
|
+
require(dplyr)
|
|
137
|
+
require(ggplot2)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
``` r
|
|
141
|
+
# Filtering by municipality and plotting case count by gender
|
|
142
|
+
aids_amazonas %>%
|
|
143
|
+
filter(name_muni == "Manaus") %>%
|
|
144
|
+
group_by(gender) %>%
|
|
145
|
+
ggplot(aes(x = year, y = cases, group = gender, color = gender)) +
|
|
146
|
+
geom_line() +
|
|
147
|
+
scale_color_manual(values = c("blue", "red")) +
|
|
148
|
+
theme_minimal() +
|
|
149
|
+
labs(
|
|
150
|
+
title = "AIDS occurrences in Manaus (2011-2023)",
|
|
151
|
+
x = "Year",
|
|
152
|
+
y = "Case count",
|
|
153
|
+
color = "Gender"
|
|
154
|
+
)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
<img src="man/figures/README-unnamed-chunk-6-1.png" alt="" width="100%" />
|
|
158
|
+
|
|
159
|
+
#### Time Series
|
|
160
|
+
|
|
161
|
+
The `humidity_manaus` consists of the minimum relative humidity observed
|
|
162
|
+
in the city of Manaus from January 2009 to December 2020. We can
|
|
163
|
+
visualize the time series of the relative humidity during this time
|
|
164
|
+
interval.
|
|
165
|
+
|
|
166
|
+
Using `dplyr`, it is possible to create a date column, which will be
|
|
167
|
+
composed of the month and year. Using`ggplot2`, the time series chart
|
|
168
|
+
can be plotted.
|
|
169
|
+
|
|
170
|
+
``` r
|
|
171
|
+
# Loading dplyr and ggplot to structure the data
|
|
172
|
+
require(dplyr)
|
|
173
|
+
require(ggplot2)
|
|
174
|
+
|
|
175
|
+
# Creating date column and plotting the time series
|
|
176
|
+
humidity_manaus %>%
|
|
177
|
+
mutate(date = as.Date(paste0(year, "-", month, "-","01"))) %>%
|
|
178
|
+
ggplot(aes(x = date, y = rh)) +
|
|
179
|
+
geom_line() +
|
|
180
|
+
theme_minimal() +
|
|
181
|
+
labs(
|
|
182
|
+
title = "Relative Humidity of Amazonas (2009-2020)",
|
|
183
|
+
x = "Date",
|
|
184
|
+
y = "Relative Humidity"
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
<img src="man/figures/README-unnamed-chunk-7-1.png" alt="" width="100%" /> -->
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
## Contributing
|
|
192
|
+
|
|
193
|
+
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
`amazonasdatahub` was created by Nelson Geraldo Aquino de Carvalho. It is licensed under the terms of the MIT license.
|
|
198
|
+
|
|
199
|
+
<!-- ## Credits
|
|
200
|
+
|
|
201
|
+
`amazonasdatahub` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter). -->
|
|
202
|
+
|
|
203
|
+
## Citation
|
|
204
|
+
|
|
205
|
+
- CARVALHO, Nelson Geraldo Aquino de; NASCIMENTO, Leonardo Brandão
|
|
206
|
+
Freitas do. **amazonasdatahub**. 2026.
|
|
207
|
+
<https://onelsoncarvalho.github.io/amazonasdatahubpy>.
|
|
208
|
+
|
|
209
|
+
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# amazonasdatahub
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
<!-- badges: start -->
|
|
5
|
+
|
|
6
|
+
<!-- badges: end -->
|
|
7
|
+
|
|
8
|
+
The goal of `amazonasdatahub` is to aggregate databases from the State
|
|
9
|
+
of Amazonas (AM), Brazil, for conducting studies and preparing
|
|
10
|
+
educational materials, as well as to facilitate access to organized and
|
|
11
|
+
processed data, thereby supporting research and teaching and enabling
|
|
12
|
+
the application of statistical methods.
|
|
13
|
+
|
|
14
|
+
Full documentation of both Python and R versions is available in the
|
|
15
|
+
following languages/Documentação das versões em Python e R estão
|
|
16
|
+
disponíveis nos seguintes idiomas:
|
|
17
|
+
|
|
18
|
+
- [English
|
|
19
|
+
documentation](https://onelsoncarvalho.github.io/amazonasdatahubsite/en/)
|
|
20
|
+
- [🇧🇷 Documentação em Português
|
|
21
|
+
(BR)](https://onelsoncarvalho.github.io/amazonasdatahubsite/)
|
|
22
|
+
|
|
23
|
+
Python only documentation:
|
|
24
|
+
|
|
25
|
+
- [English documentation for Python
|
|
26
|
+
version](https://onelsoncarvalho.github.io/amazonasdatahubpy/en/)
|
|
27
|
+
- [🇧🇷 Documentação em Português (BR) para versão do
|
|
28
|
+
Python](https://onelsoncarvalho.github.io/amazonasdatahubpy/br/)
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
This `amazonasdatahub` package provides databases from various types and
|
|
33
|
+
sources, all of which concern the State of Amazonas.
|
|
34
|
+
|
|
35
|
+
List of available datasets:
|
|
36
|
+
|
|
37
|
+
| Dataset | Area | Source |
|
|
38
|
+
|:---|:--:|:---|
|
|
39
|
+
| agriculture_amazonas | Agriculture and Livestock | Institute of Agricultural and Sustainable Forestry Development of the State of Amazonas - 2024 |
|
|
40
|
+
| aids_amazonas | Health | Department of HIV, AIDS, Tuberculosis, Viral Hepatitis, and Sexually Transmitted Infections, 2024 |
|
|
41
|
+
| gdp_amazonas | Economy | Scientific Journal of Applied Social and Clinical Science - TIME SERIES ANALYSIS FOR THE QUARTERLY GROSS DOMESTIC PRODUCT OF AMAZONAS |
|
|
42
|
+
| humidity_manaus | Climate | NASCIMENTO, Leonardo Brandão Freitas; LIMA, Max Sousa; DUCZMAL, Luiz H. P-min-stable regression models for time series with extreme values of limited range. Environmetrics, Issue 2, v. 36, 2025. |
|
|
43
|
+
| malaria_amazonas | Health | Lais Baroni, M. P. (2020). An Integrated Dataset of Malaria Notifications in the Legal Amazon (Dataset). Synapse. <https://doi.org/10.7303/SYN21552203> |
|
|
44
|
+
| prf_amazonas | Road Safety | Brasil. Polícia Rodoviária Federal (PRF). Dados Abertos da PRF: Acidentes de Trânsito |
|
|
45
|
+
| rionegro_amazonas | Environment | Porto de Manaus. Nível do Rio Negro |
|
|
46
|
+
| srl_muni | Education | ALMEIDA, Thiago da Cruz de. Physical Literacy e desempenho em leitura de escolares amazônicos: um estudo de associação. 2024. 104 f. Dissertação (Mestrado em Educação) - Universidade Federal do Amazonas, Manaus, 2024. |
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
To install `amazonasdatahub`, you need the following tools installed on your computer or development environment:
|
|
51
|
+
|
|
52
|
+
- Python 3.14.3
|
|
53
|
+
- `pip` (package manager)
|
|
54
|
+
- Git
|
|
55
|
+
|
|
56
|
+
You can install the development version of `amazonasdatahub` using `git clone` to clone the remote repository into your local environment and `pip` to install it:
|
|
57
|
+
```
|
|
58
|
+
# cloning
|
|
59
|
+
git clone https://github.com/onelsoncarvalho/amazonasdatahubpy amazonasdatahub
|
|
60
|
+
cd amazonasdatahub
|
|
61
|
+
|
|
62
|
+
# installing
|
|
63
|
+
pip install amazonasdatahub
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage and Examples
|
|
67
|
+
|
|
68
|
+
### Loading `amazonasdatahub`
|
|
69
|
+
|
|
70
|
+
Use `import` and `from` to require the functions from `datasets` module of `amazonasdatahub`:
|
|
71
|
+
|
|
72
|
+
``` python
|
|
73
|
+
from amazonasdatahub.datasets import get_dataset
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The dataset name should be provided as argument of `get_dataset(dataset: str)` function.
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
agriculture_amazonas = get_dataset('agriculture_amazonas')
|
|
80
|
+
aids_amazonas = get_dataset('aids_amazonas')
|
|
81
|
+
gdp_amazonas = get_dataset('gdp_amazonas')
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Get dataset documentation
|
|
85
|
+
|
|
86
|
+
Each dataset has its own documentation to provide the user information about the dataset variables.
|
|
87
|
+
|
|
88
|
+
Use `import` and `from` to require the functions from `docs` module:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from amazonasdatahub.docs import get_doc
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The dataset name should be provided as argument of `get_docs(dataset: str)` function.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
get_doc('agriculture_amazonas')
|
|
98
|
+
get_doc('aids_amazonas')
|
|
99
|
+
get_doc('gdp_amazonas')
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
<!-- ### Examples
|
|
103
|
+
|
|
104
|
+
#### Disease occurrence
|
|
105
|
+
|
|
106
|
+
The dataset `aids_amazonas` contains data of the AIDS occurrences in
|
|
107
|
+
each municipality from Amazonas.
|
|
108
|
+
|
|
109
|
+
One of the analysis that can be made is: visualize the time series of
|
|
110
|
+
counts filtered by municipality, where each case is grouped by the
|
|
111
|
+
sex/gender of each observation. To do this, we will use the dplyr
|
|
112
|
+
package to structure the data and the ggplot2 package to create and
|
|
113
|
+
customize the chart.
|
|
114
|
+
|
|
115
|
+
``` r
|
|
116
|
+
# Loading dplyr and ggplot to structure the data
|
|
117
|
+
require(dplyr)
|
|
118
|
+
require(ggplot2)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
``` r
|
|
122
|
+
# Filtering by municipality and plotting case count by gender
|
|
123
|
+
aids_amazonas %>%
|
|
124
|
+
filter(name_muni == "Manaus") %>%
|
|
125
|
+
group_by(gender) %>%
|
|
126
|
+
ggplot(aes(x = year, y = cases, group = gender, color = gender)) +
|
|
127
|
+
geom_line() +
|
|
128
|
+
scale_color_manual(values = c("blue", "red")) +
|
|
129
|
+
theme_minimal() +
|
|
130
|
+
labs(
|
|
131
|
+
title = "AIDS occurrences in Manaus (2011-2023)",
|
|
132
|
+
x = "Year",
|
|
133
|
+
y = "Case count",
|
|
134
|
+
color = "Gender"
|
|
135
|
+
)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
<img src="man/figures/README-unnamed-chunk-6-1.png" alt="" width="100%" />
|
|
139
|
+
|
|
140
|
+
#### Time Series
|
|
141
|
+
|
|
142
|
+
The `humidity_manaus` consists of the minimum relative humidity observed
|
|
143
|
+
in the city of Manaus from January 2009 to December 2020. We can
|
|
144
|
+
visualize the time series of the relative humidity during this time
|
|
145
|
+
interval.
|
|
146
|
+
|
|
147
|
+
Using `dplyr`, it is possible to create a date column, which will be
|
|
148
|
+
composed of the month and year. Using`ggplot2`, the time series chart
|
|
149
|
+
can be plotted.
|
|
150
|
+
|
|
151
|
+
``` r
|
|
152
|
+
# Loading dplyr and ggplot to structure the data
|
|
153
|
+
require(dplyr)
|
|
154
|
+
require(ggplot2)
|
|
155
|
+
|
|
156
|
+
# Creating date column and plotting the time series
|
|
157
|
+
humidity_manaus %>%
|
|
158
|
+
mutate(date = as.Date(paste0(year, "-", month, "-","01"))) %>%
|
|
159
|
+
ggplot(aes(x = date, y = rh)) +
|
|
160
|
+
geom_line() +
|
|
161
|
+
theme_minimal() +
|
|
162
|
+
labs(
|
|
163
|
+
title = "Relative Humidity of Amazonas (2009-2020)",
|
|
164
|
+
x = "Date",
|
|
165
|
+
y = "Relative Humidity"
|
|
166
|
+
)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
<img src="man/figures/README-unnamed-chunk-7-1.png" alt="" width="100%" /> -->
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## Contributing
|
|
173
|
+
|
|
174
|
+
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
`amazonasdatahub` was created by Nelson Geraldo Aquino de Carvalho. It is licensed under the terms of the MIT license.
|
|
179
|
+
|
|
180
|
+
<!-- ## Credits
|
|
181
|
+
|
|
182
|
+
`amazonasdatahub` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter). -->
|
|
183
|
+
|
|
184
|
+
## Citation
|
|
185
|
+
|
|
186
|
+
- CARVALHO, Nelson Geraldo Aquino de; NASCIMENTO, Leonardo Brandão
|
|
187
|
+
Freitas do. **amazonasdatahub**. 2026.
|
|
188
|
+
<https://onelsoncarvalho.github.io/amazonasdatahubpy>.
|
|
189
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "amazonasdatahub"
|
|
3
|
+
version = "0.2.4"
|
|
4
|
+
description = "The goal of amazonasdatahub is to gather various data sets from the state of Amazonas (AM), Brazil, to which Deep Learning can be applied."
|
|
5
|
+
authors = ["Nelson Geraldo Aquino de Carvalho"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
packages = [{ include = "amazonasdatahub", from = "src" }]
|
|
9
|
+
|
|
10
|
+
[tool.poetry.dependencies]
|
|
11
|
+
python = "^3.12"
|
|
12
|
+
pandas = "^3.0.2"
|
|
13
|
+
python-frontmatter = "^1.1.0"
|
|
14
|
+
requests = "^2.33.1"
|
|
15
|
+
pyarrow = "^24.0.0"
|
|
16
|
+
|
|
17
|
+
[tool.poetry.group.dev.dependencies]
|
|
18
|
+
myst-nb = ">=1.3.0,<1.4.0"
|
|
19
|
+
sphinx-autoapi = ">=3.8.1,<4.0.0"
|
|
20
|
+
shibuya = ">=2026.7.12,<2027.0.0"
|
|
21
|
+
matplotlib = "^3.11.2"
|
|
22
|
+
deepl = ">=1.32.0,<2.0.0"
|
|
23
|
+
polib = ">=1.2.0,<2.0.0"
|
|
24
|
+
sphinx-intl = ">=2.4.0,<3.0.0"
|
|
25
|
+
sphinx-autobuild = ">=2025.8.25,<2026.0.0"
|
|
26
|
+
pytest = ">=9.2.0,<10.0.0"
|
|
27
|
+
pytest-cov = ">=7.1.0,<8.0.0"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["poetry-core>=1.0.0"]
|
|
31
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
import requests
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
CACHE_DIR = Path.home() / ".cache" / "amazonasdatahub"
|
|
6
|
+
CACHE_DIR.mkdir(parents = True, exist_ok=True)
|
|
7
|
+
|
|
8
|
+
def get_dataset(dataset_name, force=False):
|
|
9
|
+
"""
|
|
10
|
+
Gather an specific dataset.
|
|
11
|
+
:param dataset_name: Dataset name (example: agriculture_amazonas)
|
|
12
|
+
:param force: If True, ignores the cache and downloads the dataset again
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
file_name = f"{dataset_name}.parquet"
|
|
16
|
+
local_path = CACHE_DIR / file_name
|
|
17
|
+
url = f"https://github.com/onelsoncarvalho/amazonasdatahubpy/raw/refs/heads/main/raw_data/{file_name}"
|
|
18
|
+
|
|
19
|
+
if force or not local_path.exists():
|
|
20
|
+
print(f"Gathering updated data from {url}...")
|
|
21
|
+
try:
|
|
22
|
+
response = requests.get(url)
|
|
23
|
+
response.raise_for_status()
|
|
24
|
+
|
|
25
|
+
with open(local_path, "wb") as f:
|
|
26
|
+
f.write(response.content)
|
|
27
|
+
print(f"Saved in: {local_path}")
|
|
28
|
+
|
|
29
|
+
except Exception as e:
|
|
30
|
+
if not local_path.exists():
|
|
31
|
+
raise Exception(f"Error while downloading and there is no cache available: {e}")
|
|
32
|
+
print(f"Warning: Download error, using old cache version. Error: {e}")
|
|
33
|
+
|
|
34
|
+
return pd.read_parquet(local_path)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import frontmatter
|
|
2
|
+
from importlib import resources
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_doc(dataset_name):
|
|
6
|
+
"""
|
|
7
|
+
Shows the documentation of a dataset
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
md_path = resources.files("amazonasdatahub.documentations").joinpath(f"{dataset_name}.md")
|
|
12
|
+
if not md_path.exists():
|
|
13
|
+
print(f"Docs for {dataset_name} not found")
|
|
14
|
+
return
|
|
15
|
+
|
|
16
|
+
md_content = md_path.read_text(encoding = "utf-8")
|
|
17
|
+
|
|
18
|
+
loaded_md = frontmatter.loads(md_content)
|
|
19
|
+
|
|
20
|
+
title = loaded_md.get('title', dataset_name.upper())
|
|
21
|
+
body = loaded_md.content
|
|
22
|
+
|
|
23
|
+
print(f"\n{'='*60}")
|
|
24
|
+
print(f"Documentation from: {title}")
|
|
25
|
+
print(f"{'='*60}")
|
|
26
|
+
|
|
27
|
+
try :
|
|
28
|
+
from IPython.display import display, Markdown
|
|
29
|
+
display(Markdown(body))
|
|
30
|
+
except ImportError:
|
|
31
|
+
print(body)
|
|
32
|
+
except Exception as e:
|
|
33
|
+
print(f"Error while processing docs: {e}")
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "agriculture_amazonas"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# agriculture_amazonas
|
|
6
|
+
|
|
7
|
+
Plant production data from the Institute of Sustainable Agricultural and Forestry Development of Amazonas - IDAM (2023).
|
|
8
|
+
|
|
9
|
+
### Description
|
|
10
|
+
|
|
11
|
+
This database, which is the consolidation of data from IDAM's activity reports, provides crop production data for crops that this institute considers a priority.
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
agriculture_amazonas = get_dataset("agriculture_amazonas")
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Format
|
|
20
|
+
|
|
21
|
+
‘agriculture_amazonas’ A data frame with 1072 rows and 13 columns:
|
|
22
|
+
|
|
23
|
+
#### municipality
|
|
24
|
+
|
|
25
|
+
Municipality
|
|
26
|
+
|
|
27
|
+
#### local_unit
|
|
28
|
+
|
|
29
|
+
Local Unit of the Institute
|
|
30
|
+
|
|
31
|
+
#### n_beneficiary
|
|
32
|
+
|
|
33
|
+
Number of assisted beneficiaries
|
|
34
|
+
|
|
35
|
+
#### planted
|
|
36
|
+
|
|
37
|
+
Planted area in hectares (ha)
|
|
38
|
+
|
|
39
|
+
#### harvested
|
|
40
|
+
|
|
41
|
+
Harvested area in hectares (ha)
|
|
42
|
+
|
|
43
|
+
#### production
|
|
44
|
+
|
|
45
|
+
Production (in the unit of measurement - measure)
|
|
46
|
+
|
|
47
|
+
#### estimated_n_beneficiary
|
|
48
|
+
|
|
49
|
+
Estimate of the number of beneficiaries
|
|
50
|
+
|
|
51
|
+
#### estimated_planted
|
|
52
|
+
|
|
53
|
+
Estimate of the planted area (ha)
|
|
54
|
+
|
|
55
|
+
#### estimated_harvested
|
|
56
|
+
|
|
57
|
+
Estimate of the harvested area (ha)
|
|
58
|
+
|
|
59
|
+
#### estimated_production
|
|
60
|
+
|
|
61
|
+
Estimate of production (in the unit of measurement - measure)
|
|
62
|
+
|
|
63
|
+
#### measure
|
|
64
|
+
|
|
65
|
+
Unit of Measurement of production
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#### cultivation
|
|
69
|
+
|
|
70
|
+
Cultivation
|
|
71
|
+
|
|
72
|
+
#### year
|
|
73
|
+
|
|
74
|
+
Year of cultivation
|
|
75
|
+
|
|
76
|
+
### Source
|
|
77
|
+
|
|
78
|
+
https://www.idam.am.gov.br/biblioteca/relatorio-de-atividades-rat-23-2/
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Example
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
import matplotlib.pyplot as plt
|
|
85
|
+
from amazonasdatahub.datasets import get_dataset
|
|
86
|
+
|
|
87
|
+
# Loading data
|
|
88
|
+
agriculture_amazonas = get_dataset("agriculture_amazonas")
|
|
89
|
+
|
|
90
|
+
# Filtering data
|
|
91
|
+
mandioca_prod = agriculture_amazonas[
|
|
92
|
+
agriculture_amazonas["cultivation"] == "Mandioca"
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
# Scatterplot
|
|
96
|
+
plt.figure(figsize=(8,6))
|
|
97
|
+
plt.scatter(
|
|
98
|
+
mandioca_prod["planted"],
|
|
99
|
+
mandioca_prod["harvested"],
|
|
100
|
+
alpha=0.7,
|
|
101
|
+
edgecolors="none"
|
|
102
|
+
)
|
|
103
|
+
plt.xlabel("Planted area (hectare)")
|
|
104
|
+
plt.ylabel("Harvested area (hectare)")
|
|
105
|
+
plt.title("Cassava production in Amazonas")
|
|
106
|
+
plt.grid(True, linestyle="--", alpha=0.5)
|
|
107
|
+
plt.tight_layout()
|
|
108
|
+
plt.show()
|
|
109
|
+
```
|