Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'2014-03-31', '2013-12-31', '2013-09-30', '2013-06-30', '2013-03-31', '2012-12-31',
'2012-09-30', '2012-06-30', '2012-03-31', '2011-12-31', '2011-09-30', '2011-06-30',
'2011-03-31', '2010-12-31', '2010-09-30', '2010-06-30', '2010-03-31', '2009-12-31',
'2009-09-30', '2009-06-30', '2009-03-31', '2008-12-31', '2008-09-30', '2008-06-30',
'2008-03-31', '2007-12-31', '2007-09-30', '2007-06-30', '2007-03-31', '2006-12-31',
'2006-09-30', '2006-06-30', '2006-03-31', '2005-12-31', '2005-09-30', '2005-06-30',
'2005-03-31', '2004-12-31', '2004-09-30', '2004-06-30', '2004-03-31', '2003-12-31',
'2003-09-30', '2003-06-30', '2003-03-31', '2002-12-31', '2002-09-30', '2002-06-30',
'2002-03-31', '2001-12-31', '2001-09-30', '2001-06-30', '2001-03-31', '2000-12-31',
'2000-06-30', '1999-12-31', '1999-06-30', '1998-12-31', '1998-06-30', '1997-12-31',
'1997-06-30', '1996-12-31', '1996-06-30', '1995-12-31', '1995-06-30', '1994-12-31',
'1994-06-30', '1993-12-31', '1993-06-30', '1992-12-31', '1991-12-31', '1990-12-31',
'1989-12-31']
result = fundamental.get_finance_factor(session=session, provider=Provider.EASTMONEY, return_type='domain',
codes=['000001'], end_timestamp='2018-09-30',
order=FinanceFactor.timestamp.desc())
assert len(correct_timestamps) == len(result)
timestamps = [to_time_str(item.timestamp) for item in result]
assert set(correct_timestamps) == set(timestamps)
latest: FinanceFactor = result[0]
assert latest.basic_eps == 1.14
assert latest.deducted_eps == 1.13
assert latest.diluted_eps == 1.14
assert latest.bps == 12.538
assert latest.capital_reserve_ps == 3.2886
assert latest.undistributed_profit_ps == 5.3566
assert latest.op_cash_flow_ps == -0.6587
assert latest.total_op_income == 86660000000
assert latest.net_profit == 20460000000
assert latest.deducted_net_profit == 20350000000
assert latest.op_income_growth_yoy == 0.0856
'2014-03-31', '2013-12-31', '2013-09-30', '2013-06-30', '2013-03-31', '2012-12-31',
'2012-09-30', '2012-06-30', '2012-03-31', '2011-12-31', '2011-09-30', '2011-06-30',
'2011-03-31', '2010-12-31', '2010-09-30', '2010-06-30', '2010-03-31', '2009-12-31',
'2009-09-30', '2009-06-30', '2009-03-31', '2008-12-31', '2008-09-30', '2008-06-30',
'2008-03-31', '2007-12-31', '2007-09-30', '2007-06-30', '2007-03-31', '2006-12-31',
'2006-09-30', '2006-06-30', '2006-03-31', '2005-12-31', '2005-09-30', '2005-06-30',
'2005-03-31', '2004-12-31', '2004-09-30', '2004-06-30', '2004-03-31', '2003-12-31',
'2003-09-30', '2003-06-30', '2003-03-31', '2002-12-31', '2002-09-30', '2002-06-30',
'2002-03-31', '2001-12-31', '2001-09-30', '2001-06-30', '2001-03-31', '2000-12-31',
'2000-06-30', '1999-12-31', '1999-06-30', '1998-12-31', '1998-06-30', '1997-12-31',
'1997-06-30', '1996-12-31', '1996-06-30', '1995-12-31', '1995-06-30', '1994-12-31',
'1994-06-30', '1993-12-31', '1993-06-30', '1992-12-31', '1991-12-31', '1990-12-31',
'1989-12-31']
result = get_finance_factor(session=session, provider='eastmoney', return_type='domain',
codes=['000001'], end_timestamp='2018-12-30',
order=FinanceFactor.report_date.desc(), time_field='report_date')
assert len(correct_timestamps) == len(result)
timestamps = [to_time_str(item.report_date) for item in result]
assert set(correct_timestamps) == set(timestamps)
latest: FinanceFactor = result[0]
assert latest.basic_eps == 1.14
assert latest.deducted_eps == 1.13
assert latest.diluted_eps == 1.14
assert latest.bps == 12.538
assert latest.capital_reserve_ps == 3.2886
assert latest.undistributed_profit_ps == 5.3566
assert latest.op_cash_flow_ps == -0.6587
assert latest.total_op_income == 86660000000
assert latest.net_profit == 20460000000
assert latest.deducted_net_profit == 20350000000
assert latest.op_income_growth_yoy == 0.0856
'2011-03-31', '2010-12-31', '2010-09-30', '2010-06-30', '2010-03-31', '2009-12-31',
'2009-09-30', '2009-06-30', '2009-03-31', '2008-12-31', '2008-09-30', '2008-06-30',
'2008-03-31', '2007-12-31', '2007-09-30', '2007-06-30', '2007-03-31', '2006-12-31',
'2006-09-30', '2006-06-30', '2006-03-31', '2005-12-31', '2005-09-30', '2005-06-30',
'2005-03-31', '2004-12-31', '2004-09-30', '2004-06-30', '2004-03-31', '2003-12-31',
'2003-09-30', '2003-06-30', '2003-03-31', '2002-12-31', '2002-09-30', '2002-06-30',
'2002-03-31', '2001-12-31', '2001-06-30', '2000-12-31', '2000-06-30', '1999-12-31',
'1999-06-30', '1998-12-31', '1998-06-30', '1997-12-31', '1997-06-30', '1996-12-31',
'1995-12-31', '1994-12-31']
result = get_finance_factor(session=session, provider='eastmoney', return_type='domain',
codes=['000778'], end_timestamp='2018-12-30',
order=FinanceFactor.report_date.desc(), time_field='report_date')
assert len(correct_timestamps) == len(result)
timestamps = [to_time_str(item.report_date) for item in result]
assert set(correct_timestamps) == set(timestamps)
latest: FinanceFactor = result[0]
assert latest.basic_eps == 0.4537
assert latest.diluted_eps == 0.4537
assert latest.bps == 5.0919
assert latest.capital_reserve_ps == 2.1769
assert latest.undistributed_profit_ps == 1.8132
assert latest.op_cash_flow_ps == 1.0148
assert latest.total_op_income == 31710000000
assert latest.gross_profit == 5491000000
assert latest.net_profit == 1811000000
assert latest.deducted_net_profit == 1897000000
assert latest.op_income_growth_yoy == -0.1024
assert latest.net_profit_growth_yoy == 1.2404
assert latest.deducted_net_profit_growth_yoy == 1.4813
assert latest.op_income_growth_qoq == 0.0408
assert latest.net_profit_growth_qoq == 0.2143
def test_meta_recorder():
recorder = ChinaStockMetaRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_1wk_kdata_recorder():
recorder = ChinaStockKdataRecorder(codes=SAMPLE_STOCK_CODES, sleeping_time=0, level=IntervalLevel.LEVEL_1WEEK,
real_time=False)
try:
recorder.run()
except:
assert False
def test_top_ten_tradable_holder_recorder():
recorder = TopTenTradableHolderRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_income_statement_recorder():
recorder = ChinaStockIncomeStatementRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_manager_trading_recorder():
recorder = ManagerTradingRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_dividend_detail():
recorder = DividendDetailRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_finance_factor_recorder():
recorder = ChinaStockFinanceFactorRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False