Skip to main content

DNS Insight Extractor

PyPI version License: MIT Downloads LinkedIn

A Python package for extracting structured insights from text-based content related to DNS blocking reports and network filtering incidents. This tool processes unstructured text to identify key information such as blocked domains, reasons for blocking, and contextual details (e.g., geographic or policy-related), enabling analysts to quickly derive actionable insights without manual parsing.


📦 Installation

Install the package via pip:

pip install dns_insight_extractor

🚀 Features

  • Extracts structured data from DNS blocking reports and network filtering descriptions.
  • Supports pattern matching and validation to ensure consistent output.
  • Uses LLM7 as the default language model (via langchain_llm7).
  • Highly customizable—swap the default LLM for alternatives like OpenAI, Anthropic, or Google Generative AI.
  • Environment-variable-friendly for API keys.

📝 Usage

Basic Usage (Default LLM: LLM7)

from dns_insight_extractor import dns_insight_extractor

# Example: Extract insights from a DNS blocking report
user_input = """
The following domains are blocked due to adult content:
- example.com
- porn-site.org
Reason: Policy violation (Section 3.2 of the network guidelines).
"""

response = dns_insight_extractor(user_input)
print(response)

Custom LLM Integration

You can replace the default ChatLLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google Generative AI):

Using OpenAI:

from langchain_openai import ChatOpenAI
from dns_insight_extractor import dns_insight_extractor

llm = ChatOpenAI()
response = dns_insight_extractor(user_input, llm=llm)

Using Anthropic:

from langchain_anthropic import ChatAnthropic
from dns_insight_extractor import dns_insight_extractor

llm = ChatAnthropic()
response = dns_insight_extractor(user_input, llm=llm)

Using Google Generative AI:

from langchain_google_genai import ChatGoogleGenerativeAI
from dns_insight_extractor import dns_insight_extractor

llm = ChatGoogleGenerativeAI()
response = dns_insight_extractor(user_input, llm=llm)

🔧 Parameters

Parameter Type Description
user_input str The unstructured text containing DNS blocking or filtering details.
api_key Optional[str] API key for LLM7 (default: fetched from os.getenv("LLM7_API_KEY")).
llm Optional[BaseChatModel] Custom LangChain LLM instance (e.g., ChatOpenAI, ChatAnthropic). If omitted, defaults to ChatLLM7.

🔑 API Key Setup

Default (LLM7 Free Tier)

  • The package uses LLM7 by default.
  • Free tier rate limits are sufficient for most use cases.
  • To use your own API key:
    export LLM7_API_KEY="your_api_key_here"
    
    Or pass it directly:
    response = dns_insight_extractor(user_input, api_key="your_api_key")
    

Get an LLM7 API Key

Sign up for free at: https://token.llm7.io/


📚 Documentation & Support


🛠️ License

MIT License (see LICENSE for details).


Metadata

Release files for dns-insight-extractor 2025.12.21174113

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

Source distribution (sdist)

Source distribution for dns-insight-extractor 2025.12.21174113
File Size Uploaded
dns_insight_extractor-2025.12.21174113.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dns-insight-extractor 2025.12.21174113
File Interpreter ABI Platform
dns_insight_extractor-2025.12.21174113-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / dns_insight_extractor-2025.12.21174113.tar.gz

Download URL dns_insight_extractor-2025.12.21174113.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c49e56b486dc46579d03c9b3cdac05fb9b29799d5497c50310add88b377f5f56
BLAKE2b-256 checksum
How to use checksums
59ea2ef3869dc41c2fa15bb25b36de05212953b1b42470cae80cbe6d3f462810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / dns_insight_extractor-2025.12.21174113-py3-none-any.whl

Download URL dns_insight_extractor-2025.12.21174113-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
712b30ed0ef3c0c571e1bc49236760a29f708b8e6740e4f1a7fcf245f25b26d7
BLAKE2b-256 checksum
How to use checksums
9b0199f2936269335533fae0dd1b358e6182f7f6a9a5f438e564c1878140f86f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

2025.12.21174113 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