-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
67 lines (47 loc) · 1.58 KB
/
Copy path__init__.py
File metadata and controls
67 lines (47 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""Special Drawing Rights (SDR) reader module.
This module offers access to the IMF's Special Drawing Rights (SDR) data.
The SDR is an international reserve asset created by the IMF in 1969.
It is not a currency, but the holder of SDRs can exchange them for usable currencies in times of need.
Read more about SDRs at: https://www.imf.org/en/About/Factsheets/Sheets/2023/special-drawing-rights-sdr
Usage:
Import the module
```python
from imf_reader import sdr
```
Read allocations and holdings data
```python
sdr.fetch_allocations_holdings()
```
SDRs holdings and allocations are published at a monthly frequency. The function fetches the latest data available by
default. Check the latest available date
```python
sdr.fetch_latest_allocations_holdings_date()
```
To retrieve SDR holdings and allocations for a specific month and year, eg April 2021, pass the year and month as a tuple
```python
sdr.fetch_allocations_holdings((2021, 4))
```
Read interest rates
```python
sdr.fetch_interest_rates()
```
Read exchange rates
```python
sdr.fetch_exchange_rates()
```
By default, the exchange rate is in USDs per 1 SDR. To get the exchange rate in SDRs per 1 USD, pass the unit basis as "USD"
```python
sdr.fetch_exchange_rates("USD")
```
Clear cached data
```python
sdr.clear_cache()
```
"""
from imf_reader.sdr.read_interest_rate import fetch_interest_rates
from imf_reader.sdr.read_exchange_rate import fetch_exchange_rates
from imf_reader.sdr.read_announcements import (
fetch_allocations_holdings,
fetch_latest_allocations_holdings_date,
)
from imf_reader.sdr.clear_cache import clear_cache