Configuration

Settings are global and apply for the life of the process.

Settings

config

jfinance.config

Settings object, the same one yfinance uses.

SettingTypeDefaultDescription
config.locale.langstr"en-US""ja-JP" returns company and industry names in Japanese
config.locale.regionstr"US"Region
config.network.proxystrNoneHTTP proxy
config.network.retriesint0Retries on a failed request
config.debug.loggingboolFalseLog requests and responses
config.debug.hide_exceptionsboolTrueSwallow exceptions inside attribute access
jf.config.locale.lang = "ja-JP"
jf.Ticker("7203.T").info["shortName"]     # 'トヨタ自動車株式会社'

Values with no English original — business descriptions, and the names of officers and shareholders — are returned in Japanese under either setting.

set_base_url

jfinance.set_base_url(url) -> None
jfinance.get_base_url() -> str

Points the client at a different server. The default is jfinance.DEFAULT_BASE_URL, which is https://query1.jfnc.org.

Parameters

NameTypeDescription
urlstrBase URL, as in "http://localhost:8080"
jf.set_base_url("http://localhost:8080")

enable_debug_mode

jfinance.enable_debug_mode() -> None

Logs every request and response. Equivalent to setting config.debug.logging.

Exceptions

Exception names are kept as they are in yfinance, YF prefix included, so that code written against yfinance runs unchanged.

ExceptionBaseRaised when
YFExceptionExceptionBase class for the rest
YFRateLimitErrorYFExceptionThe rate limit was hit (HTTP 429). Retry after the seconds given in the Retry-After header
YFDataExceptionYFExceptionThe response is not in the expected shape
YFTickerMissingErrorYFExceptionThe symbol does not exist
YFNotImplementedErrorNotImplementedErrorThe method exists for compatibility but has no EDINET source
from jfinance.exceptions import YFRateLimitError

try:
    t.info
except YFRateLimitError:
    ...

requests.HTTPError propagates for other HTTP errors. Rate limits are described under Terms of use.

Notices

jfinance.NOTICE_CORRECTIONS

A string stating that amendments to filings past their EDINET public inspection period cannot be retrieved and may therefore not be reflected. The same text is returned in the X-JF-Notice header of every HTTP response. See Data notes.