Skip to content

Commit

Permalink
1)Add cbond(Convertible) 2)Improve tag
Browse files Browse the repository at this point in the history
  • Loading branch information
foolcage committed Jul 3, 2024
1 parent 30db5e7 commit 6934445
Show file tree
Hide file tree
Showing 189 changed files with 508 additions and 79 deletions.
5 changes: 5 additions & 0 deletions api-tests/event/get_stock_event.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GET http://127.0.0.1:8090/api/event/get_stock_event?entity_id=stock_sz_000034
accept: application/json



3 changes: 3 additions & 0 deletions src/zvt/autocode/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ def gen_exports(
end_empty_lines_count = end_empty_lines_count + 1
lines = lines[: len(lines) - end_empty_lines_count]

if not lines:
lines.append("# -*- coding: utf-8 -*-#")

lines.append("\n\n")
lines.append(gen_flag)
lines.append("\n")
Expand Down
4 changes: 4 additions & 0 deletions src/zvt/contract/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ class TradableType(Enum):
#: A股(中国)
#: China stock
stock = "stock"
#: 可转债(中国)
#: China convertible Bond
cbond = "cbond"
#: A股指数(中国)
#: China index
index = "index"
Expand Down Expand Up @@ -239,6 +242,7 @@ class Exchange(Enum):
TradableType.block: [Exchange.cn],
TradableType.index: [Exchange.sh, Exchange.sz],
TradableType.stock: [Exchange.sh, Exchange.sz, Exchange.bj],
TradableType.cbond: [Exchange.sh, Exchange.sz],
TradableType.stockhk: [Exchange.hk],
TradableType.stockus: [Exchange.nasdaq, Exchange.nyse],
TradableType.indexus: [Exchange.us],
Expand Down
2 changes: 2 additions & 0 deletions src/zvt/domain/actor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
2 changes: 2 additions & 0 deletions src/zvt/domain/actor/actor_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ class ActorMeta(ActorMetaBase, ActorEntity):


register_schema(providers=["em"], db_name="actor_meta", schema_base=ActorMetaBase)


# the __all__ is generated
__all__ = ["ActorMeta"]
1 change: 1 addition & 0 deletions src/zvt/domain/actor/stock_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ class StockActorSummary(StockActorBase, TradableMeetActor):

register_schema(providers=["em"], db_name="stock_actor", schema_base=StockActorBase, entity_type="stock")


# the __all__ is generated
__all__ = ["StockTopTenFreeHolder", "StockTopTenHolder", "StockInstitutionalInvestorHolder", "StockActorSummary"]
2 changes: 2 additions & 0 deletions src/zvt/domain/emotion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
2 changes: 2 additions & 0 deletions src/zvt/domain/emotion/emotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ class Emotion(EmotionBase, Mixin):


register_schema(providers=["jqka"], db_name="emotion", schema_base=EmotionBase)


# the __all__ is generated
__all__ = ["LimitUpInfo", "LimitDownInfo", "Emotion"]
2 changes: 2 additions & 0 deletions src/zvt/domain/fundamental/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/fundamental/dividend_financing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ class RightsIssueDetail(DividendFinancingBase, Mixin):
providers=["eastmoney"], db_name="dividend_financing", schema_base=DividendFinancingBase, entity_type="stock"
)


# the __all__ is generated
__all__ = ["DividendFinancing", "DividendDetail", "SpoDetail", "RightsIssueDetail"]
1 change: 1 addition & 0 deletions src/zvt/domain/fundamental/finance.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,5 +985,6 @@ def important_cols(cls):

register_schema(providers=["eastmoney"], db_name="finance", schema_base=FinanceBase, entity_type="stock")


# the __all__ is generated
__all__ = ["BalanceSheet", "IncomeStatement", "CashFlowStatement", "FinanceFactor"]
1 change: 1 addition & 0 deletions src/zvt/domain/fundamental/trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,6 @@ class DragonAndTiger(TradingBase, Mixin):
providers=["em", "eastmoney", "joinquant"], db_name="trading", schema_base=TradingBase, entity_type="stock"
)


# the __all__ is generated
__all__ = ["ManagerTrading", "HolderTrading", "BigDealTrading", "MarginTrading", "DragonAndTiger"]
1 change: 1 addition & 0 deletions src/zvt/domain/fundamental/valuation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ class EtfValuation(ValuationBase, Mixin):

register_schema(providers=["joinquant"], db_name="valuation", schema_base=ValuationBase, entity_type="stock")


