Skip to main content

A new package is designed to analyze financial news headlines and extract key structured information such as company names, financial targets, timeframes, and goal updates from text inputs. It simplif

Project description

Financial-Parser

PyPI version License: MIT Downloads LinkedIn

Financial-Parser is a Python package designed to analyze financial news headlines and extract key structured information such as company names, financial targets, timeframes, and goal updates from text inputs. It simplifies monitoring market sentiment and tracking financial forecasts by processing pre-extracted textual data, providing clear, structured summaries that facilitate automated analysis and decision-making.

Features

  • Extracts structured information from financial news headlines.
  • Supports custom language models (LLMs) from LangChain.
  • Defaults to using ChatLLM7 from LangChain for ease of use.
  • Allows custom API keys for higher rate limits.

Installation

You can install the package using pip:

pip install financial_parser

Usage

Basic Usage

from financial_parser import financial_parser

user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
response = financial_parser(user_input)

print(response)

Using a Custom LLM

You can use a custom LLM from LangChain by passing it as an argument. For example, to use OpenAI:

from langchain_openai import ChatOpenAI
from financial_parser import financial_parser

llm = ChatOpenAI()
user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
response = financial_parser(user_input, llm=llm)

print(response)

Similarly, you can use other LLMs like Anthropic or Google:

from langchain_anthropic import ChatAnthropic
from financial_parser import financial_parser

llm = ChatAnthropic()
user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
response = financial_parser(user_input, llm=llm)

print(response)
from langchain_google_genai import ChatGoogleGenerativeAI
from financial_parser import financial_parser

llm = ChatGoogleGenerativeAI()
user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
response = financial_parser(user_input, llm=llm)

print(response)

Using a Custom API Key

You can provide a custom API key for higher rate limits:

from financial_parser import financial_parser

user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
api_key = "your_custom_api_key"
response = financial_parser(user_input, api_key=api_key)

print(response)

Or set the API key via an environment variable:

export LLM7_API_KEY="your_custom_api_key"

Then use the package without passing the API key:

from financial_parser import financial_parser

user_input = "Company XYZ announces Q4 earnings of $1.2 billion, up from $1.1 billion last year."
response = financial_parser(user_input)

print(response)

Input Parameters

  • user_input (str): The user input text to process.
  • llm (Optional[BaseChatModel]): The LangChain LLM instance to use. If not provided, the default ChatLLM7 will be used.
  • api_key (Optional[str]): The API key for LLM7. If not provided, the default API key will be used.

Default Rate Limits

The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits, you can pass your own API key via the environment variable LLM7_API_KEY or directly via the api_key parameter.

You can get a free API key by registering at LLM7 Token.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

financial_parser-2025.12.21115104.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

financial_parser-2025.12.21115104-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file financial_parser-2025.12.21115104.tar.gz.

File metadata

File hashes

Hashes for financial_parser-2025.12.21115104.tar.gz
Algorithm Hash digest
SHA256 aa7aed74fa068d5adaac366c9d01f2e683e935e8c20fc2a70c7978172ccb7477
MD5 82998772353aee42ea1e44a5f124d77c
BLAKE2b-256 1984cf7b6913290b16b56d6163bed6274c05f8f9a5c0de81f90ba80039fb5000

See more details on using hashes here.

File details

Details for the file financial_parser-2025.12.21115104-py3-none-any.whl.

File metadata

File hashes

Hashes for financial_parser-2025.12.21115104-py3-none-any.whl
Algorithm Hash digest
SHA256 12bac15959e611bd23e3ab17f75707f811bb12cd536d0b104f0886775e5e34ee
MD5 5b36a16c4173cfae72b859f6eb9ddd1c
BLAKE2b-256 a4ea74cdb8990ba325177be034342027de7e5a5e3564171f047b3e0f0713c1cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page