av-safety-parser
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
ChatLLM7model fromlangchain_llm7for 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 ownapi_keyeither throughav_safety_parser(user_input, api_key="your_key")or by settingLLM7_API_KEYin your environment.
Getting an LLM7 API Key
- Sign up at https://token.llm7.io/
- Retrieve your API token
- 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
- Name: Eugene Evstafev
- GitHub: @chigwell
- Email: hi@euge.ne.plus
Enjoy using av-safety-parser to keep aviation data clear and consistent!
Metadata
Release files for av-safety-parser 2025.12.21191556
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| av_safety_parser-2025.12.21191556.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| av_safety_parser-2025.12.21191556-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / av_safety_parser-2025.12.21191556.tar.gz
| Download URL | av_safety_parser-2025.12.21191556.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa05fab4da9f68f06ef53e09986a0e07bc03af50c4492810cf222c54f5fd5e6d
|
|
BLAKE2b-256 checksum How to use checksums |
61c3a462e422fa3c4ebd2e6e0dfc2978b2595d81fda9553636bae9449f2aa335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / av_safety_parser-2025.12.21191556-py3-none-any.whl
| Download URL | av_safety_parser-2025.12.21191556-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca6cee7d573800bf4a0b1bf4bc8ea05e166efab13c492132cb2c0200cf11132f
|
|
BLAKE2b-256 checksum How to use checksums |
32f724a2b4ccb1ecf8ad49539e284159c95bb0d87b6c2eb0291c18d84329f80e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|