Python WEB Scraper for Costa Rica institutions public data
Project description
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')}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instcr-0.1.0.tar.gz.
File metadata
- Download URL: instcr-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe73feb297f83ba9baec5a09ecbed13ba9f145906e75ddf937d60e3f0e470808
|
|
| MD5 |
7ff64483463cabfd02a65c769a68d198
|
|
| BLAKE2b-256 |
a8846363cc629a365c048e68c2286efdf08eed1687d19ebe019e64e0184a8d33
|
File details
Details for the file instcr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: instcr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da378465698a5a945f524948fd11d08c787261769f3a9e046377021c405eba9f
|
|
| MD5 |
ada1ae515f335506fbdf2f99ec2e0f0e
|
|
| BLAKE2b-256 |
8cb144f7f1f4b95332e9689e97edd3ecd11b7331e4f6dc50eb9bd71e0ee12064
|