Skip to main content

fiction-vs-fact

PyPI version License: MIT Downloads LinkedIn

A Python package to help analyze and differentiate nuanced narratives or statements by identifying which parts are factual and which are imaginative or speculative. Ideal for literary analysis, scriptwriting, or clarifying misleading information by clearly distinguishing between objective reality and creative interpretation.

Installation

Install the package via pip:

pip install fiction_vs_fact

Usage

Here's an example of how to use the package in your Python code:

from fiction_vs_fact import fiction_vs_fact

# Example user input
text_input = "In the story, John claims he saw a dragon flying over the city, but eyewitnesses report no such event."

# Process the input to separate facts from fictional elements
results = fiction_vs_fact(user_input=text_input)

print(results)

Function Parameters

  • user_input (str): The text containing statements or narratives to analyze.
  • llm (Optional[BaseChatModel]): Optional. A custom language model instance to use. Defaults to using ChatLLM7 if not provided.
  • api_key (Optional[str]): Optional. API key for the LLM service. If not provided, it will attempt to read the LLM7_API_KEY environment variable.

Underlying LLM

The package utilizes ChatLLM7 from langchain_llm7 by default.

Custom LLM Usage

You can pass your own language model instance to the function. For example:

from langchain_openai import ChatOpenAI
from fiction_vs_fact import fiction_vs_fact

llm = ChatOpenAI()

response = fiction_vs_fact(
    user_input="Some intriguing story...",
    llm=llm
)

Similarly, for other providers:

from langchain_anthropic import ChatAnthropic
from fiction_vs_fact import fiction_vs_fact

llm = ChatAnthropic()

response = fiction_vs_fact(
    user_input="Some intriguing story...",
    llm=llm
)

Rate Limits and API Keys

The package defaults to the free tier limits of LLM7. For higher limits, obtain an API key at LLM7 Token Service and set it via environment variable LLM7_API_KEY or pass it directly:

response = fiction_vs_fact(
    user_input="Some input...",
    api_key="your_api_key"
)

Resources

Metadata

Release files for fiction-vs-fact 2025.12.21083650

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

Source distribution (sdist)

Source distribution for fiction-vs-fact 2025.12.21083650
File Size Uploaded Provenance Actions
fiction_vs_fact-2025.12.21083650.tar.gz 4.7 kB Without provenance Details for fiction_vs_fact-2025.12.21083650.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fiction-vs-fact 2025.12.21083650
File Interpreter ABI Platform Actions
fiction_vs_fact-2025.12.21083650-py3-none-any.whl Python 3 none any Details for fiction_vs_fact-2025.12.21083650-py3-none-any.whl

Total release size: 10.0 kB

Release files / fiction_vs_fact-2025.12.21083650.tar.gz

Download URL fiction_vs_fact-2025.12.21083650.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a260346cf0a9adfc458bfaac3b323d6685b097259f06d27f6674c7abcc7501cf
BLAKE2b-256 checksum
How to use checksums
261e9d7acd02aa0d77e2d443b47b14b0b3bab1892c5f8e9afbc37d5705852b4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / fiction_vs_fact-2025.12.21083650-py3-none-any.whl

Download URL fiction_vs_fact-2025.12.21083650-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00abd79cf9651900c42ba146a531483a139b94ca3b964f8eb1158c9c3e08cc57
BLAKE2b-256 checksum
How to use checksums
f630cb4dbcf78d9de236f3973eb524e0a9a4587a06e5604628e14d8dbca97f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for fiction-vs-fact 2025.12.21083650

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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