isyatirimhisse

repository·main·Indexed 41 days ago

https://github.com/urazakgul/isyatirimhisse

A Python library for scraping stock, index, and financial statement data from the İş Yatırım website. It provides functions such as fetch_stock_data, fetch_index_data, and fetch_financials to retrieve historical financial data and export results to Excel.

Tokens
1.1K
Snippets
6
Records
9
Agent score
50%

What's inside isyatirimhisse

  1. Best practices for symbols and indices

    main

    When using the library, follow these patterns for the symbols and indices parameters:

    • Multiple items: Always use a list with square brackets (e.g., ['THYAO', 'ASELS']) when requesting data for more than one ticker or index.
    • Single item: You can provide a single symbol directly as a string (e.g., 'THYAO').
  2. Best practices for handling multiple symbols

    main
    When requesting data for multiple stocks or indices, you must pass the symbols as a list (using square brackets []) rather than a single string. If you are only requesting a single symbol, you may pass it directly as a string.
  3. Usage warnings and rate limiting

    main

    Disclaimer

    isyatirimhisse is not an official library of Is Investment Securities Inc. and is designed for personal use only. Users must comply with Is Investment's terms of use.

    Avoiding IP Blocking and Service Disruption

    To prevent performance impacts, service interruptions, or IP blocking, follow these guidelines:

    • Maintain reasonable request speeds: Do not flood the website with excessive requests in a short period.
    • Cache data locally: Store frequently accessed data locally to minimize repetitive network requests.
  4. Install isyatirimhisse via pip

    main

    Install the latest version of the isyatirimhisse library using pip. You can also specify a particular version if needed.

    To check your currently installed version, use pip show isyatirimhisse.

    # Install latest version
    pip install isyatirimhisse
    
    # Install specific version
    pip install isyatirimhisse==5.0.1
    
    # Check installed version
    pip show isyatirimhisse
  5. Fetch index data with fetch_index_data

    main

    Use fetch_index_data to retrieve historical index data.

    Parameters:

    • indices (str | list): One or more index codes (e.g., "XU100").
    • start_date (str): Start date in 'DD-MM-YYYY' format.
    • end_date (str, optional): End date in 'DD-MM-YYYY' format.
    • save_to_excel (bool, optional): If True, saves the resulting DataFrame to an Excel file. Defaults to False.
    df = fetch_index_data(
        indices="XU100",
        start_date="01-01-2023",
        end_date="18-07-2025",
        save_to_excel=True
    )
  6. Fetch stock data with fetch_stock_data

    main

    Use fetch_stock_data to retrieve historical stock price data.

    Parameters:

    • symbols (str | list): One or more stock symbols (e.g., "THYAO" or ["THYAO", "ASELS"]).
    • start_date (str): Start date in 'DD-MM-YYYY' format.
    • end_date (str, optional): End date in 'DD-MM-YYYY' format.
    • save_to_excel (bool, optional): If True, saves the resulting DataFrame to an Excel file. Defaults to False.
    df = fetch_stock_data(
        symbols="THYAO",
        start_date="01-01-2023",
        end_date="18-07-2025",
        save_to_excel=True
    )
  7. Fetch financial statements with fetch_financials

    main

    Use fetch_financials to retrieve financial statement data for specific stocks.

    Parameters:

    • symbols (str | list): One or more stock symbols.
    • start_year (int | str): The starting year.
    • end_year (int | str, optional): The ending year.
    • exchange (str, optional): The currency type, either 'TRY' or 'USD'. Defaults to 'TRY'.
    • financial_group (str): The financial statement group identifier:
      • '1': XI_29
      • '2': UFRS
      • '3': UFRS_K
    • save_to_excel (bool, optional): If True, saves the results to an Excel file. Defaults to False.
    df = fetch_financials(
        symbols="THYAO",
        start_year=2023,
        end_year=2025,
        exchange="TRY",
        financial_group='1',
        save_to_excel=True
    )