Search, industries, screener

Search

jfinance.Search(query, max_results=8, session=None, timeout=30, raise_errors=True)

Finds companies and funds by name or code.

Parameters

NameTypeDefaultDescription
querystr—Company name, securities code or EDINET code
max_resultsint8Maximum number of matches
sessionrequests.SessionNoneSession to reuse
timeoutint30Seconds
raise_errorsboolTrueRaise on an HTTP error instead of returning empty

The remaining yfinance arguments — news_count, lists_count, include_research and the rest — are accepted and ignored, since EDINET carries none of that.

Attributes

NameTypeDescription
quoteslist[dict]Matches, each with symbol, shortname, longname, quoteType, exchange and score
alldict{"quotes": [...]}. news, lists and research are absent
responsedictThe server response unchanged
jf.Search("トヨタ").quotes[0]["symbol"]     # '3116.T'

Lookup

jfinance.Lookup(query, session=None, timeout=30, raise_errors=True)

The same search in tabular form.

Methods

MethodReturns
get_all(count=25)All matches
get_stock(count=25)Equities
get_etf(count=25)ETFs
get_mutualfund(count=25)Investment trusts

all, stock, etf and mutualfund are the same, with the default count.

Returns — pandas.DataFrame, indexed by symbol, with columns shortName, quoteType, exchange and industryName.

Industries

Companies are classified under both Tokyo Stock Exchange schemes: TOPIX-17 sectors and the 33 TSE industries.

JpSector

jfinance.JpSector(key, session=None)

One TOPIX-17 sector.

Parameters

NameTypeDescription
keystrSector key, as in "automobiles-transportation-equipment"

Attributes

NameTypeDescription
key, namestrKey and display name
overviewdictcompaniesCount, industriesCount and topCompaniesBasis, which states how top_companies is ordered
top_companiespandas.DataFrameListed companies in the sector. Columns name, edinetCode, revenue, fiscalYear
industriespandas.DataFrameTSE industries within the sector, indexed by key, with name and companiesCount

Static method

JpSector.all(session=None) -> pandas.DataFrame

All 17 sectors, indexed by key, with name, companiesCount and industriesCount.

JpIndustry

jfinance.JpIndustry(key, session=None)

One of the 33 TSE industries. key, name, overview and top_companies are as for JpSector; sector_key and sector_name give the TOPIX-17 sector it belongs to.

jf.JpIndustry("transportation-equipment").top_companies

top_companies is ordered by revenue in the latest fiscal year, consolidated where available. Since EDINET carries no share prices, this is not a ranking by market capitalisation.

Screener

edinet_screen

jfinance.edinet_screen(query, offset=None, size=None, sortField=None,
                       sortAsc=None, year=None, scope="consolidated",
                       session=None) -> dict

Filters companies on disclosed figures. Written the same way as yfinance’s screen.

Parameters

NameTypeDefaultDescription
queryEdinetQuery—The condition
offsetintNoneRows to skip
sizeintNoneRows to return
sortFieldstrNoneField to sort by
sortAscboolNoneAscending instead of descending
yearintNoneFiscal year. Latest available when omitted
scopestr"consolidated""consolidated" or "standalone"
sessionrequests.SessionNoneSession to reuse

Returns — dict with start, count, total, fiscalYear, scope and quotes. Each entry in quotes carries symbol, shortName, longName, edinetCode, industry, sector, marketSegment, accountingStandard, fiscalYear, fiscalYearEnd, and the fields named in the query and in sortField.

jf.edinet_screen(
    jf.EdinetQuery("gt", ["roe", 0.2]),
    sortField="revenue",
    size=50,
)

EdinetQuery

jfinance.EdinetQuery(operator, operand)

Parameters

NameTypeDescription
operatorstr"eq", "is-in", "btwn", "gt", "lt", "gte", "lte", "and", "or"
operandlist[field, value] for a comparison, or a list of EdinetQuery for and and or
q = jf.EdinetQuery("and", [
    jf.EdinetQuery("gt", ["roe", 0.15]),
    jf.EdinetQuery("is-in", ["sector", ["banks", "insurance"]]),
])
jf.edinet_screen(q)

Attributes

NameTypeDescription
valid_fieldsdictFields that can be queried, grouped by category, each with its label and unit
valid_valuesdictAccepted values for the categorical fields
to_dict()dictThe query as sent to the server

The field categories, and how many fields each holds:

CategoryFieldsExamples
pl19revenue, operatingIncome, ordinaryIncome, netIncome, grossProfit
bs8totalAssets, netAssets, capitalStock, bs_retainedEarnings
cf7operatingCF, investingCF, financingCF, capex
perShare5eps, epsDiluted, bps, dividendPerShare
ratio5roe, equityRatio, payoutRatio, per, tsr
shares1issuedShares
workforce2employees, temporaryEmployees
statement14Bank and insurer items, as in deposits, loans, net_premiums_written
categorical6sector, industry, market, listing, accountingStandard, fiscalMonth

The accepted values for the categorical fields:

FieldValues
marketprime, standard, growth, pro
listinglisted, unlisted
accountingStandardJapan GAAP, IFRS, US GAAP
sector, industryThe TOPIX-17 and TSE 33 keys
fiscalMonthMonth of the fiscal year end

Fields derived from share prices — market capitalisation, P/E, share price — are not available, since EDINET does not carry them. per is the price earnings ratio as stated in the annual report, not one calculated from a price.