-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure vnquant project according modules
- Loading branch information
1 parent
f5f88c5
commit 7316e5b
Showing
13 changed files
with
419 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
# 1. Test data loader | ||
import vnquant.DataLoader as dl | ||
loader = dl.DataLoader('E1VFVN30', '2018-02-02','2018-04-02', data_source='VND', minimal=True) | ||
data = loader.download() | ||
print(data.head()) | ||
# # 1. Test data loader | ||
# import vnquant.data as dt | ||
# loader = dt.DataLoader('E1VFVN30', '2021-02-01','2021-04-02', data_source='VND', minimal=True) | ||
# data = loader.download() | ||
# print(data) | ||
|
||
# 2. Test clone finance | ||
# import vnquant.DataLoader as dl | ||
# loader = dl.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# # 2. Test clone finance | ||
# import vnquant.data as dt | ||
# loader = dt.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# data_business = loader.get_business_report() | ||
# print(data_business.head()) | ||
# data_business.head().to_html('data_business.html') | ||
|
||
# import vnquant.DataLoader as dl | ||
# loader = dl.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# import vnquant.data as dt | ||
# loader = dt.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# data_finan = loader.get_finan_report() | ||
# print(data_finan.head()) | ||
# data_finan.head().to_html('data_finan.html') | ||
|
||
|
||
# import vnquant.DataLoader as dl | ||
# loader = dl.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# import vnquant.data as dt | ||
# loader = dt.FinanceLoader('VND', '2019-06-02','2021-12-31', data_source='VND', minimal=True) | ||
# data_cash = loader.get_cashflow_report() | ||
# print(data_cash.head()) | ||
# data_cash.head().to_html('data_cashflow.html') | ||
|
||
# import vnquant.DataLoader as dl | ||
# loader = dl.FinanceLoader('VND', '2019-06-02','2020-12-31', data_source='VND', minimal=True) | ||
# import vnquant.data as dt | ||
# loader = dt.FinanceLoader('VND', '2019-06-02','2020-12-31', data_source='VND', minimal=True) | ||
# data_basic = loader.get_basic_index() | ||
# print(data_basic.head()) | ||
# data_basic.head().to_html('data_basic.html') | ||
# data_basic.head().to_html('data_basic.html') | ||
|
||
# import vnquant.plot as pl | ||
# pl._vnquant_candle_stick_source('VND', '2019-09-01', '2019-11-01', show_vol=False) | ||
|
||
# from vnquant import utils | ||
# print(utils._isOHLC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
__version__ = '0.0.3' | ||
# Copyright (c) general_backbone. All rights reserved. | ||
from .utils import * | ||
from .data import * | ||
from .plot import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (c) general_backbone. All rights reserved. | ||
__version__ = '0.0.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) general_backbone. All rights reserved. | ||
# from .configs import USER_AGENTS, URL_VND, URL_CAFE, HEADERS | ||
|
||
# Copyright (c) general_backbone. All rights reserved. | ||
# Can be used to randomize and rotate | ||
# Source(s): | ||
# - https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome | ||
|
||
USER_AGENTS = [ | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | ||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36", | ||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36", | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36" | ||
] | ||
|
||
# Config for DataLoader | ||
URL_VND = 'https://www.vndirect.com.vn/portal/thong-ke-thi-truong-chung-khoan/lich-su-gia.shtml' | ||
URL_CAFE = "http://s.cafef.vn/Lich-su-giao-dich-" | ||
HEADERS = {'content-type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla'} | ||
|
||
__all__ = [ | ||
'USER_AGENTS', 'URL_VND', 'URL_CAFE', 'HEADERS' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) general_backbone. All rights reserved. | ||
# Can be used to randomize and rotate | ||
# Source(s): | ||
# - https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome | ||
|
||
USER_AGENTS = [ | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | ||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36", | ||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36", | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36", | ||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (c) general_backbone. All rights reserved. | ||
from .dataloader import * | ||
from .finance import * | ||
__all__ = [ | ||
'DataLoader', 'FinanceLoader' | ||
] |
Oops, something went wrong.