Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

file str update

12tilak34735f873b0b87
diff --git a/.gitignore b/.gitignore
index 709bd34ec..ee34a62a7 100644
Binary files a/.gitignore and b/.gitignore differ
diff --git a/examples/advance_technical.ipynb b/examples/advance_technical.ipynb
deleted file mode 100644
index d60c0f366..000000000
--- a/examples/advance_technical.ipynb
+++ /dev/null
@@ -1,100 +0,0 @@
-{
- "nbformat": 4,
- "nbformat_minor": 0,
- "metadata": {
- "colab": {
- "provenance": []
- },
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python"
- }
- },
- "cells": [
- {
- "cell_type": "code",
- "source": [
- "# Import necessary modules from fincept_terminal\n",
- "from fincept_terminal.advanced_technicals import fetch_stock_data, calculate_stage_analysis, calculate_camarilla_levels"
- ],
- "metadata": {
- "id": "hz57fwHHmu4L"
- },
- "execution_count": null,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "# Step 1: Fetch Stock Data\n",
- "stock_symbol = \"AAPL\" # Example stock symbol\n",
- "period = \"1y\" # Timeframe for fetching data\n",
- "\n",
- "print(f\"[bold cyan]Fetching stock data for: {stock_symbol}[/bold cyan]\")\n",
- "stock_data = fetch_stock_data(stock_symbol, period)"
- ],
- "metadata": {
- "id": "1wKWuJZXm-Fe"
- },
- "execution_count": null,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "print(\"[bold green]Stock data fetched successfully![/bold green]\")\n",
- "print(stock_data.head()) # Show a sample of the fetched data"
- ],
- "metadata": {
- "id": "iErzBjDKnKrr"
- },
- "execution_count": null,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "# Step 2: Perform Stage Analysis\n",
- "print(\"\\n[bold cyan]Performing Stage Analysis[/bold cyan]\")\n",
- "stage_analysis_results = calculate_stage_analysis(stock_data)\n",
- "for key, value in stage_analysis_results.items():\n",
- " print(f\"{key}: {value}\")"
- ],
- "metadata": {
- "id": "qCCBPu0FnON9"
- },
- "execution_count": null,
- "outputs": []
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "9Ak40-rEM2S4",
- "outputId": "0839a78f-3b0e-4424-88e7-f5f6fd509f60"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Data for all stations at 09:00:00 have been saved to 'gauge_station_data_9am.xlsx'\n"
- ]
- }
- ],
- "source": [
- "# Step 3: Calculate Camarilla Levels\n",
- "print(\"\\n[bold cyan]Calculating Camarilla Pivot Points[/bold cyan]\")\n",
- "camarilla_levels = calculate_camarilla_levels(stock_data)\n",
- "for level, value in camarilla_levels.items():\n",
- " print(f\"{level}: {value}\")"
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/consumer_behavior_demo.ipynb b/examples/consumer_behavior_demo.ipynb
deleted file mode 100644
index d75ea023a..000000000
--- a/examples/consumer_behavior_demo.ipynb
+++ /dev/null
@@ -1,210 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "3937e9a3",
- "metadata": {},
- "source": [
- "\n",
- "# Demonstrating the Consumer Behavior Insights Module\n",
- "\n",
- "This notebook demonstrates how to use the functions provided in the `fincept_terminal` library to fetch research papers, analyze content, and generate consumer behavior insights.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "a7170d3f",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Import necessary functions from the module\n",
- "from fincept_terminal.consumer_behavior import (\n",
- " fetch_research_papers,\n",
- " consolidate_paper_content,\n",
- " generate_summary_report,\n",
- " extract_facts_dynamically,\n",
- " enhance_summary_with_facts,\n",
- " display_summary_report,\n",
- " ask_questions_on_content\n",
- ")\n",
- "from rich.console import Console\n",
- "from rich.panel import Panel\n",
- "\n",
- "# Initialize a console for styled output\n",
- "console = Console()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "20a04f0a",
- "metadata": {},
- "source": [
- "\n",
- "## Step 1: Fetch Research Papers\n",
- "\n",
- "Use the `fetch_research_papers` function to retrieve a list of papers related to consumer behavior in a specific city.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "30a2477c",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Fetch research papers for a city\n",
- "city = \"New York\"\n",
- "console.print(Panel(f\"Fetching research papers for [bold cyan]{city}[/bold cyan]\"))\n",
- "papers = fetch_research_papers(city, max_papers=5)\n",
- "\n",
- "if papers:\n",
- " console.print(f\"[bold green]Fetched {len(papers)} papers successfully![/bold green]\")\n",
- " for idx, paper in enumerate(papers, start=1):\n",
- " console.print(f\"{idx}. {paper['title']} - {paper['url']}\")\n",
- "else:\n",
- " console.print(f\"[bold red]No research papers found for {city}.[/bold red]\")\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "7f4c9e31",
- "metadata": {},
- "source": [
- "\n",
- "## Step 2: Consolidate Paper Content\n",
- "\n",
- "Use the `consolidate_paper_content` function to fetch and combine content from the retrieved papers.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "04fbec95",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "if papers:\n",
- " console.print(Panel(\"[bold cyan]Consolidating content from fetched papers...[/bold cyan]\"))\n",
- " combined_content = consolidate_paper_content(papers)\n",
- " if combined_content.strip():\n",
- " console.print(\"[bold green]Content consolidated successfully![/bold green]\")\n",
- " console.print(combined_content[:500] + \"...\") # Display first 500 characters\n",
- " else:\n",
- " console.print(\"[bold red]No accessible content found in the papers.[/bold red]\")\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "aa82a9e2",
- "metadata": {},
- "source": [
- "\n",
- "## Step 3: Generate Summary Report\n",
- "\n",
- "Use the `generate_summary_report` function to create a structured report from the consolidated content.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "ef410c2f",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "if papers and combined_content.strip():\n",
- " console.print(Panel(\"[bold cyan]Generating summary report...[/bold cyan]\"))\n",
- " summary_report = generate_summary_report(combined_content)\n",
- " if summary_report:\n",
- " console.print(\"[bold green]Summary report generated successfully![/bold green]\")\n",
- " console.print(summary_report[:500] + \"...\") # Display first 500 characters\n",
- " else:\n",
- " console.print(\"[bold red]Failed to generate summary report.[/bold red]\")\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "284abfcd",
- "metadata": {},
- "source": [
- "\n",
- "## Step 4: Extract Additional Facts\n",
- "\n",
- "Use the `extract_facts_dynamically` function to extract key facts (percentages, sample sizes, etc.) from the content.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "d825254b",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "if papers and combined_content.strip():\n",
- " console.print(Panel(\"[bold cyan]Extracting key facts from the content...[/bold cyan]\"))\n",
- " facts = extract_facts_dynamically(combined_content)\n",
- " console.print(f\"[bold green]Extracted {len(facts)} key facts successfully![/bold green]\")\n",
- " for fact in facts:\n",
- " console.print(f\" - {fact}\")\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "05badbd4",
- "metadata": {},
- "source": [
- "\n",
- "## Step 5: Enhance and Display the Summary Report\n",
- "\n",
- "Use the `enhance_summary_with_facts` function to embed extracted facts into the report and then display it using `display_summary_report`.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "6b6d73ed",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "if papers and combined_content.strip() and summary_report:\n",
- " console.print(Panel(\"[bold cyan]Enhancing summary report with extracted facts...[/bold cyan]\"))\n",
- " enhanced_summary = enhance_summary_with_facts(summary_report, facts)\n",
- " console.print(\"[bold green]Enhanced summary report generated successfully![/bold green]\")\n",
- " display_summary_report(enhanced_summary)\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "e5fe821b",
- "metadata": {},
- "source": [
- "\n",
- "## Step 6: Ask Questions on the Content\n",
- "\n",
- "Use the `ask_questions_on_content` function to allow users to ask specific questions about the research content.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "aa734e97",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "if papers and combined_content.strip():\n",
- " console.print(Panel(\"[bold cyan]You can now ask specific questions about the research content.[/bold cyan]\"))\n",
- " ask_questions_on_content(combined_content)\n"
- ]
- }
- ],
- "metadata": {},
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/examples/news_sentiment_demo.ipynb b/examples/news_sentiment_demo.ipynb
deleted file mode 100644
index d9658aeb9..000000000
--- a/examples/news_sentiment_demo.ipynb
+++ /dev/null
@@ -1,163 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "152336b2",
- "metadata": {},
- "source": [
- "\n",
- "# Demonstrating the Global News and Sentiment Analysis Module\n",
- "\n",
- "This notebook demonstrates how to use the functions provided in the `fincept_terminal` library for fetching news, analyzing sentiment, and displaying results interactively.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "033ec79d",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Import necessary functions from the module\n",
- "from fincept_terminal.global_news import (\n",
- " fetch_and_display_news,\n",
- " fetch_custom_news,\n",
- " display_sentiment_bar\n",
- ")\n",
- "from rich.console import Console\n",
- "\n",
- "# Initialize a console for styled output\n",
- "console = Console()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "dd26e984",
- "metadata": {},
- "source": [
- "\n",
- "## Step 1: Fetch News and Analyze Sentiment\n",
- "\n",
- "Use the `fetch_and_display_news` function to fetch news articles for a specific country and topic, and analyze the sentiment of the headlines.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "9502af5f",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Fetch and display news for a specific country and topic\n",
- "country = \"United States\"\n",
- "topic = \"Business\"\n",
- "\n",
- "console.print(f\"[bold cyan]Fetching news for {topic} in {country}...[/bold cyan]\")\n",
- "fetch_and_display_news(country, topic)\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "785a0a33",
- "metadata": {},
- "source": [
- "\n",
- "## Step 2: Fetch Custom News Based on a Query\n",
- "\n",
- "Use the `fetch_custom_news` function to search for news articles based on a custom keyword query and display the sentiment analysis results.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "b0cd4d70",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Fetch custom news based on a query\n",
- "query = \"Artificial Intelligence\"\n",
- "country = \"United Kingdom\"\n",
- "\n",
- "console.print(f\"[bold cyan]Fetching custom news for query: {query} in {country}...[/bold cyan]\")\n",
- "fetch_custom_news(query, country)\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "e8d75548",
- "metadata": {},
- "source": [
- "\n",
- "## Step 3: Display Sentiment Analysis Summary\n",
- "\n",
- "Use the `display_sentiment_bar` function to display the sentiment analysis results as an ASCII bar chart.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "e0702f86",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Example sentiment counts\n",
- "positive_count = 15\n",
- "neutral_count = 5\n",
- "negative_count = 3\n",
- "\n",
- "console.print(\"[bold cyan]Displaying sentiment analysis bar chart...[/bold cyan]\")\n",
- "display_sentiment_bar(positive_count, neutral_count, negative_count)\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "125ade87",
- "metadata": {},
- "source": [
- "\n",
- "## Step 4: Interactive News Menu\n",
- "\n",
- "Use the `show_news_and_sentiment_menu` function for an interactive menu to fetch global news and analyze sentiment by continent and country.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "12651078",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Interactive menu for news and sentiment analysis\n",
- "from fincept_terminal.global_news import show_news_and_sentiment_menu\n",
- "\n",
- "console.print(\"[bold cyan]Launching interactive news and sentiment menu...[/bold cyan]\")\n",
- "show_news_and_sentiment_menu()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "e330ca79",
- "metadata": {},
- "source": [
- "\n",
- "## Summary\n",
- "\n",
- "This notebook demonstrated how to:\n",
- "1. Fetch and display news articles by country and topic using `fetch_and_display_news`.\n",
- "2. Fetch custom news articles based on a query using `fetch_custom_news`.\n",
- "3. Analyze and display sentiment results using `display_sentiment_bar`.\n",
- "4. Use the interactive menu for news and sentiment analysis with `show_news_and_sentiment_menu`.\n",
- "\n",
- "You can modify the `country`, `topic`, and `query` parameters to explore more news and sentiment analysis cases.\n"
- ]
- }
- ],
- "metadata": {},
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/examples/world_economy_tracker_demo.ipynb b/examples/world_economy_tracker_demo.ipynb
deleted file mode 100644
index b5aa4bd68..000000000
--- a/examples/world_economy_tracker_demo.ipynb
+++ /dev/null
@@ -1,166 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "1cba4b7e",
- "metadata": {},
- "source": [
- "\n",
- "# Demonstrating the World Economy Tracker Module\n",
- "\n",
- "This notebook demonstrates how to use the functions provided in the `fincept_terminal` library to fetch country data, query FRED data, and perform ARIMA analysis.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "78b73745",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Import necessary functions from the module\n",
- "from fincept_terminal.world_economy import (\n",
- " show_world_economy_tracker_menu,\n",
- " show_list_of_countries,\n",
- " search_by_index,\n",
- " query_fred_data,\n",
- " arima_analysis\n",
- ")\n",
- "from rich.console import Console\n",
- "\n",
- "# Initialize a console for styled output\n",
- "console = Console()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "b53b844c",
- "metadata": {},
- "source": [
- "\n",
- "## Step 1: Display List of Countries\n",
- "\n",
- "Use the `show_list_of_countries` function to display all available countries in the World Economy Tracker.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "db57c91b",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Display list of countries\n",
- "console.print(\"[bold cyan]Fetching list of countries...[/bold cyan]\")\n",
- "show_list_of_countries()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "87f4779f",
- "metadata": {},
- "source": [
- "\n",
- "## Step 2: Search for Economic Data by Index\n",
- "\n",
- "Use the `search_by_index` function to search for and display economic data by specific indices.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "fe2e64c9",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Search and display economic data by index\n",
- "console.print(\"[bold cyan]Searching for economic data by index...[/bold cyan]\")\n",
- "search_by_index()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "645e2a99",
- "metadata": {},
- "source": [
- "\n",
- "## Step 3: Query FRED Data\n",
- "\n",
- "Use the `query_fred_data` function to query data from the FRED API and optionally perform ARIMA analysis on the retrieved data.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "9f5baca6",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Query data from FRED API\n",
- "console.print(\"[bold cyan]Querying FRED data...[/bold cyan]\")\n",
- "query_fred_data()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "6c77dbc5",
- "metadata": {},
- "source": [
- "\n",
- "## Step 4: Perform ARIMA Analysis\n",
- "\n",
- "The `arima_analysis` function is used internally after querying FRED data. It allows users to perform ARIMA modeling on the data and view forecasts.\n",
- "\n",
- "For demonstration, this step is integrated into the FRED data query process.\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "3d511599",
- "metadata": {},
- "source": [
- "\n",
- "## Step 5: Interactive Menu\n",
- "\n",
- "Use the `show_world_economy_tracker_menu` function for an interactive menu to explore all features of the World Economy Tracker.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "850bacbe",
- "metadata": {},
- "outputs": [],
- "source": [
- "\n",
- "# Launch the interactive World Economy Tracker menu\n",
- "console.print(\"[bold cyan]Launching World Economy Tracker menu...[/bold cyan]\")\n",
- "show_world_economy_tracker_menu()\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "bcca9ca1",
- "metadata": {},
- "source": [
- "\n",
- "## Summary\n",
- "\n",
- "This notebook demonstrated how to:\n",
- "1. Display a list of countries using `show_list_of_countries`.\n",
- "2. Search for economic data by index using `search_by_index`.\n",
- "3. Query FRED data using `query_fred_data` and perform ARIMA analysis.\n",
- "4. Use an interactive menu for exploring all World Economy Tracker features.\n",
- "\n",
- "You can use the interactive menu or individual functions to explore the module's capabilities further.\n"
- ]
- }
- ],
- "metadata": {},
- "nbformat": 4,
- "nbformat_minor": 5
-}