Stocks Module Reference
New in version 0.0.6.
Control the macOS Stocks application using JXA-like syntax.
Classes:
|
A class for managing and interacting with Stocks.app. |
|
A class for interacting with stocks in Stocks.app. |
|
A wrapper around a list of stocks. |
- class PyXA.apps.Stocks.XAStocksApplication(properties)[source]
Bases:
XAApplication
A class for managing and interacting with Stocks.app.
See also
New in version 0.0.6.
Methods:
go_back
()Clicks the 'back' button (from a new article when viewed in the Stocks app).
new_tab
()Opens a new tab.
Gets a list of stocks.
Shows the 'Business News' tab in the front stock window.
show_symbol
(ticker)Displays the page for the specified ticker symbol.
Attributes:
Whether the sidebar is currently showing.
- go_back() XAStocksApplication [source]
Clicks the ‘back’ button (from a new article when viewed in the Stocks app).
- Returns:
A reference to the application object
- Return type:
New in version 0.0.6.
- saved_stocks() XAStocksSavedStockList [source]
Gets a list of stocks.
- Returns:
The list of stocks
- Return type:
XAStocksStockList
New in version 0.0.6.
- show_business_news() XAStocksApplication [source]
Shows the ‘Business News’ tab in the front stock window.
- Returns:
A reference to the application object
- Return type:
New in version 0.0.6.
- show_symbol(ticker: str) XAStocksApplication [source]
Displays the page for the specified ticker symbol.
- Parameters:
ticker (str) – The ticker symbol for the desired stock
- Returns:
A reference to the application object
- Return type:
New in version 0.0.6.
- property sidebar_showing: bool
Whether the sidebar is currently showing.
- class PyXA.apps.Stocks.XAStocksSavedStock(properties)[source]
Bases:
XAObject
,XAClipboardCodable
A class for interacting with stocks in Stocks.app.
New in version 0.0.6.
Attributes:
The percentage or point change of the stock in the current trading session.
The name of the stock (The company name).
The current price of the stock.
All properties of the stock.
Whether the stock is the currently selected stock.
The symbol for the stock.
Methods:
Gets a clipboard-codable representation of the stock.
show
()Shows the stock's tab in the front stock window.
- property change: str
The percentage or point change of the stock in the current trading session.
- get_clipboard_representation() list[str | NSURL] [source]
Gets a clipboard-codable representation of the stock.
When the clipboard content is set to a saved stock, the stocks’s name, price, and stocks URI are added to the clipboard.
- Returns:
The stock’s name, price, and stocks URI
- Return type:
list[Union[str, NSURL]]
New in version 0.0.8.
- property name: str
The name of the stock (The company name).
- property price: float
The current price of the stock.
- property properties: dict
All properties of the stock.
- property selected: bool
Whether the stock is the currently selected stock.
- property symbol: str
The symbol for the stock.
- class PyXA.apps.Stocks.XAStocksSavedStockList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
,XAClipboardCodable
A wrapper around a list of stocks.
New in version 0.0.6.
Methods:
change
()Gets a clipboard-codable representation of each stock in the list.
name
()price
()selected
()symbol
()- get_clipboard_representation() list[str | NSURL] [source]
Gets a clipboard-codable representation of each stock in the list.
When the clipboard content is set to a list of saved stocks, each stocks’s name, price, and stocks URI are added to the clipboard.
- Returns:
Each stock’s name, price, and stocks URI
- Return type:
list[Union[str, NSURL]]
New in version 0.0.8.