jin10.py


Overview

The jin10.py module provides an interface to access various Jin10 financial data APIs within the InfiniFlow system. Jin10 is a popular financial data provider specializing in real-time market flash news, economic calendars, symbols information, and financial news. This module defines a component (Jin10) and its parameter class (Jin10Param) to fetch and process such data, encapsulating the API communication and response formatting.

The primary purpose of this file is to enable seamless integration of Jin10 data into the InfiniFlow agent framework, allowing downstream components or workflows to utilize Jin10's market insights programmatically.


Classes and Functions

Class: Jin10Param

class Jin10Param(ComponentParamBase)

Description:
Defines and validates configuration parameters for the Jin10 component. These parameters control which type of Jin10 data to fetch and how to filter or categorize it.

Properties (Attributes)

Property

Type

Default

Description

type

str

"flash"

The type of Jin10 data to retrieve. Allowed values: 'flash', 'calendar', 'symbols', 'news'.

secret_key

str

"xxx"

API secret key to authorize requests to Jin10.

flash_type

str

'1'

Category for flash news. Allowed values: '1', '2', '3', '4', '5'.

calendar_type

str

'cj'

Economic calendar region/type. Allowed: 'cj' (China), 'qh' (Futures), 'hk' (Hong Kong), 'us' (United States).

calendar_datatype

str

'data'

Type of calendar data. Allowed: 'data', 'event', 'holiday'.

symbols_type

str

'GOODS'

Symbol category. Allowed: 'GOODS', 'FOREX', 'FUTURE', 'CRYPTO'.

symbols_datatype

str

'symbols'

Type of symbols data. Allowed: 'symbols', 'quotes'.

contain

str

""

Filter parameter to contain specific keywords in results (used in flash/news API calls).

filter

str

""

Additional filter parameter for API queries, e.g., to filter flash/news items.

Methods

Usage Example

param = Jin10Param()
param.type = "calendar"
param.calendar_type = "us"
param.calendar_datatype = "holiday"
param.check()  # Validates parameters before use

Class: Jin10

class Jin10(ComponentBase, ABC)

Description:
Implements the Jin10 data fetching component. This class uses the parameters defined in Jin10Param to query the Jin10 API endpoints and process the responses into pandas DataFrame or text outputs formatted for the InfiniFlow agent system.

Class Attributes

Methods

Parameters

Returns

Usage Example

jin10_component = Jin10()
jin10_component._param = Jin10Param()
jin10_component._param.type = "flash"
jin10_component._param.flash_type = "3"
jin10_component._param.secret_key = "your_secret_key"
result_df_or_str = jin10_component._run(history=None)
print(result_df_or_str)

Implementation Details and Algorithms


Interaction with Other System Components


Visual Diagram

classDiagram
    class Jin10Param {
        +type: str
        +secret_key: str
        +flash_type: str
        +calendar_type: str
        +calendar_datatype: str
        +symbols_type: str
        +symbols_datatype: str
        +contain: str
        +filter: str
        +check()
    }

    class Jin10 {
        +component_name: str
        +_run(history, **kwargs)
        -_param: Jin10Param
        +get_input()
        +be_output(data)
    }

    Jin10 ..> Jin10Param : uses
    Jin10 --> ComponentBase
    Jin10Param --> ComponentParamBase

Summary

The jin10.py file encapsulates Jin10 financial data API access into an InfiniFlow agent component. It abstracts away API details, parameter validation, and data formatting to present clean, ready-to-use financial data such as flash market news, economic calendars, symbols information, and news items. This modular design ensures maintainability and extensibility while providing critical market insights to the broader InfiniFlow ecosystem.