Skip to main content

Swarmauri readability-analysis tool for calculating SMOG Index scores across text and documentation.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_smogindex Discord

Swarmauri Tool SMOG Index

swarmauri_tool_smogindex is a Swarmauri readability tool for calculating the SMOG Index, a well-known estimate of the education level needed to understand a piece of writing. It is useful for compliance content, educational materials, technical documentation, public-facing copy, and agent workflows that need a quick readability score.

Why Use Swarmauri Tool SMOG Index

  • Estimate how difficult a text may be for readers to understand.
  • Review whether copy meets documentation or policy readability targets.
  • Add grade-level signals to editorial, education, or governance workflows.
  • Compare document revisions with a consistent, interpretable metric.

FAQ

What does the tool return?
A dictionary with one key: smog_index.

How is the score estimated?
The implementation counts sentences and polysyllabic words, then applies the standard SMOG formula.

What happens for empty text?
The score returns 0.0 when no sentences are found.

Is this a full readability suite?
No. It focuses specifically on the SMOG Index.

Features

  • Swarmauri ToolBase implementation registered as SMOGIndexTool.
  • Calculates SMOG readability scores from raw text.
  • Uses sentence tokenization plus polysyllable counting.
  • Useful for document QA, public-language review, and education use cases.
  • Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

uv add swarmauri_tool_smogindex
pip install swarmauri_tool_smogindex

Usage

from swarmauri_tool_smogindex import SMOGIndexTool

tool = SMOGIndexTool()
result = tool("This is a sample text with complex sentences and polysyllabic words.")

print(result["smog_index"])

Examples

Score a policy document excerpt

from swarmauri_tool_smogindex import SMOGIndexTool

tool = SMOGIndexTool()
score = tool("Authentication requirements shall be enforced through administrative verification procedures.")

print(score)

Compare simplified and technical versions

from swarmauri_tool_smogindex import SMOGIndexTool

tool = SMOGIndexTool()

simple = "Read the guide and follow the steps."
technical = "Operational remediation requires synchronized configuration validation across administrative boundaries."

print("simple", tool(simple))
print("technical", tool(technical))

Register the tool in a Swarmauri collection

from swarmauri_standard.tools.ToolCollection import ToolCollection
from swarmauri_tool_smogindex import SMOGIndexTool

tools = ToolCollection(tools=[SMOGIndexTool()])
print(tools)

Related Packages

Swarmauri Foundations

More Documentation

Best Practices

  • Use the score comparatively across similar kinds of content.
  • Expect very short texts to produce less stable readability estimates.
  • Pre-download tokenizer resources in offline deployments.
  • Pair SMOG with other readability and structure metrics for better judgment.

License

This project is licensed under the Apache-2.0 License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_tool_smogindex-0.11.0.dev1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file swarmauri_tool_smogindex-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_tool_smogindex-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_tool_smogindex-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 987f432d0b271f79b3e0c4d3c6116d67c7b4786ccffd0e7d318cab22eb95e9bb
MD5 fdcbd6f57b1bdb3400ecebde3518484e
BLAKE2b-256 0c2288de827b5b6c435541ffa9cc06c045babe779a6ffbf0720b31782409d442

See more details on using hashes here.

File details

Details for the file swarmauri_tool_smogindex-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_smogindex-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_tool_smogindex-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 4dd99f43a34718e42eb6ca3ae57048d681e19977aa1b66a83d535f23e3f8093f
MD5 5ea7baf2efe9f20f2139776d7d1ab806
BLAKE2b-256 0fbd559c5dfef74f317e4fd09bbd1fe1e7cd7ede98f9f37c8ed05a3808b72884

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