Auxiliary¶
auxiliary
¶
Auxiliary data functions and convenience wrappers.
get_aux(table=None, version=None, ppp_version=None, release_version=None, api_version=API_VERSION, fmt='json', simplify=True, server=None, dataframe_type='pandas', assign_tb=False, replace=False)
¶
Fetch an auxiliary dataset from the PIP API.
When no table is specified, returns a list of available table names.
Mirrors pipr::get_aux().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str | None
|
Auxiliary table name (e.g. |
None
|
version
|
str | None
|
Data version string. |
None
|
ppp_version
|
int | None
|
PPP base year. |
None
|
release_version
|
str | None
|
Release date in |
None
|
api_version
|
str
|
API version. |
API_VERSION
|
fmt
|
str
|
Response format — |
'json'
|
simplify
|
bool
|
If |
True
|
server
|
str | None
|
Server target. |
None
|
dataframe_type
|
Literal['pandas', 'polars']
|
|
'pandas'
|
assign_tb
|
bool | str
|
If |
False
|
replace
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame | list[str] | PIPResponse | bool
|
|
DataFrame | list[str] | PIPResponse | bool
|
|
DataFrame | list[str] | PIPResponse | bool
|
|
DataFrame | list[str] | PIPResponse | bool
|
|
Example
import povineq tables = povineq.get_aux() # list of available tables df = povineq.get_aux("gdp") # fetch GDP table povineq.get_aux("cpi", assign_tb=True) # fetch and store in memory
Source code in src/povineq/auxiliary.py
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
display_aux(version=None, ppp_version=None, release_version=None, api_version=API_VERSION, fmt='json', simplify=True, server=None)
¶
Display available auxiliary tables.
Fetches the list of auxiliary tables and prints them. Mirrors
pipr::display_aux().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str | None
|
Data version string. |
None
|
ppp_version
|
int | None
|
PPP base year. |
None
|
release_version
|
str | None
|
Release date in |
None
|
api_version
|
str
|
API version. |
API_VERSION
|
fmt
|
str
|
Response format. |
'json'
|
simplify
|
bool
|
Passed to :func: |
True
|
server
|
str | None
|
Server target. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame | list[str]
|
List of available table name strings. |
Example
import povineq povineq.display_aux()
Source code in src/povineq/auxiliary.py
call_aux(table=None)
¶
Retrieve a previously stored auxiliary table from memory.
Mirrors pipr::call_aux().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
str | None
|
Table name to retrieve. If |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame | list[str]
|
The stored DataFrame, or a list of stored table names. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the requested table is not in the store. |
Example
import povineq povineq.get_aux("gdp", assign_tb=True) df = povineq.call_aux("gdp")