Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
f2b502b7
Commit
f2b502b7
authored
Sep 05, 2020
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEATURE: remove fund data
parent
3dd21da6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
80 deletions
+0
-80
models.py
alphamind/data/dbmodel/models.py
+0
-59
sqlengine.py
alphamind/data/engines/sqlengine.py
+0
-21
No files found.
alphamind/data/dbmodel/models.py
View file @
f2b502b7
...
@@ -12,65 +12,6 @@ Base = declarative_base()
...
@@ -12,65 +12,6 @@ Base = declarative_base()
metadata
=
Base
.
metadata
metadata
=
Base
.
metadata
class
FundHolding
(
Base
):
__tablename__
=
'fund_holding'
fund_code
=
Column
(
String
(
15
),
primary_key
=
True
,
nullable
=
False
)
ticker
=
Column
(
String
(
15
),
nullable
=
False
)
short_name
=
Column
(
String
(
30
),
nullable
=
False
)
reportDate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
holdingsecType
=
Column
(
String
(
5
),
nullable
=
False
)
holdingSecID
=
Column
(
String
(
15
),
primary_key
=
True
,
nullable
=
False
)
holdingTicker
=
Column
(
String
(
15
),
nullable
=
False
)
holdingExchangeCd
=
Column
(
String
(
5
))
holdingsecShortName
=
Column
(
String
(
30
))
holdVolume
=
Column
(
Float
(
53
))
marketValue
=
Column
(
Float
(
53
))
ratioInNa
=
Column
(
Float
(
53
))
publishDate
=
Column
(
DateTime
,
nullable
=
False
)
currencyCd
=
Column
(
String
(
5
))
class
FundMaster
(
Base
):
__tablename__
=
'fund_master'
fund_code
=
Column
(
String
(
15
),
primary_key
=
True
)
ticker
=
Column
(
String
(
15
),
nullable
=
False
)
short_name
=
Column
(
String
(
30
),
nullable
=
False
)
tradeAbbrName
=
Column
(
String
(
20
))
category
=
Column
(
String
(
5
),
nullable
=
False
)
operationMode
=
Column
(
String
(
5
))
indexFund
=
Column
(
String
(
5
))
etfLof
=
Column
(
String
(
5
))
isQdii
=
Column
(
Integer
,
nullable
=
False
)
isFof
=
Column
(
Integer
,
nullable
=
False
)
isGuarFund
=
Column
(
Integer
,
nullable
=
False
)
guarPeriod
=
Column
(
Float
(
53
))
guarRatio
=
Column
(
Float
(
53
))
exchangeCd
=
Column
(
String
(
4
))
listStatusCd
=
Column
(
String
(
4
))
managerName
=
Column
(
String
(
50
))
status
=
Column
(
String
(
5
))
establishDate
=
Column
(
DateTime
)
listDate
=
Column
(
DateTime
)
delistDate
=
Column
(
DateTime
)
expireDate
=
Column
(
DateTime
)
managementCompany
=
Column
(
BigInteger
)
managementFullName
=
Column
(
String
(
50
))
custodian
=
Column
(
BigInteger
)
custodianFullName
=
Column
(
String
(
50
))
investField
=
Column
(
Text
)
investTarget
=
Column
(
Text
)
perfBenchmark
=
Column
(
Text
)
circulationShares
=
Column
(
Float
(
53
))
isClass
=
Column
(
Integer
)
idxID
=
Column
(
String
(
15
))
idxTicker
=
Column
(
String
(
15
))
idxShortName
=
Column
(
String
(
30
))
managementShortName
=
Column
(
String
(
30
))
custodianShortName
=
Column
(
String
(
30
))
class
Categories
(
Base
):
class
Categories
(
Base
):
__tablename__
=
'categories'
__tablename__
=
'categories'
__table_args__
=
(
__table_args__
=
(
...
...
alphamind/data/engines/sqlengine.py
View file @
f2b502b7
...
@@ -19,8 +19,6 @@ from sqlalchemy import select, and_, outerjoin, join, column
...
@@ -19,8 +19,6 @@ from sqlalchemy import select, and_, outerjoin, join, column
from
sqlalchemy.sql
import
func
from
sqlalchemy.sql
import
func
from
alphamind.data.dbmodel.models
import
FactorMaster
from
alphamind.data.dbmodel.models
import
FactorMaster
from
alphamind.data.dbmodel.models
import
FundHolding
from
alphamind.data.dbmodel.models
import
FundMaster
from
alphamind.data.dbmodel.models
import
IndexComponent
from
alphamind.data.dbmodel.models
import
IndexComponent
from
alphamind.data.dbmodel.models
import
IndexMarket
from
alphamind.data.dbmodel.models
import
IndexMarket
from
alphamind.data.dbmodel.models
import
Industry
from
alphamind.data.dbmodel.models
import
Industry
...
@@ -112,25 +110,6 @@ class SqlEngine(object):
...
@@ -112,25 +110,6 @@ class SqlEngine(object):
db_session
=
orm
.
sessionmaker
(
bind
=
self
.
engine
)
db_session
=
orm
.
sessionmaker
(
bind
=
self
.
engine
)
return
db_session
()
return
db_session
()
def
fetch_fund_meta
(
self
)
->
pd
.
DataFrame
:
query
=
self
.
session
.
query
(
FundMaster
)
return
pd
.
read_sql
(
query
.
statement
,
query
.
session
.
bind
)
def
fetch_fund_holding
(
self
,
fund_codes
,
start_date
:
str
=
None
,
end_date
:
str
=
None
,
dates
:
Iterable
[
str
]
=
None
)
->
pd
.
DataFrame
:
query
=
select
([
FundHolding
])
.
where
(
and_
(
FundHolding
.
fund_code
.
in_
(
fund_codes
),
FundHolding
.
reportDate
.
in_
(
dates
)
if
dates
else
FundHolding
.
reportDate
.
between
(
start_date
,
end_date
)
)
)
return
pd
.
read_sql
(
query
,
self
.
session
.
bind
)
def
fetch_factors_meta
(
self
)
->
pd
.
DataFrame
:
def
fetch_factors_meta
(
self
)
->
pd
.
DataFrame
:
query
=
self
.
session
.
query
(
FactorMaster
)
query
=
self
.
session
.
query
(
FactorMaster
)
return
pd
.
read_sql
(
query
.
statement
,
query
.
session
.
bind
)
return
pd
.
read_sql
(
query
.
statement
,
query
.
session
.
bind
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment