Skip to main content

sciextractai

PyPI version License: MIT Downloads LinkedIn

sciextractai – a lightweight Python package that extracts and structures key scientific insights from complex texts.
It is especially useful for fast‑moving fields like attoscience where researchers need concise, structured summaries of breakthroughs, methods, and theories.


📦 Installation

pip install sciextractai

🚀 Quick Start

from sciextractai import sciextractai

# Example scientific text (e.g., a recent attoscience paper)
user_input = """
Scientists have generated the shortest light pulse ever recorded, lasting only 3 attoseconds.
This breakthrough opens new possibilities for probing electron dynamics in atoms.
"""

# Call the extractor (defaults to ChatLLM7)
extracted_data = sciextractai(user_input)

print(extracted_data)

Output

A list of strings that match the extraction pattern defined in the package, e.g.:

[
    "Shortest light pulse: 3 attoseconds",
    "Implication: Probing electron dynamics in atoms"
]

🛠️ Function Signature

def sciextractai(
    user_input: str,
    api_key: Optional[str] = None,
    llm: Optional[BaseChatModel] = None
) -> List[str]:
Parameter Type Description
user_input str The scientific text you want to process.
llm Optional[BaseChatModel] A LangChain LLM instance to use. If omitted, the package creates a default ChatLLM7 instance.
api_key Optional[str] API key for ChatLLM7. If omitted, the function looks for the environment variable LLM7_API_KEY.

🔧 Default LLM (ChatLLM7)

If you don’t provide an llm argument, sciextractai will instantiate ChatLLM7 from the langchain_llm7 package:

from langchain_llm7 import ChatLLM7

resolved_llm = ChatLLM7(api_key=api_key, base_url="https://api.llm7.io/v1")

🌟 Using a Custom LLM

You can pass any LangChain‑compatible LLM (e.g., OpenAI, Anthropic, Google Gemini).

OpenAI

from langchain_openai import ChatOpenAI
from sciextractai import sciextractai

llm = ChatOpenAI(model="gpt-4o-mini")
response = sciextractai(user_input, llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from sciextractai import sciextractai

llm = ChatAnthropic(model="claude-3-haiku-20240307")
response = sciextractai(user_input, llm=llm)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from sciextractai import sciextractai

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
response = sciextractai(user_input, llm=llm)

🔑 API Key & Rate Limits

  • ChatLLM7 free tier provides enough quota for most research usage.
  • To use a personal key, set the environment variable LLM7_API_KEY or pass it directly:
response = sciextractai(user_input, api_key="your_own_api_key")

🐞 Bugs & Feature Requests

Please raise any issues or feature ideas on the GitHub repository:

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


👤 Author

Eugene Evstafev
📧 Email: hi@euegne.plus
🐙 GitHub: chigwell


📄 License

This project is licensed under the MIT License.

Metadata

Release files for sciextractai 2025.12.21153118

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

Source distribution (sdist)

Source distribution for sciextractai 2025.12.21153118
File Size Uploaded
sciextractai-2025.12.21153118.tar.gz 4.8 kB Details

Built distribution (wheel)

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

Total release size: 10.2 kB

Release files / sciextractai-2025.12.21153118.tar.gz

Download URL sciextractai-2025.12.21153118.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0f73ed9c6e9d3d0e8b6b80d73b325cc46fea9adcc33373d924d87c8fdb04506e
BLAKE2b-256 checksum
How to use checksums
8653ce347965fa2ee57d4ca0585162bc75e18c3f25267a424cf4419fc099ac62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / sciextractai-2025.12.21153118-py3-none-any.whl

Download URL sciextractai-2025.12.21153118-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfde3ad88b9339e857877e213908621490529f8b2cd4207afb8e1275df7d0de0
BLAKE2b-256 checksum
How to use checksums
e45ca138404407879732d93c04731e42be36be0978171af03fe441d851e20731
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.21153118 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