# the __all__ is generated
__all__ = ["StockValuation", "EtfValuation"]
2 changes: 2 additions & 0 deletions src/zvt/domain/macro/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
2 changes: 2 additions & 0 deletions src/zvt/domain/macro/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ class Economy(MacroBase, Mixin):


register_schema(providers=["wb"], db_name="macro", schema_base=MacroBase)


# the __all__ is generated
__all__ = ["Economy"]
2 changes: 2 additions & 0 deletions src/zvt/domain/macro/monetary.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ class TreasuryYield(MonetaryBase, Mixin):


register_schema(providers=["em"], db_name="monetary", schema_base=MonetaryBase)


# the __all__ is generated
__all__ = ["TreasuryYield"]
8 changes: 8 additions & 0 deletions src/zvt/domain/meta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-#

# the __all__ is generated
__all__ = []

Expand Down Expand Up @@ -29,6 +31,12 @@

__all__ += _country_meta_all

# import all from submodule cbond_meta
from .cbond_meta import *
from .cbond_meta import __all__ as _cbond_meta_all

__all__ += _cbond_meta_all

# import all from submodule index_meta
from .index_meta import *
from .index_meta import __all__ as _index_meta_all
Expand Down
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/block_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ class BlockStock(BlockMetaBase, PortfolioStock):


register_schema(providers=["em", "eastmoney", "sina"], db_name="block_meta", schema_base=BlockMetaBase)


# the __all__ is generated
__all__ = ["Block", "BlockStock"]
21 changes: 21 additions & 0 deletions src/zvt/domain/meta/cbond_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-

from sqlalchemy.orm import declarative_base

from zvt.contract import TradableEntity
from zvt.contract.register import register_schema, register_entity

CBondBase = declarative_base()


#: 美股
@register_entity(entity_type="cbond")
class CBond(CBondBase, TradableEntity):
__tablename__ = "cbond"


register_schema(providers=["em"], db_name="cbond_meta", schema_base=CBondBase)


