API wrapper fyrir Hagstofuna
Project description
Hagstofan
Description
API wrapper fyrir hagstofu vefþjónustuna
Installation
Prerequisites
- Python 3.
- pip
Installing the package
Installa frá github repository:
pip install hagstofan
pip install git+https://github.com/datador/hagstofan.git
Usage
Importing the package
from hagstofan import Hagstofan
Examples
# Initializa classinn
hagstofan = Hagstofan()
# Leitum og finnum möguleg gagnasett
hagstofan.search_datasets('visitala neysluverds').head(1)
| dbid | id | text | url |
|---|---|---|---|
| Efnahagur | VIS01000.px | Vísitala neysluverðs og breytingar, grunnur 19 | https://px.hagstofa.is/pxis/api/v1/is/Efnahagu... |
# Hvenær var taflan síðast uppfærð?
hagstofan.get_update('VIS01000.px')
'2023-08-30T08:58:02'
# Náum í gögnin
df = hagstofan.get_data(table='VIS01000.px')
df
| Mánuður_index | Mánuður_label | Vísitala_index | Vísitala_label | Liður_index | Liður_label | Value | |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1988M05 | CPI | Vísitala neysluverðs | index | Vísitala | 100 |
| 1 | 1 | 1988M05 | CPI | Vísitala neysluverðs | change_M | Mánaðarbreyting, % | nan |
| 2 | 2 | 1988M05 | CPI | Vísitala neysluverðs | change_A | Ársbreyting, % | nan |
| 3 | 3 | 1988M05 | CPI | Vísitala neysluverðs | A_rate_M | Ársbreyting síðasta mánuð, % | nan |
| 4 | 4 | 1988M05 | CPI | Vísitala neysluverðs | A_rate_3M | Ársbreyting síðustu 3 mánuði, % | nan |
Async Methods
Pakkinn notar asyncio fyrir asynchronous operations. Allt sem keyrir með run_async_method_sync decorateornum keyrir async synchronously til að geta keyrt í notebooks, það heldur samt asynchronous http requestunum og tapar ekki virkni.
Configuration
Pakkinn notar JSON config skrá undir configs/table_data.json. Hún heldur utan um öll API köll möguleg (gagnaskrá).
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 hagstofan-0.1.1.tar.gz.
File metadata
- Download URL: hagstofan-0.1.1.tar.gz
- Upload date:
- Size: 52.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c9dcc3946f63c17f462cb6fb1d63ebb880a86481f9a762ab0d2d1989ad79be5
|
|
| MD5 |
e29eee5a7646cbe4d725bce46879e0e6
|
|
| BLAKE2b-256 |
b8fe1cc11e252e51422b3ae90ec05454a082267b77b02ee7242aef04f1b97225
|
File details
Details for the file hagstofan-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hagstofan-0.1.1-py3-none-any.whl
- Upload date:
- Size: 54.8 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 |
a284421febc6605e8f583b7e4a2dd84ff073e6585df405bcce1b61ff66a27b8a
|
|
| MD5 |
a49499cd35a934e313762e7f94d51078
|
|
| BLAKE2b-256 |
a870c6c89100110cbfdb451ba2b3bf47656e0f19807ecb40cb18e5e35cb17f4e
|