- Updated dataset.
- Fixed a bug in parsing market_state. (#7)
- Improved type hints.
- The dataset now includes
isin
andcisin
columns. - Added
Instrument.from_isin
method. - Improved type hints.
- Removed
dataste.LazyDS.l18_l130
method.
- Improved type hints.
- Updated dataset.
- Migrated functions of
docs
module to the new tsetmc API. yval
column inmarket_watch
is now of typestring
instead ofint16
.ins_code
column inmajor_holders_activity
is now of typestring
instead ofint64
.- Dependency on
bs4
package was removed.
- BREAKING: All ETF/fund related functions were moved from
general
tofunds
module.
- Fixed: ImportError in instruments module
- New function:
tsetmc.general.get_funds
. - New function:
tsetmc.general.commodity_funds
. - New function:
tsetmc.general.etfs
. - New function:
tsetmc.general.messages
. - New function:
tsetmc.general.search_messages
. - Changed!: The
n
parameter ofgeneral.market_overview
function was renamed toflow
and is now keyword-only. - Removed!:
market_watch.messages
. The underlying API was not working anymore. Usetsetmc.general.messages
instead which uses the new JSON API. - Fixed: Errors due to bad server redirects in
general.boards
,general.cs_codes
, andgeneral.industrial_groups_overview
. - Deprecated:
general.industrial_groups_overview
; usegeneral.sectors_summary
instead. - Updated dataset
- Automatically handle
ServerDisconnectedError
by retrying.
Instrument.daily_closing_price()
now has index set to date column.docs.client_type()
will not set first as column name for output.
- Fixed incompatible dtype FutureWarning in
market_watch_plus
.
- The default value of
n
forInstrument.daily_closing_price
is now0
instead of9
. Meaning that complete history will be fetched instead of just the last 9 days. - Updated dataset
- Fixed handling of 23-column data in market_watch_plus.
- Some type hints (Subclasses of TypedDict) are now publicly exposed.
- Minimum Python requirement is now 3.12.
- Fixed a new deprecation warning in pandas 2.2.0.
- Update API url. (http now redirects to https)
- Updated dataset
- Fixed a deprecation warning in reading html tables.
- Updated dataset
- BREAKING CHANGE: Require pyarrow and pandas >= 2.1.0 and use pyarrow string dtype in pandas. Also
pandas.options.future.infer_string = True
. - BREAKING CHANGE: The
ins_code
column ofgeneral.industrial_groups_overview()
is now of string type. (prviously it was int64) - BREAKING CHANGE:
Instrument.live_data
will now include atimestamp
key instead ofdatetime
. The oldtimestamp
key is renamed totime
. - Fixed a logging bug in market_watch_plus causing exception in rare occasions.
- The result of
general.market_overview
now includesmarketActivityTimestamp
which is a combination ofmarketActivityDEven
andmarketActivityHEven
. - Added optional
df
parameter todataset.update
. - Updated dataset
- BREAKING CHANGE:
cs
column inmarket_watch_init
andmarket_watch_plus
now is of string type instead of numeric. - BREAKING CHANGE: The return values of callback functions in
MarketWatch
are now ignored. Users are supposed to cancel the running task instead of controlling the loop via the return values. - BREAKING CHANGE: The
code
column of dataset is renamed back toins_code
. This name is more compatible with other existing functions. - Fixed a bug in
dataset.update()
. - Updated dataset
- BREAKING CHANGE: new argument for
market_watch_plus
:best_limits_prepare_join
. To retain the old behaviour call this function withbest_limits_prepare_join=False
. - Fixed occasional type-casting bug in
market_watch_plus
. - Added easy-to-use default callbacks for
MarketWatch
class.
- BREAKING CHANGE: Pandas v2.0+ is required and
pd.options.mode.copy_on_write
is set to true. - BREAKING CHANGE: Index of
daily_closing_price
is now set to normalized form of datetime (not including time, just date). Adatetime
column added which includes the last transaction time.
- BREAKING CHANGE:
tsetmc
will now manage the session internally. There is no need to manually create a session anymore.tsetmc.Session
andtsetmc.SESSION
have been removed.
MarketWatch.start
will now retrymarket_watch_init
upon failure.- New public class:
tsetmc.dataset.LazyDS
.
- BREAKING CHANGE:
market_watch
will now usestring
as the dtype forins_code
index. - BREAKING CHANGE:
market_state
dict will now always includetse_value
andtse_index_change_percent
keys. The value will beNone
if not available. - BREAKING CHANGE: Use
ins_code
as the index forprice
andnew_prices
DataFrames inmarket_watch_init
andmarket_watch_plus
. Previously, the index was a MultiIndex of['ins_code', 'isin', 'l18', 'l30']
. - BREAKING CHANGE:
share_holder_id
parameter ofshare_holder_companies
is now positional-only. - Fixed a bug in parsing
market_state
during pre-market. - Updated dataset
- BREAKING CHANGE:
Instrument.related_companies
now adds aninstrument.
prefix to instrument related column names. - Added new function:
general.related_companies
- Added a new module:
indices
- Add type hints for
Instrument.info
- Updated dataset
- BREAKING CHANGE:
Instrument.share_holder_history
now returns aDataFrame
instead of a list.
- BREAKING CHANGE: the output type of
insturments.search
function has changed from DataFrame to a list of dicts. Useold_search
if you want to continue using the old format. - BREAKING CHANGE: renamed the
c_sec_val
parameter ofInstrument.related_companies
tocs
. - BREAKING CHANGE: The DataFrame result of
Instrument.daily_closing_price()
now has datetime index instead ofdEven
andhEven
columns. - BREAKING CHANGE:
Instrument.codal()
now returns a list of dicts instead of a DataFrame. - Added new async property:
Instrument.cs
- Added new async function:
general.market_overview()
- Added new async method:
Instrument.identity()
- Added new async method:
Instrument.price_adjustments()
- Added new async method:
Instrument.publisher()
- Added new async method:
Instrument.share_holders()
- Added new async method:
Instrument.share_holder_history()
- Added new async method:
Instrument.messages()
- Added new async function:
instruments.share_holder_companies()
- Improved type annotations
- Deprecated the following methods which rely on the old tsetmc site and have new alternatives:
Instrument.live_data
. See the docstring for alternatives.Instrument.page_data
. See the docstring for alternatives.Instrument.client_type_history_old
. UseInstrument.client_type_history
instead.Instrument.identification
. UseInstrument.identity
instead.Insturment.trade_history
. UseInstrument.daily_closing_price
instead.Insturment.adjustments
. UseInstrument.price_adjustments
instead.Insturment.introduction
. UseInstrument.publisher
instead.Insturment.holders
. UseInstrument.share_holders
instead.Insturment.holder
. UseInstrument.share_holder_history
orshare_holder_companies
instead.Insturment.ombud_messages
. UseInstrument.messages
instead.
InstrumentOnDate.client_types
is deprecated, useInstrument.client_type
instead- Updated dataset
- Fixed an unneeded URL redirect in
Instrument.price_history
- Fixed URL mismatch warning during web requests.
- BREAKING CHANGE: Renamed
Instrument.client_type
toclient_type_history_old
. The old name is overwritten with a new method. - Removed the broken
Instrument.intraday()
method. This method is not available in the new design of tsetmc.com. Use Instrument.on_date instead. - Fixed
market_watch_plus
by allowingfloat64
dtype on po and pd columns. - Added the following methods to
Instrument
class:info()
trades()
codal()
daily_closing_price()
closing_price_info()
best_limits()
client_type()
etf()
related_companies()
- Added a quick fix for the new design of tsetmc.com by using old.tsetmc.com domain. Some modules are still failing in tests and should wait for the next released.
- Avoid unsigned data-types in returned values. This should help with some overflow bugs when user is not careful.
- Updated dataset
- Increased default socket timeouts to 30s
- Fixed
market_map_data
(the result has changed due to tsetmc API changes) - Updated dataset
- Fixed some deprecation warning during update
- Updated dataset
- Fixed market_watch issue with newly defined columns
- Fixed some deprecation/future warnings
- Increased default timeout from 5 to 10 seconds
- Updated dataset
- Breaking: renamed the database module to dataset
- feat(_parse_price_info): handle invalid nav_datetime
- fixed: Use fake user-agent for API requests due to a new restriction from server.
- fixed a bug in
Instrument.live_data
- feat!: removed the 1-connection-per-host limit. However, users should note that
InstrumentOnDate
(Instrument.on_date
) methods are rate-limited and avoid making simultaneous calls. - feat(docs): a new (and incomplete) module to fetch parsed documentation data
- feat(Instrument.__hash__): handle
numpy.int64
Instrument.code
- fix(Session): Do not inherit from
aiohttp.ClientSession
(deprecated by aiohttp). - feat(Session): use TCPConnector(limit_per_host=1, keepalive_timeout=120.)
- feat(Instrument.trade_history): add new param:
all_=False
- feat(Instrument.client_type_history): new method
- feat(Instrument.on_date): new method returning an
InstrumentOnDate
object which has the following methods:closing_price
closing_price_history
states
client_types
holders
best_limits
trades
static_thresholds
data
- BREAKING CHANGE: Make the framework async.
- feat(general.top_industry_groups): new method
- fixed: type annotation of
Instrument.live_data
- feat(Instrument.dps_history): new method
- feat!: migrate from urllib3 to httpx
- feat(Instrument.holders)!: use english column names and numerize the change column
- feat!: migrate from requests to urllib3
- fix(live_data)!: handle empty string in market state
- fix(major_holders_activity): handle empty-valued cells
- Fixed
market_watch.status_changes
.
- feat(setup.cfg)!: require pandas 1.4.0+
- feat(market_watch.ombud_messages)!: make all params keyword-only
- feat(market_watch.ombud_messages): new params:
containing
andsh_date
- feat(database)!: cs 69 and flow 3 were removed from offline database
- feat(Instrument): add
introduction
method - feat(Instrument): add
ombud_messages
method - feat(general): new module containing the following functions:
boards
cs_codes
industrial_groups
market_map_data
major_holders_activity
- fix(setup.cfg)!:
beautifulsoup4
andlxml
are now required as dependencies - fix(ombud_messages)!: return empty DataFrame for empty result set