# the __all__ is generated
__all__ = ["CBond"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/country_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ class Country(CountryMetaBase, TradableEntity):


register_schema(providers=["wb"], db_name="country_meta", schema_base=CountryMetaBase)


# the __all__ is generated
__all__ = ["Country"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/currency_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ class Currency(CurrencyMetaBase, TradableEntity):


register_schema(providers=["em"], db_name="currency_meta", schema_base=CurrencyMetaBase)


# the __all__ is generated
__all__ = ["Currency"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/etf_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ class EtfStock(EtfMetaBase, PortfolioStockHistory):


register_schema(providers=["exchange", "joinquant"], db_name="etf_meta", schema_base=EtfMetaBase)


# the __all__ is generated
__all__ = ["Etf", "EtfStock"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/fund_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ class FundStock(FundMetaBase, PortfolioStockHistory):


register_schema(providers=["joinquant"], db_name="fund_meta", schema_base=FundMetaBase)


# the __all__ is generated
__all__ = ["Fund", "FundStock"]
1 change: 1 addition & 0 deletions src/zvt/domain/meta/future_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Future(FutureMetaBase, TradableEntity):

register_schema(providers=["em"], db_name="future_meta", schema_base=FutureMetaBase)


# the __all__ is generated
__all__ = ["Future"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/index_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ class IndexStock(IndexMetaBase, PortfolioStockHistory):


register_schema(providers=["em", "exchange"], db_name="index_meta", schema_base=IndexMetaBase)


# the __all__ is generated
__all__ = ["Index", "IndexStock"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/indexus_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ class Indexus(IndexusMetaBase, Portfolio):


register_schema(providers=["em"], db_name="indexus_meta", schema_base=IndexusMetaBase)


# the __all__ is generated
__all__ = ["Indexus"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/stock_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ class StockDetail(StockMetaBase, TradableEntity):
register_schema(
providers=["exchange", "joinquant", "eastmoney", "em", "qmt"], db_name="stock_meta", schema_base=StockMetaBase
)


# the __all__ is generated
__all__ = ["Stock", "StockDetail"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/stockhk_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ class Stockhk(StockhkMetaBase, TradableEntity):


register_schema(providers=["em"], db_name="stockhk_meta", schema_base=StockhkMetaBase)


# the __all__ is generated
__all__ = ["Stockhk"]
2 changes: 2 additions & 0 deletions src/zvt/domain/meta/stockus_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ class Stockus(StockusMetaBase, TradableEntity):


register_schema(providers=["em"], db_name="stockus_meta", schema_base=StockusMetaBase)


# the __all__ is generated
__all__ = ["Stockus"]
2 changes: 2 additions & 0 deletions src/zvt/domain/misc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/misc/holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ class InstitutionalInvestorHolder(HolderBase, Mixin):

register_schema(providers=["eastmoney", "joinquant"], db_name="holder", schema_base=HolderBase, entity_type="stock")


# the __all__ is generated
__all__ = ["HkHolder", "TopTenTradableHolder", "TopTenHolder", "InstitutionalInvestorHolder"]
1 change: 1 addition & 0 deletions src/zvt/domain/misc/money_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ class IndexMoneyFlow(MoneyFlowBase, Mixin):

register_schema(providers=["joinquant", "sina"], db_name="money_flow", schema_base=MoneyFlowBase, entity_type="stock")


# the __all__ is generated
__all__ = ["BlockMoneyFlow", "StockMoneyFlow", "IndexMoneyFlow"]
1 change: 1 addition & 0 deletions src/zvt/domain/misc/overall.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ class CrossMarketSummary(OverallBase, Mixin):

register_schema(providers=["joinquant", "exchange"], db_name="overall", schema_base=OverallBase, entity_type="stock")


# the __all__ is generated
__all__ = ["StockSummary", "MarginTradingSummary", "CrossMarketSummary"]
2 changes: 2 additions & 0 deletions src/zvt/domain/misc/stock_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ class StockNews(NewsBase, Mixin):


register_schema(providers=["em"], db_name="stock_news", schema_base=NewsBase, entity_type="stock")


# the __all__ is generated
__all__ = ["StockNews"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/block/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# this file is generated by gen_kdata_schema function, dont't change it


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/block/block_1d_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Block1dKdata(KdataBase, BlockKdataCommon):

register_schema(providers=["em"], db_name="block_1d_kdata", schema_base=KdataBase, entity_type="block")


# the __all__ is generated
__all__ = ["Block1dKdata"]
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/block/block_1mon_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Block1monKdata(KdataBase, BlockKdataCommon):

register_schema(providers=["em"], db_name="block_1mon_kdata", schema_base=KdataBase, entity_type="block")


# the __all__ is generated
__all__ = ["Block1monKdata"]
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/block/block_1wk_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Block1wkKdata(KdataBase, BlockKdataCommon):

register_schema(providers=["em"], db_name="block_1wk_kdata", schema_base=KdataBase, entity_type="block")


# the __all__ is generated
__all__ = ["Block1wkKdata"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/currency/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/currency/currency_1d_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Currency1dKdata(KdataBase, CurrencyKdataCommon):

register_schema(providers=["em"], db_name="currency_1d_kdata", schema_base=KdataBase, entity_type="currency")


# the __all__ is generated
__all__ = ["Currency1dKdata"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/etf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# this file is generated by gen_kdata_schema function, dont't change it


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/etf/etf_1d_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Etf1dKdata(KdataBase, EtfKdataCommon):

register_schema(providers=["sina"], db_name="etf_1d_kdata", schema_base=KdataBase, entity_type="etf")


# the __all__ is generated
__all__ = ["Etf1dKdata"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/future/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/future/future_1d_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Future1dKdata(KdataBase, FutureKdataCommon):

register_schema(providers=["em"], db_name="future_1d_kdata", schema_base=KdataBase, entity_type="future")


# the __all__ is generated
__all__ = ["Future1dKdata"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/index/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# this file is generated by gen_kdata_schema function, dont't change it


# the __all__ is generated
__all__ = []

Expand Down
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/index/index_1d_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Index1dKdata(KdataBase, IndexKdataCommon):

register_schema(providers=["em", "sina"], db_name="index_1d_kdata", schema_base=KdataBase, entity_type="index")


# the __all__ is generated
__all__ = ["Index1dKdata"]
1 change: 1 addition & 0 deletions src/zvt/domain/quotes/index/index_1wk_kdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class Index1wkKdata(KdataBase, IndexKdataCommon):

register_schema(providers=["em", "sina"], db_name="index_1wk_kdata", schema_base=KdataBase, entity_type="index")


# the __all__ is generated
__all__ = ["Index1wkKdata"]
2 changes: 2 additions & 0 deletions src/zvt/domain/quotes/indexus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-


# the __all__ is generated
__all__ = []

Expand Down
Loading

0 comments on commit 6934445

Please sign in to comment.