Interacting with the Mosqlimate datastore¶
Fetching data from the Mosqlimate API. Below, you can find example code to pull data from both the Infodengue and Climate datasets.
In [1]:
Copied!
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv("API_KEY")
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv("API_KEY")
In [2]:
Copied!
import mosqlient
import mosqlient
InfoDengue¶
In [3]:
Copied!
mosqlient.get_infodengue?
mosqlient.get_infodengue?
Signature: mosqlient.get_infodengue( api_key: str, disease: Literal['dengue', 'zika', 'chikungunya'], start_date: datetime.date | str, end_date: datetime.date | str, uf: Optional[Annotated[str, AfterValidator(func=<function validate_uf at 0x7eefe72ddb20>)]] = None, geocode: Optional[int] = None, ) -> pandas.core.frame.DataFrame Docstring: Fetch InfoDengue Data from Mosqlimate API for dengue, zika, or chikungunya. Parameters ---------- api_key : str API key used to authenticate with the Mosqlimate service. disease : {'dengue', 'zika', 'chikungunya'} The arbovirus to retrieve data for. start_date : date or str Start date of the data range (as a `datetime.date` or ISO format string). end_date : date or str End date of the data range (as a `datetime.date` or ISO format string). uf : types.UF, optional The Brazilian state abbreviation (e.g., 'SP', 'RJ'). If provided without `geocode`, filters by state. geocode : int, optional IBGE geocode of a municipality. If provided, overrides `uf`. Returns ------- pandas.DataFrame DataFrame containing the epidemiological time series data for the specified region and time period. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/infodengue/ Notes ----- Either `uf` or `geocode` must be provided to specify the target geographic area. Examples -------- >>> get_infodengue( ... api_key="your_api_key", ... disease="dengue", ... start_date="2023-01-01", ... end_date="2023-03-01", ... uf="RJ" ... ) File: ~/Documentos/mosqlimate-client/mosqlient/datastore/_infodengue_get_impl.py Type: function
In [4]:
Copied!
mosqlient.get_infodengue(
api_key = api_key,
disease = "dengue",
start_date = "2022-01-01",
end_date = "2023-01-01",
geocode = 4108304
).head()
mosqlient.get_infodengue(
api_key = api_key,
disease = "dengue",
start_date = "2022-01-01",
end_date = "2023-01-01",
geocode = 4108304
).head()
Out[4]:
| data_iniSE | SE | casos_est | casos_est_min | casos_est_max | casos | municipio_geocodigo | p_rt1 | p_inc100k | Localidade_id | ... | nivel_inc | umidmed | umidmin | tempmed | tempmax | casprov | casprov_est | casprov_est_min | casprov_est_max | casconf | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2022-01-02 | 202201 | 138.0 | 138 | 138 | 138 | 4108304 | 0.989673 | 53.437008 | 0 | ... | 1 | 70.345655 | 41.780660 | 26.753882 | 32.857143 | 24 | None | None | None | None |
| 1 | 2022-01-09 | 202202 | 87.0 | 87 | 87 | 87 | 4108304 | 0.085834 | 33.688550 | 0 | ... | 1 | 68.869453 | 34.261969 | 26.857143 | 33.857143 | 6 | None | None | None | None |
| 2 | 2022-01-16 | 202203 | 108.0 | 108 | 108 | 108 | 4108304 | 0.420955 | 41.820267 | 0 | ... | 1 | 54.516546 | 31.172127 | 30.606793 | 36.571429 | 7 | None | None | None | None |
| 3 | 2022-01-23 | 202204 | 76.0 | 76 | 76 | 76 | 4108304 | 0.018033 | 29.429075 | 0 | ... | 1 | 77.647770 | 52.576590 | 27.251985 | 32.571429 | 3 | None | None | None | None |
| 4 | 2022-01-30 | 202205 | 57.0 | 57 | 57 | 57 | 4108304 | 0.001357 | 22.071808 | 0 | ... | 0 | 75.748420 | 52.041916 | 26.686224 | 31.714286 | 2 | None | None | None | None |
5 rows × 30 columns
To get the data for all the cities in a state, don't fill the geocode field, as in the example below:
In [5]:
Copied!
mosqlient.get_infodengue(
api_key = api_key,
disease = "dengue",
start_date = "2022-01-01",
end_date = "2023-01-01",
uf = 'AL'
).head()
mosqlient.get_infodengue(
api_key = api_key,
disease = "dengue",
start_date = "2022-01-01",
end_date = "2023-01-01",
uf = 'AL'
).head()
100%|██████████| 18/18 [00:03<00:00, 5.43requests/s]
Out[5]:
| data_iniSE | SE | casos_est | casos_est_min | casos_est_max | casos | municipio_geocodigo | p_rt1 | p_inc100k | Localidade_id | ... | nivel_inc | umidmed | umidmin | tempmed | tempmax | casprov | casprov_est | casprov_est_min | casprov_est_max | casconf | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2023-01-01 | 202301 | 0.0 | 0 | 0 | 0 | 2703700 | 0.0 | 0.0 | 0 | ... | 0 | 83.854557 | 60.179396 | 25.375 | 29.857143 | 0 | None | None | None | None |
| 1 | 2023-01-01 | 202301 | 0.0 | 0 | 0 | 0 | 2700102 | 0.0 | 0.0 | 0 | ... | 0 | 83.854557 | 60.179396 | 25.375 | 29.857143 | 0 | None | None | None | None |
| 2 | 2023-01-01 | 202301 | 0.0 | 0 | 0 | 0 | 2702504 | 0.0 | 0.0 | 0 | ... | 0 | 83.854557 | 60.179396 | 25.375 | 29.857143 | 0 | None | None | None | None |
| 3 | 2023-01-01 | 202301 | 0.0 | 0 | 0 | 0 | 2709202 | 0.0 | 0.0 | 0 | ... | 0 | 83.854557 | 60.179396 | 25.375 | 29.857143 | 0 | None | None | None | None |
| 4 | 2023-01-01 | 202301 | 0.0 | 0 | 0 | 0 | 2709152 | 0.0 | 0.0 | 0 | ... | 0 | 83.854557 | 60.179396 | 25.375 | 29.857143 | 0 | None | None | None | None |
5 rows × 30 columns
Climate¶
In [6]:
Copied!
mosqlient.get_climate?
mosqlient.get_climate?
Signature: mosqlient.get_climate( api_key: str, start_date: datetime.date | str, end_date: datetime.date | str, uf: Optional[Annotated[str, AfterValidator(func=<function validate_uf at 0x7eefe72ddb20>)]] = None, geocode: Optional[int] = None, ) -> pandas.core.frame.DataFrame Docstring: Retrieve historical climate data from the Mosqlimate API for a specific region and date range. Parameters ---------- api_key : str API key used to authenticate with the Mosqlimate service. start_date : date or str Start date of the data range (as a `datetime.date` or ISO format string). end_date : date or str End date of the data range (as a `datetime.date` or ISO format string). uf : types.UF, optional The Brazilian state abbreviation (e.g., 'SP', 'MG'). If provided and `geocode` is not, filters by state. geocode : int, optional IBGE geocode of a municipality. If provided, overrides `uf`. Returns ------- pandas.DataFrame DataFrame containing daily climate data. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/climate/#output_items Notes ----- - Either `uf` or `geocode` must be provided to define the target location. Examples -------- >>> get_climate( ... api_key="your_api_key", ... start_date="2023-01-01", ... end_date="2023-01-31", ... geocode=3550308 ... ) File: ~/Documentos/mosqlimate-client/mosqlient/datastore/_climate_get_impl.py Type: function
In [7]:
Copied!
mosqlient.get_climate(
api_key = api_key,
start_date = "2022-01-01",
end_date = "2022-01-01",
uf = "RJ",
).head()
mosqlient.get_climate(
api_key = api_key,
start_date = "2022-01-01",
end_date = "2022-01-01",
uf = "RJ",
).head()
Out[7]:
| date | geocodigo | epiweek | temp_min | temp_med | temp_max | precip_min | precip_med | precip_max | precip_tot | pressao_min | pressao_med | pressao_max | umid_min | umid_med | umid_max | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2022-01-01 | 3304904 | 202152 | 22.6257 | 24.3860 | 27.0321 | 3.6204 | 11.1975 | 13.9251 | 89.5801 | 0.9792 | 0.9809 | 0.9822 | 73.2068 | 88.1539 | 96.0204 |
| 1 | 2022-01-01 | 3300456 | 202152 | 22.0534 | 24.4950 | 28.0489 | 2.9373 | 10.3552 | 16.4463 | 82.8420 | 0.9841 | 0.9856 | 0.9871 | 71.4547 | 86.2787 | 95.7525 |
| 2 | 2022-01-01 | 3306305 | 202152 | 19.7466 | 22.2258 | 25.2781 | 0.7202 | 6.7313 | 19.1833 | 53.8505 | 0.9383 | 0.9399 | 0.9413 | 66.3477 | 80.9101 | 91.8641 |
| 3 | 2022-01-01 | 3302502 | 202152 | 21.2800 | 23.3756 | 26.6641 | 2.5879 | 9.6577 | 14.7341 | 77.2612 | 0.9632 | 0.9648 | 0.9660 | 72.5174 | 88.8297 | 96.9553 |
| 4 | 2022-01-01 | 3303203 | 202152 | 21.8972 | 24.2891 | 27.5884 | 3.5619 | 11.4151 | 18.2473 | 91.3207 | 0.9773 | 0.9789 | 0.9804 | 72.5641 | 85.7219 | 95.6470 |
In [8]:
Copied!
mosqlient.get_climate(
api_key = api_key,
start_date = "2022-01-01",
end_date = "2023-01-01",
geocode = 4108304,
)
mosqlient.get_climate(
api_key = api_key,
start_date = "2022-01-01",
end_date = "2023-01-01",
geocode = 4108304,
)
100%|██████████| 1/1 [00:00<00:00, 1.50requests/s]
Out[8]:
| date | geocodigo | epiweek | temp_min | temp_med | temp_max | precip_min | precip_med | precip_max | precip_tot | pressao_min | pressao_med | pressao_max | umid_min | umid_med | umid_max | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2022-01-01 | 4108304 | 202152 | 23.6794 | 29.6633 | 35.3228 | 0.0000 | 0.0132 | 0.0978 | 0.1058 | 0.9624 | 0.9652 | 0.9681 | 30.1244 | 52.8195 | 80.1019 |
| 1 | 2022-01-02 | 4108304 | 202201 | 25.9288 | 31.0351 | 36.3261 | 0.0000 | 0.0043 | 0.0220 | 0.0345 | 0.9641 | 0.9662 | 0.9685 | 31.7948 | 48.0208 | 67.4433 |
| 2 | 2022-01-03 | 4108304 | 202201 | 26.2168 | 30.1859 | 34.8287 | 0.0000 | 0.1443 | 0.6431 | 1.1544 | 0.9657 | 0.9673 | 0.9696 | 40.3521 | 56.3396 | 75.7326 |
| 3 | 2022-01-04 | 4108304 | 202201 | 24.9282 | 27.3683 | 29.5687 | 0.0028 | 5.3999 | 15.2487 | 43.1995 | 0.9622 | 0.9646 | 0.9664 | 61.2906 | 76.2920 | 86.0319 |
| 4 | 2022-01-05 | 4108304 | 202201 | 24.5059 | 27.6275 | 31.2310 | 0.0000 | 2.2207 | 15.3052 | 17.7653 | 0.9639 | 0.9648 | 0.9663 | 51.0381 | 74.0777 | 93.2987 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 361 | 2022-12-28 | 4108304 | 202252 | 21.7809 | 25.4237 | 30.3080 | 0.0990 | 0.9195 | 1.7668 | 7.3559 | 0.9679 | 0.9696 | 0.9714 | 42.2631 | 74.1699 | 94.4107 |
| 362 | 2022-12-29 | 4108304 | 202252 | 18.9820 | 25.8130 | 32.4540 | 0.0000 | 0.2209 | 1.7668 | 1.7668 | 0.9705 | 0.9725 | 0.9747 | 29.4484 | 53.9913 | 81.7848 |
| 363 | 2022-12-30 | 4108304 | 202252 | 20.5351 | 27.1068 | 33.5379 | 0.0000 | 0.0001 | 0.0004 | 0.0004 | 0.9689 | 0.9721 | 0.9741 | 29.4692 | 53.4310 | 80.9801 |
| 364 | 2022-12-31 | 4108304 | 202252 | 23.5194 | 28.8650 | 34.5015 | 0.0000 | 0.0182 | 0.0493 | 0.1457 | 0.9685 | 0.9714 | 0.9741 | 35.0052 | 53.6517 | 73.5915 |
| 365 | 2023-01-01 | 4108304 | 202301 | 25.5737 | 30.1169 | 35.1959 | 0.0002 | 0.0817 | 0.3001 | 0.6539 | 0.9664 | 0.9701 | 0.9725 | 38.9653 | 57.2024 | 75.5044 |
366 rows × 16 columns
Climate Weekly¶
In [9]:
Copied!
mosqlient.get_climate_weekly?
mosqlient.get_climate_weekly?
Signature: mosqlient.get_climate_weekly( api_key: str, start: str, end: str, uf: Optional[Annotated[str, AfterValidator(func=<function validate_uf at 0x7eefe72ddb20>)]] = None, geocode: Optional[int] = None, macro_health_code: Optional[int] = None, ) -> pandas.core.frame.DataFrame Docstring: Retrieve historical climate data weekly aggregated Parameters ---------- api_key : str API key used to authenticate with the Mosqlimate service. start : str Start epiweek in YYYYWW format (example: 202501). end : str End epiweek in YYYYWW format (example: 202501). uf : str, optional The Brazilian state abbreviation (e.g., 'SP', 'MG'). geocode : int, optional IBGE geocode of a municipality. macro_health_code : int, optional Macro Health IBGE geocode. Example: 1101 Returns ------- pandas.DataFrame DataFrame containing daily climate data. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/climate-weekly/ Notes ----- - Either `uf` or `geocode` or `macro_health_code` must be provided. Examples -------- >>> get_climate_weekly( ... api_key="your_api_key", ... start="202401", ... end="202402", ... geocode=3550308 ... ) File: ~/Documentos/mosqlimate-client/mosqlient/datastore/_climate_get_impl.py Type: function
In [10]:
Copied!
mosqlient.get_climate_weekly(
api_key = api_key,
start = "202201",
end = "202301",
geocode = 4108304,
)
mosqlient.get_climate_weekly(
api_key = api_key,
start = "202201",
end = "202301",
geocode = 4108304,
)
Out[10]:
| epiweek | geocodigo | temp_min_avg | temp_med_avg | temp_max_avg | temp_amplit_avg | precip_tot_sum | umid_min_avg | umid_med_avg | umid_max_avg | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 202201 | 4108304 | 24.2693 | 28.0864 | 32.2336 | 7.9643 | 73.6119 | 48.2413 | 65.0009 | 80.8675 |
| 1 | 202202 | 4108304 | 23.2775 | 27.7596 | 32.7722 | 9.4947 | 12.3791 | 40.3529 | 61.9382 | 82.8912 |
| 2 | 202203 | 4108304 | 26.5513 | 31.5175 | 36.6646 | 10.1133 | 3.5952 | 31.6914 | 51.4059 | 73.1761 |
| 3 | 202204 | 4108304 | 25.6391 | 28.9419 | 32.6696 | 7.0305 | 107.7333 | 51.6893 | 66.7820 | 79.7656 |
| 4 | 202205 | 4108304 | 23.2069 | 26.4899 | 30.0356 | 6.8286 | 379.5296 | 58.2638 | 74.6899 | 88.3973 |
| 5 | 202206 | 4108304 | 20.4277 | 25.2807 | 30.4224 | 9.9948 | 38.2804 | 39.5132 | 60.9358 | 80.2294 |
| 6 | 202207 | 4108304 | 22.6134 | 28.3236 | 34.4828 | 11.8694 | 1.2217 | 31.0025 | 52.0062 | 73.5311 |
| 7 | 202208 | 4108304 | 24.2454 | 28.9652 | 34.7633 | 10.5179 | 17.9363 | 39.6146 | 64.2397 | 82.2612 |
| 8 | 202209 | 4108304 | 25.0768 | 28.4139 | 32.6476 | 7.5708 | 95.9880 | 54.8607 | 72.7155 | 86.3444 |
| 9 | 202210 | 4108304 | 24.1314 | 27.3415 | 31.2148 | 7.0834 | 153.9231 | 56.8073 | 72.5290 | 84.6526 |
| 10 | 202211 | 4108304 | 21.3372 | 24.7396 | 28.8178 | 7.4806 | 30.2727 | 57.8031 | 75.6584 | 90.6286 |
| 11 | 202212 | 4108304 | 19.7560 | 23.5228 | 27.6772 | 7.9213 | 422.6312 | 56.2705 | 73.7866 | 86.6719 |
| 12 | 202213 | 4108304 | 17.3800 | 21.5469 | 26.2013 | 8.8213 | 14.7462 | 57.7195 | 73.0022 | 85.2373 |
| 13 | 202214 | 4108304 | 20.9972 | 23.4041 | 26.8100 | 5.8128 | 190.0897 | 71.5951 | 85.7991 | 94.4932 |
| 14 | 202215 | 4108304 | 18.4571 | 21.4106 | 25.1715 | 6.7144 | 573.4511 | 63.5038 | 79.5803 | 90.2552 |
| 15 | 202216 | 4108304 | 17.2569 | 20.8463 | 25.3899 | 8.1330 | 184.7128 | 60.1331 | 80.1188 | 91.8362 |
| 16 | 202217 | 4108304 | 21.8869 | 24.8824 | 28.9868 | 7.0999 | 17.1170 | 61.6010 | 75.4950 | 83.8907 |
| 17 | 202218 | 4108304 | 16.3898 | 19.2897 | 22.7472 | 6.3573 | 236.7260 | 74.1734 | 87.6770 | 96.7032 |
| 18 | 202219 | 4108304 | 15.4910 | 18.5293 | 22.0499 | 6.5588 | 98.5714 | 67.1117 | 83.4311 | 94.2703 |
| 19 | 202220 | 4108304 | 11.6351 | 13.8234 | 16.5648 | 4.9298 | 63.2339 | 58.9717 | 74.8305 | 85.7494 |
| 20 | 202221 | 4108304 | 15.5323 | 18.4400 | 22.7846 | 7.2523 | 156.9500 | 62.5740 | 77.7694 | 87.7332 |
| 21 | 202222 | 4108304 | 13.0001 | 15.0447 | 17.5892 | 4.5890 | 385.9908 | 76.0159 | 86.2809 | 93.5513 |
| 22 | 202223 | 4108304 | 14.8368 | 17.3320 | 20.3325 | 5.4957 | 151.9685 | 68.9078 | 83.8573 | 93.6670 |
| 23 | 202224 | 4108304 | 10.3534 | 14.2385 | 19.2203 | 8.8670 | 128.1389 | 58.8954 | 77.3282 | 89.7154 |
| 24 | 202225 | 4108304 | 15.5134 | 18.6317 | 23.1847 | 7.6713 | 26.1895 | 70.9959 | 85.2621 | 95.3533 |
| 25 | 202226 | 4108304 | 14.4944 | 17.8652 | 22.7446 | 8.2502 | 3.6815 | 64.5179 | 79.8649 | 89.8262 |
| 26 | 202227 | 4108304 | 18.7058 | 21.4994 | 25.6933 | 6.9875 | 0.0590 | 53.3317 | 63.9078 | 70.5480 |
| 27 | 202228 | 4108304 | 16.3582 | 20.1024 | 25.1023 | 8.7441 | 156.5804 | 53.1867 | 66.3308 | 78.9570 |
| 28 | 202229 | 4108304 | 15.2610 | 18.5497 | 23.5356 | 8.2746 | 22.4484 | 61.4076 | 77.5086 | 88.4148 |
| 29 | 202230 | 4108304 | 15.3607 | 19.6843 | 25.5888 | 10.2282 | 17.5597 | 47.7834 | 69.1146 | 81.6339 |
| 30 | 202231 | 4108304 | 15.7657 | 19.1177 | 23.9893 | 8.2236 | 56.6368 | 53.8345 | 71.2351 | 85.4401 |
| 31 | 202232 | 4108304 | 13.2316 | 16.1198 | 20.0585 | 6.8269 | 197.0766 | 64.4530 | 80.9308 | 91.9683 |
| 32 | 202233 | 4108304 | 13.8443 | 17.2642 | 21.6443 | 7.8000 | 393.9289 | 52.1527 | 69.6702 | 81.7272 |
| 33 | 202234 | 4108304 | 14.3736 | 19.3000 | 25.7743 | 11.4007 | 0.0150 | 52.2872 | 72.8005 | 85.6528 |
| 34 | 202235 | 4108304 | 14.6189 | 18.2129 | 22.8961 | 8.2773 | 31.3380 | 50.6867 | 68.2177 | 80.9691 |
| 35 | 202236 | 4108304 | 15.4411 | 18.9193 | 23.6033 | 8.1622 | 113.7425 | 59.1491 | 74.2494 | 85.7853 |
| 36 | 202237 | 4108304 | 14.1578 | 18.4527 | 23.2701 | 9.1123 | 89.7901 | 56.2110 | 74.7256 | 87.5815 |
| 37 | 202238 | 4108304 | 13.8362 | 17.4820 | 21.8021 | 7.9659 | 189.5922 | 58.1364 | 75.0785 | 87.6932 |
| 38 | 202239 | 4108304 | 16.7805 | 18.9067 | 21.6213 | 4.8408 | 306.1936 | 74.0554 | 86.4893 | 94.3622 |
| 39 | 202240 | 4108304 | 15.3462 | 20.1158 | 25.2276 | 9.8815 | 195.0713 | 54.0466 | 74.4443 | 89.6146 |
| 40 | 202241 | 4108304 | 16.3979 | 19.0968 | 22.3537 | 5.9559 | 581.5409 | 74.1726 | 85.9418 | 94.9288 |
| 41 | 202242 | 4108304 | 18.5514 | 21.9085 | 25.5600 | 7.0087 | 377.9014 | 66.1247 | 82.8756 | 95.0863 |
| 42 | 202243 | 4108304 | 19.1568 | 24.0412 | 29.6198 | 10.4631 | 27.5611 | 48.3676 | 69.0319 | 84.9735 |
| 43 | 202244 | 4108304 | 13.6581 | 18.5943 | 23.7490 | 10.0909 | 203.2810 | 50.9235 | 69.6229 | 84.9016 |
| 44 | 202245 | 4108304 | 17.3162 | 22.4091 | 27.9459 | 10.6297 | 10.5248 | 43.8071 | 62.1495 | 76.0782 |
| 45 | 202246 | 4108304 | 18.4738 | 23.2314 | 29.0222 | 10.5484 | 81.7213 | 41.5326 | 63.5969 | 81.0047 |
| 46 | 202247 | 4108304 | 19.8099 | 24.2382 | 29.2912 | 9.4814 | 59.5623 | 48.6269 | 66.7669 | 83.7793 |
| 47 | 202248 | 4108304 | 21.7150 | 26.1369 | 30.9838 | 9.2688 | 26.2677 | 48.2079 | 66.8091 | 82.8010 |
| 48 | 202249 | 4108304 | 24.2743 | 28.1523 | 32.9083 | 8.6340 | 44.1106 | 54.9971 | 76.0358 | 92.8916 |
| 49 | 202250 | 4108304 | 22.1361 | 26.4932 | 31.0494 | 8.9133 | 64.0720 | 45.4950 | 66.9451 | 85.0606 |
| 50 | 202251 | 4108304 | 21.1739 | 25.3331 | 29.4418 | 8.2678 | 65.3105 | 48.8330 | 66.9984 | 82.3829 |
| 51 | 202252 | 4108304 | 21.7558 | 26.9329 | 32.3541 | 10.5983 | 12.4078 | 37.6928 | 60.9106 | 83.2672 |
| 52 | 202301 | 4108304 | 21.2979 | 25.4136 | 30.2249 | 8.9270 | 410.8377 | 46.8968 | 68.3932 | 85.2647 |
Episcanner¶
In [11]:
Copied!
mosqlient.get_episcanner?
mosqlient.get_episcanner?
Signature: mosqlient.get_episcanner( api_key: str, uf: Annotated[str, AfterValidator(func=<function validate_uf at 0x7eefe72ddb20>)], disease: Literal['dengue', 'zika', 'chikungunya'] = 'dengue', year: Optional[int] = 2026, ) -> pandas.core.frame.DataFrame Docstring: Parameters ---------- api_key : str API key used to authenticate with the Mosqlimate service. disease : types.Disease Default: "dengue". Options: dengue, chikungunya or zika uf : types.UF The Brazilian state abbreviation (e.g., 'SP', 'MG'). year : int, optional Default value is the current year. Returns ------- pandas.DataFrame DataFrame containing Episcanner data. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/episcanner/ Examples -------- >>> get_episcanner( ... api_key="your_api_key", ... uf="SP", ... ) File: ~/Documentos/mosqlimate-client/mosqlient/datastore/_episcanner_get_impl.py Type: function
In [12]:
Copied!
mosqlient.get_episcanner(
api_key = api_key,
uf = "SP"
)
mosqlient.get_episcanner(
api_key = api_key,
uf = "SP"
)
Out[12]:
| disease | CID10 | year | geocode | muni_name | peak_week | beta | gamma | R0 | total_cases | alpha | sum_res | ep_ini | ep_end | ep_dur | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | dengue | A90 | 2026 | 3550506 | São Pedro do Turvo | 13.877793 | 0.458385 | 0.301359 | 1.521060 | 94.639347 | 0.342564 | 0.793885 | 202546 | 202619 | 26 |
| 1 | dengue | A90 | 2026 | 3533007 | Nova Granada | 18.880888 | 0.577349 | 0.300000 | 1.924498 | 623.670356 | 0.480384 | 0.604165 | 202550 | 202619 | 22 |
| 2 | dengue | A90 | 2026 | 3551702 | Sertãozinho | 16.061778 | 0.463552 | 0.300000 | 1.545173 | 1900.458789 | 0.352823 | 0.389143 | 202546 | 202619 | 26 |
| 3 | dengue | A90 | 2026 | 3541703 | Quatá | 18.912783 | 0.448055 | 0.300569 | 1.490688 | 108.872426 | 0.329169 | 1.019257 | 202546 | 202619 | 26 |
| 4 | dengue | A90 | 2026 | 3540606 | Porto Feliz | 18.877950 | 0.457426 | 0.300049 | 1.524504 | 513.686635 | 0.344049 | 0.371010 | 202546 | 202619 | 26 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 151 | dengue | A90 | 2026 | 3513405 | Cruzeiro | 17.417791 | 0.445615 | 0.300139 | 1.484696 | 420.871787 | 0.326462 | 0.460958 | 202546 | 202619 | 26 |
| 152 | dengue | A90 | 2026 | 3520004 | Igaraçu do Tietê | 17.847540 | 0.495304 | 0.300255 | 1.649610 | 126.841052 | 0.393796 | 0.370874 | 202546 | 202619 | 26 |
| 153 | dengue | A90 | 2026 | 3539400 | Piratininga | 21.427819 | 0.655899 | 0.330000 | 1.987574 | 70.147139 | 0.496874 | 1.643955 | 202602 | 202619 | 17 |
| 154 | dengue | A90 | 2026 | 3554805 | Tremembé | 22.311137 | 0.517386 | 0.330000 | 1.567838 | 2026.800000 | 0.362179 | 0.499657 | 202546 | 202619 | 26 |
| 155 | dengue | A90 | 2026 | 3530508 | Mococa | 19.606789 | 0.469730 | 0.330000 | 1.423425 | 112.800000 | 0.297469 | 1.106596 | 202546 | 202619 | 26 |
156 rows × 15 columns
Mosquito¶
In [13]:
Copied!
mosqlient.get_mosquito?
mosqlient.get_mosquito?
Signature: mosqlient.get_mosquito( api_key: str, date_start: Optional[str] = None, date_end: Optional[str] = None, state: Optional[str] = None, municipality: Optional[str] = None, page: Optional[int] = None, ) -> pandas.core.frame.DataFrame Docstring: Parameters ---------- api_key : str API key used to authenticate with the Mosqlimate service. date_start : str, optional Format: YYYY-MM-dd date_end : str, optional Format: YYYY-MM-dd state : str, optional Example: MG municipality : str, optional Name of the municipality. Example: "Ponta Porã" page : int, optional Returns ------- pandas.DataFrame DataFrame containing ContaOvos data. Detailed descriptions of each column in the DataFrame can be found in the official API documentation: https://api.mosqlimate.org/docs/datastore/GET/mosquito/ Examples -------- >>> get_mosquito( ... api_key="your_api_key", ... date_start="2024-01-01", ... date_end="2024-12-31", ... municipality="Ponta Porã", ... ) File: ~/Documentos/mosqlimate-client/mosqlient/datastore/_mosquito_get_impl.py Type: function
In [14]:
Copied!
mosqlient.get_mosquito(
api_key = api_key,
date_start = "2024-01-01",
date_end = "2024-12-31",
state = "MG",
)
mosqlient.get_mosquito(
api_key = api_key,
date_start = "2024-01-01",
date_end = "2024-12-31",
state = "MG",
)
Out[14]:
| counting_id | date | date_collect | eggs | latitude | longitude | municipality | municipality_code | ovitrap_id | ovitrap_website_id | state_code | state_name | time | week | year | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 625888 | 2024-12-30 | 2025-01-06 | 150 | -19.703060 | -43.965170 | São José da Lapa | 3162955 | 1 | 50946 | MG | Minas Gerais | Mon, 06 Jan 2025 13:47:17 GMT | 52 | 2024 |
| 1 | 625890 | 2024-12-30 | 2025-01-06 | 139 | -19.702480 | -43.963040 | São José da Lapa | 3162955 | 2 | 50955 | MG | Minas Gerais | Mon, 06 Jan 2025 13:47:37 GMT | 52 | 2024 |
| 2 | 625892 | 2024-12-30 | 2025-01-06 | 0 | -19.699580 | -43.959390 | São José da Lapa | 3162955 | 3 | 50957 | MG | Minas Gerais | Mon, 06 Jan 2025 13:47:51 GMT | 52 | 2024 |
| 3 | 625896 | 2024-12-30 | 2025-01-06 | 156 | -19.699110 | -43.956040 | São José da Lapa | 3162955 | 4 | 50960 | MG | Minas Gerais | Mon, 06 Jan 2025 13:48:14 GMT | 52 | 2024 |
| 4 | 625898 | 2024-12-30 | 2025-01-06 | 130 | -19.696980 | -43.957700 | São José da Lapa | 3162955 | 5 | 50964 | MG | Minas Gerais | Mon, 06 Jan 2025 13:48:32 GMT | 52 | 2024 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 95 | 627418 | 2024-12-30 | 2025-01-06 | 0 | -18.567246 | -46.514526 | Patos de Minas | 3148004 | 85 | 28347 | MG | Minas Gerais | Tue, 07 Jan 2025 14:42:53 GMT | 52 | 2024 |
| 96 | 627419 | 2024-12-30 | 2025-01-06 | 7 | -18.572615 | -46.519128 | Patos de Minas | 3148004 | 86 | 28366 | MG | Minas Gerais | Tue, 07 Jan 2025 14:42:59 GMT | 52 | 2024 |
| 97 | 627420 | 2024-12-30 | 2025-01-06 | 57 | -18.569503 | -46.523549 | Patos de Minas | 3148004 | 87 | 28358 | MG | Minas Gerais | Tue, 07 Jan 2025 14:43:08 GMT | 52 | 2024 |
| 98 | 627421 | 2024-12-30 | 2025-01-06 | 29 | -18.568464 | -46.526139 | Patos de Minas | 3148004 | 88 | 28356 | MG | Minas Gerais | Tue, 07 Jan 2025 14:43:16 GMT | 52 | 2024 |
| 99 | 627422 | 2024-12-30 | 2025-01-06 | 0 | -18.567022 | -46.528580 | Patos de Minas | 3148004 | 89 | 28357 | MG | Minas Gerais | Tue, 07 Jan 2025 14:43:24 GMT | 52 | 2024 |
100 rows × 15 columns