Skip to main content

av-safety-parser extracts aviation incident details from unstructured text, outputting standardized data on incident type, aircraft, and risks.

Project description

av-safety-parser

PyPI version License: MIT Downloads LinkedIn

A lightweight Python package for extracting and structuring aviation safety information from unstructured text.
It parses texts such as FAA warnings and news articles to return key details (incident type, affected aircraft, safety risks, etc.) in a consistent format.

Features

  • Simple API that takes raw text and returns structured data.
  • Uses the default ChatLLM7 model from langchain_llm7 for inference.
  • Fully compatible with any LangChain LLM implementation (OpenAI, Anthropic, Google Gemini, etc.) by passing a custom instance.
  • Supports API-key configuration via environment variable or explicit parameter.

Installation

pip install av_safety_parser

Quick Example

from av_safety_parser import av_safety_parser

user_input = """
FAA publishes new warning on rotor blade vibrations in twin‑prop aircraft.
There were several incidents where the vibrations caused structural fatigue.
"""

# Using the default ChatLLM7
results = av_safety_parser(user_input)
print(results)

You can also pass a custom LLM instance:

# Example with OpenAI's ChatOpenAI
from langchain_openai import ChatOpenAI
from av_safety_parser import av_safety_parser

llm = ChatOpenAI()
results = av_safety_parser(user_input, llm=llm)
print(results)
# Example with Anthropic's ChatAnthropic
from langchain_anthropic import ChatAnthropic
from av_safety_parser import av_safety_parser

llm = ChatAnthropic()
results = av_safety_parser(user_input, llm=llm)
print(results)
# Example with Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from av_safety_parser import av_safety_parser

llm = ChatGoogleGenerativeAI()
results = av_safety_parser(user_input, llm=llm)
print(results)

Parameters

Parameter Type Description
user_input str Raw text to parse.
llm Optional[BaseChatModel] LangChain LLM instance. If omitted, ChatLLM7 will be used automatically.
api_key Optional[str] API key for LLM7. If not provided, the library will look for the LLM7_API_KEY environment variable.

Default Rate Limits
The free tier of LLM7 offers enough rate limits for most use cases. If you require higher limits, pass your own api_key either through av_safety_parser(user_input, api_key="your_key") or by setting LLM7_API_KEY in your environment.

Getting an LLM7 API Key

  1. Sign up at https://token.llm7.io/
  2. Retrieve your API token
  3. Set it as an environment variable:
    export LLM7_API_KEY="your_token_here"
    

Issue Tracker

If you encounter any problems or have feature requests, please open an issue at:
https://github.com/chigwell/av-safety-parser/issues

Author

Enjoy using av-safety-parser to keep aviation data clear and consistent!

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

av_safety_parser-2025.12.21191556.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

av_safety_parser-2025.12.21191556-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file av_safety_parser-2025.12.21191556.tar.gz.

File metadata

File hashes

Hashes for av_safety_parser-2025.12.21191556.tar.gz
Algorithm Hash digest
SHA256 fa05fab4da9f68f06ef53e09986a0e07bc03af50c4492810cf222c54f5fd5e6d
MD5 8efea05134bfc9fbeb62fba11f1af246
BLAKE2b-256 61c3a462e422fa3c4ebd2e6e0dfc2978b2595d81fda9553636bae9449f2aa335

See more details on using hashes here.

File details

Details for the file av_safety_parser-2025.12.21191556-py3-none-any.whl.

File metadata

File hashes

Hashes for av_safety_parser-2025.12.21191556-py3-none-any.whl
Algorithm Hash digest
SHA256 ca6cee7d573800bf4a0b1bf4bc8ea05e166efab13c492132cb2c0200cf11132f
MD5 5d235144193fbb099c95ddc2eacfba20
BLAKE2b-256 32f724a2b4ccb1ecf8ad49539e284159c95bb0d87b6c2eb0291c18d84329f80e

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