Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeancahu/institucionescr
Leer los precios de los combustibles desde el sitio de RECOPE. Go. Costa Rica. Leer el tipo de cambio del dólar del BCCR.
https://github.com/jeancahu/institucionescr
https scraping-websites
Last synced: about 2 months ago
JSON representation
Leer los precios de los combustibles desde el sitio de RECOPE. Go. Costa Rica. Leer el tipo de cambio del dólar del BCCR.
- Host: GitHub
- URL: https://github.com/jeancahu/institucionescr
- Owner: jeancahu
- License: mit
- Created: 2023-07-19T15:41:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-28T00:52:15.000Z (over 1 year ago)
- Last Synced: 2024-11-08T11:52:46.390Z (2 months ago)
- Topics: https, scraping-websites
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InstitucionesCR Scraper
[Spanish README/ README en español](https://github.com/jeancahu/institucionesCR/blob/main/README_es.md)
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
```python
from instcr.recope import Recoperecope = 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
```python
from instcr.bccr import Bccrbccr = 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')}")
```