pybroker.ext.data module

Contains extension classes.

class AKShare(adjust: str | None = '', timeframe: str | None = '1d')[source]

Bases: DataSource

Retrieves data from AKShare.

Parameters:
  • adjust – The type of adjustment to make.

  • timeframe – Timeframe of the data to query.

query(symbols: str | Iterable[str], start_date: str | datetime, end_date: str | datetime, timeframe: str | None = '1d', adjust: str | None = '') DataFrame[source]

Queries data from AKShare. The timeframe of the data is limited to per daily, weekly and monthly.

Parameters:
  • symbols – Ticker symbols of the data to query.

  • start_date – Start date of the data to query (inclusive).

  • end_date – End date of the data to query (inclusive).

  • timeframe – Timeframe of the data to query.

  • adjust – The type of adjustment to make.

Returns:

pandas.DataFrame containing the queried data.