Get the government bond yield for a variety of countries over time from the OECD. By default this is the long-term (10-year) government bond yield; set short_term=True to get the short-term (3-month) rate instead. The two maturities are described below.

Long-term (short_term=False): long-term interest rates refer to government bonds maturing in ten years. Rates are mainly determined by the price charged by the lender, the risk from the borrower and the fall in the capital value. Long-term interest rates are generally averages of daily rates, measured as a percentage. These interest rates are implied by the prices at which the government bonds are traded on financial markets, not the interest rates at which the loans were issued.

In all cases, they refer to bonds whose capital repayment is guaranteed by governments. Long-term interest rates are one of the determinants of business investment. Low long term interest rates encourage investment in new equipment and high interest rates discourage it. Investment is, in turn, a major source of economic growth.

See definition: OECD

Also known as: treasury yield, bond yield by maturity.

The same function with another argument gives the 3-Month Government Bond Yield, each on its own page.

10-Year Government Bond Yield in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_government_bond_yield as shown below.

from financetoolkit import FixedIncome

fixedincome = FixedIncome(start_date='2023-05-01', end_date='2023-12-31')

long_term_interest_rate = fixedincome.get_government_bond_yield(short_term=False, period='monthly')

long_term_interest_rate.loc[:, ['Japan', 'United States', 'Germany']]

Which returns:

  Japan United States Germany
2023-05 0.0043 0.0357 0.0234
2023-06 0.004 0.0375 0.0238
2023-07 0.0059 0.039 0.0246
2023-08 0.0064 0.0417 0.0255
2023-09 0.0076 0.0438 0.0266
2023-10 0.0095 0.048 0.0282
2023-11 0.0066 0.045 0.026
2023-12 0.0062 0.0402 0.021

Parameters

get_government_bond_yield accepts the following parameters.

ParameterTypeDescriptionExample
short_termboolWhether to return the short-term interest rate. Defaults to False. This means that the long-term interest rate will be returned.True
periodstr | NoneWhether to return the monthly, quarterly or the annual data. Defaults to None, which returns the monthly data (quarterly when the class was created with quarterly=True)."quarterly"
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagintThe number of periods to lag the growth data by. Defaults to 1.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column
Share