🚀
Finter
PlaygroundData Catalogue
Quick Start
Quick Start
  • Getting Started with Finter: A Quick Guide
  • Explore Finter
    • Finter Labs (Recommended)
    • Other Ways
      • Google Colab
      • Conda, venv, or Docker
      • Setting Up a .env File (Optional)
  • Framework
    • CM (Content Model)
    • AM (Alpha Model)
    • PM (Portfolio Model)
    • Simulatior
      • Target Volume Limit
    • Finter Cli Submission
      • Validation
      • GitHub Sync
      • [Legacy] JupyterLab Submission
      • [Legacy] Submission
  • MODELING
    • MetaPortfolio
      • Equal weight meta portfolio
      • Fixed weight meta portfolio
      • Risk parity meta portfolio
    • StrategicAssetAllocation
    • DateConverter
    • BuyHoldConverter
  • Supporting Tools
    • FileManager
    • Finter AI (alpha ver.)
    • Data
      • FinHelper
        • filter_unchanged
        • unify_idx
        • shift_fundamental
        • rolling
        • expand_to_gvkeyiid
      • ModelData
      • ID Table
      • ID Converter
      • Quanda Data
    • Evaluator
      • top_n_assets
      • bottom_n_assets
      • compare_with_bm
    • PortfolioAnalyzer
    • Email
Powered by GitBook
On this page
  • Content Factory (Data)
  • Import & Initialize
  • Navigate data list
  • Get Specific Content Model (CM)
  • Get CM with full CM name
  • Get trading days by universe
  • Enhancing Performance with Cache

Was this helpful?

Edit on GitHub
  1. Framework

CM (Content Model)

The Quickest Way to Access Financial Data

Content Factory (Data)

Import & Initialize

from finter.data import ContentFactory

# For stock data
content_factory = ContentFactory(
    universe_name="kr_stock", start=20230101, end=20230131
)

Navigate data list

# Explore available data (ipywidgets needed)
content_factory.show()

# Available Data with list
content_factory.item_list

Get Specific Content Model (CM)

# Get Content Model (data)
df = content_factory.get_df('price_close')

Get CM with full CM name

from finter.data import ContentFactory

# For using with full cm name
content_factory = ContentFactory(universe_name="raw", 20230101, 20230131)

df = content_factory.get_df('content.fnguide.ftp.price_volume.price_close.1d')

Get trading days by universe

To retrieve trading days for a specific universe, you can use the trading_days attribute. For the "raw" universe, this will return all calendar days.

# Retrieve trading days
trading_days = content_factory.trading_days

Enhancing Performance with Cache

To improve the performance of ContentFactory repeated data retrieval, you can utilize the cache_timeout parameter.


content_factory = ContentFactory(
    universe_name,
    20230101,
    20230131,
    cache_timeout=600, # Set cache timeout to 10 minutes (600 seconds)
    cache_maxsize=10, # Maximum number of items to store
)

Last updated 8 months ago

Was this helpful?