InstitucionesCR Scraper
Spanish README/ README en español
Python Scraper to retrieve important data published by institutions. Supported institutions:
- BCCR, Central Bank of Costa Rica (dollar exchange rate)
- RECOPE (Fuel prices at stations and terminals)
The daily updated values are useful in automated processes; unfortunately, many times institutions do not prioritize enabling APIs for easy value retrieval by programs. For this reason, I have created this small project to fetch these data from the interfaces previously designed for humans.
Install
pip install instcr
Usage
Get fuel price information from RECOPE
from instcr import Recope
recope = Recope()
recope.print_data()
print(f"\nPrecio del diesel: {recope.table_estaciones['diesel_50']['precio_litro_total']}")
## ## Much later:
recope.update()
## Diesel price at stations
recope.table_estaciones['diesel_50']['precio_litro_total']
## Diesel price at terminals
recope.table_terminales['diesel_50']['precio_litro_total']
# recope.table_estaciones.keys() Shows all available fuels at stations
Exchange rate from the Central Bank of Costa Rica
from instcr import Bccr
bccr = Bccr()
## Show both buy and sell tables
bccr.print_data()
## Print today's information (date= datetime to specify a different date)
print(f"\n Today sell dollar price: {bccr.dollar('sell')}")
print(f"\n Today buy dollar price: {bccr.dollar('buy')}")
Metadata
Release files for instcr 0.1.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 | |
|---|---|---|---|
| instcr-0.1.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| instcr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / instcr-0.1.0.tar.gz
| Download URL | instcr-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe73feb297f83ba9baec5a09ecbed13ba9f145906e75ddf937d60e3f0e470808
|
|
BLAKE2b-256 checksum How to use checksums |
a8846363cc629a365c048e68c2286efdf08eed1687d19ebe019e64e0184a8d33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / instcr-0.1.0-py3-none-any.whl
| Download URL | instcr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da378465698a5a945f524948fd11d08c787261769f3a9e046377021c405eba9f
|
|
BLAKE2b-256 checksum How to use checksums |
8cb144f7f1f4b95332e9689e97edd3ecd11b7331e4f6dc50eb9bd71e0ee12064
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|