Skip to content

Commit

Permalink
travis
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanqi committed Mar 1, 2018
1 parent 92b4619 commit 1994480
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: python
python:
- "3.5"
virtualenv:
system_site_packages: true
script: pytest
4 changes: 2 additions & 2 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ curl -XPOST 'localhost:9200/income_statement/doc/_search?pretty&filter_path=hits
"disposalLossOnNonCurrentLiability": 9.01E8,
"incomeFromChangesInFairValue": -2.56E8,
"incomeTaxExpense": 2.2E7,
"OperatingTotalCosts": 3.4139E11,
"operatingTotalCosts": 3.4139E11,
"assetsDevaluation": 8.75E8,
"EPS": 1.9449E10,
"OperatingCosts": 9.4E7,
"operatingCosts": 9.4E7,
"attributableToOwnersOfParentCompany": 1.58E8,
"ManagingCosts": 6.402E10,
"totalProfits": 8.403E9,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ curl -XPOST 'localhost:9200/income_statement/doc/_search?pretty&filter_path=hits
"disposalLossOnNonCurrentLiability": 9.01E8,
"incomeFromChangesInFairValue": -2.56E8,
"incomeTaxExpense": 2.2E7,
"OperatingTotalCosts": 3.4139E11,
"operatingTotalCosts": 3.4139E11,
"assetsDevaluation": 8.75E8,
"EPS": 1.9449E10,
"OperatingCosts": 9.4E7,
"operatingCosts": 9.4E7,
"attributableToOwnersOfParentCompany": 1.58E8,
"ManagingCosts": 6.402E10,
"totalProfits": 8.403E9,
Expand Down
4 changes: 2 additions & 2 deletions docs/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ class IncomeStatement(BaseDocType):
# 营业收入
operatingRevenue = Float()
# /*营业总成本*/
OperatingTotalCosts = Float()
operatingTotalCosts = Float()
# 营业成本
OperatingCosts = Float()
operatingCosts = Float()
# 营业税金及附加
businessTaxesAndSurcharges = Float()
# 销售费用
Expand Down
15 changes: 9 additions & 6 deletions fooltrader/api/finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ def get_income_statement_items(security_item, start_date=None, report_period=Non
# 营业收入
operatingRevenue = lines[2].split()[1:-1]
# /*营业总成本*/
OperatingTotalCosts = lines[4].split()[1:-1]
operatingTotalCosts = lines[4].split()[1:-1]
# 营业成本
OperatingCosts = lines[5].split()[1:-1]
operatingCosts = lines[5].split()[1:-1]
# 营业税金及附加
businessTaxesAndSurcharges = lines[6].split()[1:-1]
# 销售费用
Expand Down Expand Up @@ -504,9 +504,9 @@ def get_income_statement_items(security_item, start_date=None, report_period=Non
# 营业收入
"operatingRevenue": to_float(operatingRevenue[idx]),
# /*营业总成本*/
"OperatingTotalCosts": to_float(OperatingTotalCosts[idx]),
"operatingTotalCosts": to_float(operatingTotalCosts[idx]),
# 营业成本
"OperatingCosts": to_float(OperatingCosts[idx]),
"operatingCosts": to_float(operatingCosts[idx]),
# 营业税金及附加
"businessTaxesAndSurcharges": to_float(businessTaxesAndSurcharges[idx]),
# 销售费用
Expand Down Expand Up @@ -937,8 +937,11 @@ def get_finance_summary_items(security_item, start_date=None, report_period=None


if __name__ == '__main__':
print(get_cash_flow_statement_items(
SecurityItem(type='stock', code='000338', exchange='sz', id='stock_sz_000338'), report_event_date='20170930'))
print(get_income_statement_items(
SecurityItem(type='stock', code='300027', exchange='sz', id='stock_sz_300027')))
#
# print(get_cash_flow_statement_items(
# SecurityItem(type='stock', code='000338', exchange='sz', id='stock_sz_000338'), report_event_date='20170930'))
# print(get_balance_sheet_items(
# SecurityItem(type='stock', code='000338', exchange='sz', id='stock_sz_000338'), report_event_date='20170930'))
# print(get_income_statement_items(
Expand Down
8 changes: 4 additions & 4 deletions fooltrader/datamanager/datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ def crawl_stock_quote(start_code=STOCK_START_CODE, end_code=STOCK_END_CODE, craw

if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--start_code', default='000338', help='the stock start code to be crawled')
parser.add_argument('-e', '--end_code', default='000338', help='the stock end code to be crawled')
parser.add_argument('-s', '--start_code', default='300027', help='the stock start code to be crawled')
parser.add_argument('-e', '--end_code', default='300027', help='the stock end code to be crawled')

args = parser.parse_args()

# crawl_stock_meta()
# crawl_index_quote()
# crawl_stock_quote(args.start_code, args.end_code)
# crawl_finance_data(args.start_code, args.end_code)
crawl_usa_stock_data()
crawl_finance_data(args.start_code, args.end_code)
# crawl_usa_stock_data()
4 changes: 2 additions & 2 deletions fooltrader/domain/finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ class IncomeStatement(BaseDocType):
# 营业收入
operatingRevenue = Float()
# /*营业总成本*/
OperatingTotalCosts = Float()
operatingTotalCosts = Float()
# 营业成本
OperatingCosts = Float()
operatingCosts = Float()
# 营业税金及附加
businessTaxesAndSurcharges = Float()
# 销售费用
Expand Down

0 comments on commit 1994480

Please sign in to comment.