Search, industries, screener
Search
Search
jfinance.Search(query, max_results=8, session=None, timeout=30, raise_errors=True)Finds companies and funds by name or code.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
query | str | — | Company name, securities code or EDINET code |
max_results | int | 8 | Maximum number of matches |
session | requests.Session | None | Session to reuse |
timeout | int | 30 | Seconds |
raise_errors | bool | True | Raise 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
| Name | Type | Description |
|---|---|---|
quotes | list[dict] | Matches, each with symbol, shortname, longname, quoteType, exchange and score |
all | dict | {"quotes": [...]}. news, lists and research are absent |
response | dict | The 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
| Method | Returns |
|---|---|
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
| Name | Type | Description |
|---|---|---|
key | str | Sector key, as in "automobiles-transportation-equipment" |
Attributes
| Name | Type | Description |
|---|---|---|
key, name | str | Key and display name |
overview | dict | companiesCount, industriesCount and topCompaniesBasis, which states how top_companies is ordered |
top_companies | pandas.DataFrame | Listed companies in the sector. Columns name, edinetCode, revenue, fiscalYear |
industries | pandas.DataFrame | TSE industries within the sector, indexed by key, with name and companiesCount |
Static method
JpSector.all(session=None) -> pandas.DataFrameAll 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_companiesis 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) -> dictFilters companies on disclosed figures. Written the same way as yfinance’s screen.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
query | EdinetQuery | — | The condition |
offset | int | None | Rows to skip |
size | int | None | Rows to return |
sortField | str | None | Field to sort by |
sortAsc | bool | None | Ascending instead of descending |
year | int | None | Fiscal year. Latest available when omitted |
scope | str | "consolidated" | "consolidated" or "standalone" |
session | requests.Session | None | Session 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
| Name | Type | Description |
|---|---|---|
operator | str | "eq", "is-in", "btwn", "gt", "lt", "gte", "lte", "and", "or" |
operand | list | [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
| Name | Type | Description |
|---|---|---|
valid_fields | dict | Fields that can be queried, grouped by category, each with its label and unit |
valid_values | dict | Accepted values for the categorical fields |
to_dict() | dict | The query as sent to the server |
The field categories, and how many fields each holds:
| Category | Fields | Examples |
|---|---|---|
pl | 19 | revenue, operatingIncome, ordinaryIncome, netIncome, grossProfit |
bs | 8 | totalAssets, netAssets, capitalStock, bs_retainedEarnings |
cf | 7 | operatingCF, investingCF, financingCF, capex |
perShare | 5 | eps, epsDiluted, bps, dividendPerShare |
ratio | 5 | roe, equityRatio, payoutRatio, per, tsr |
shares | 1 | issuedShares |
workforce | 2 | employees, temporaryEmployees |
statement | 14 | Bank and insurer items, as in deposits, loans, net_premiums_written |
categorical | 6 | sector, industry, market, listing, accountingStandard, fiscalMonth |
The accepted values for the categorical fields:
| Field | Values |
|---|---|
market | prime, standard, growth, pro |
listing | listed, unlisted |
accountingStandard | Japan GAAP, IFRS, US GAAP |
sector, industry | The TOPIX-17 and TSE 33 keys |
fiscalMonth | Month 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.
peris the price earnings ratio as stated in the annual report, not one calculated from a price.