Skip to main content

fintextract

PyPI version License: MIT Downloads LinkedIn

fintextract is a lightweight Python package that extracts and structures key financial and business insights from unstructured news text.
Give it a raw news sentence and receive a clear, machine‑readable summary containing:

  • Subject – the main person or organization
  • Key figures – monetary amounts, percentages, etc.
  • Significant event – the core business event described

Designed for financial analysts, business reporters, and investors who need to quickly parse breaking news.


Features

  • One‑function API (fintextract) that returns a list of extracted data items.
  • Built‑in default LLM: ChatLLM7 (via the langchain_llm7 integration).
  • Seamless integration with any LangChain‑compatible LLM (OpenAI, Anthropic, Google, …).
  • Simple regex‑based output validation ensures the response matches the expected pattern.

Installation

pip install fintextract

Quick Start

from fintextract import fintextract

news = "Elon Musk becomes first person worth $700B following pay package ruling."

result = fintextract(user_input=news)

print(result)
# Example output:
# ['Subject: Elon Musk', 'Key figure: $700B', 'Event: pay package ruling']

API Reference

def fintextract(
    user_input: str,
    api_key: Optional[str] = None,
    llm: Optional[BaseChatModel] = None,
) -> List[str]:
Parameter Type Description
user_input str The raw news text you want to analyze.
api_key Optional[str] API key for ChatLLM7. If omitted, the function reads LLM7_API_KEY from the environment.
llm Optional[BaseChatModel] A LangChain LLM instance. If not provided, the default ChatLLM7 is instantiated automatically.

The function returns a list of strings that match the pre‑defined output pattern (subject, key figure, event).


Using a Custom LLM

If you prefer another language model, simply pass a LangChain LLM instance:

OpenAI

from langchain_openai import ChatOpenAI
from fintextract import fintextract

llm = ChatOpenAI()
response = fintextract(user_input="Your news text", llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from fintextract import fintextract

llm = ChatAnthropic()
response = fintextract(user_input="Your news text", llm=llm)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from fintextract import fintextract

llm = ChatGoogleGenerativeAI()
response = fintextract(user_input="Your news text", llm=llm)

Any LangChain‑compatible BaseChatModel can be used in the same way.


API Key & Rate Limits

  • ChatLLM7 (the default) uses the free tier rate limits, which are sufficient for typical usage.
  • To obtain a free API key, register at https://token.llm7.io/.
  • Set the key via the environment variable LLM7_API_KEY or pass it directly:
response = fintextract(user_input="Your news text", api_key="YOUR_API_KEY")

If higher limits are needed, upgrade your LLM7 plan accordingly.


Contributing

Contributions, bug reports, and feature requests are welcome!
Please open an issue or submit a pull request on GitHub:

Issues: https://github.com/chigwell/fintextract/issues

Pull Requests: https://github.com/chigwell/fintextract/pulls


License

This project is licensed under the MIT License.


Author

Eugene Evstafev – hi@euegne.plus
GitHub: chigwell


Acknowledgements


Happy extracting!

Release files for fintextract 2025.12.21122420

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fintextract 2025.12.21122420
File Size Uploaded
fintextract-2025.12.21122420.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fintextract 2025.12.21122420
File Interpreter ABI Platform
fintextract-2025.12.21122420-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / fintextract-2025.12.21122420.tar.gz

Download URL fintextract-2025.12.21122420.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2f9f9dabe6f00456fb4b6f110178e2d57f8ba949c4bb7c85a4af767eae168683
BLAKE2b-256 checksum
How to use checksums
a6241463e1fdcb12a2ee8f09aa6028812835fa2aac2e4d8e1a651e86c97460ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / fintextract-2025.12.21122420-py3-none-any.whl

Download URL fintextract-2025.12.21122420-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eba7fa1ee05e0be7727f7a76b6663d7231f0f2d999a4250ee860bcc9e332b9f7
BLAKE2b-256 checksum
How to use checksums
7de999a7d93f8d7da0157c7a027479aa95cd05b1d2c8eab8a172617e58a1debd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

2025.12.21122420 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page