Skip to main content

Avahi Summarizer

PyPI version

The Avahi Summarizer Python library provides convenient access to AWS Bedrock's Claude 3 Sonnet model for text summarization. It allows you to easily summarize text using the power of AWS Bedrock from any Python 3.7+ application.

Installation

pip install avahi-summarizer

Usage

The full API of this library can be found in the source code.

import os
from avahi_summarizer import summarize_text

# Set your AWS credentials as environment variables
os.environ['AWS_ACCESS_KEY_ID'] = 'your_access_key_id'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'your_secret_access_key'
os.environ['AWS_REGION'] = 'your_aws_region'

text_to_summarize = """
Your long text goes here...
"""

summary = summarize_text(text_to_summarize)
print(summary)

We recommend using python-dotenv to add your AWS credentials to a .env file so that your API keys are not stored in source control.

Features

  • Easy-to-use interface for text summarization
  • Utilizes AWS Bedrock's Claude 3 Sonnet model
  • Automatic handling of AWS Bedrock client creation and API calls

Configuration

Before using the library, make sure to set the following environment variables:

  • AWS_ACCESS_KEY_ID: Your AWS access key ID
  • AWS_SECRET_ACCESS_KEY: Your AWS secret access key
  • AWS_REGION: The AWS region where your Bedrock resources are located

Functions

summarize_text(text: str) -> str

Summarizes the provided text using AWS Bedrock's Claude 3 Sonnet model.

Parameters:

  • text (str): The input text to be summarized.

Returns:

  • str: A 3-5 line summary of the input text.

hello()

A simple function to verify that the package is installed correctly.

get_bedrock_client()

Creates and returns an AWS Bedrock client using the configured environment variables.

Error Handling

The library will raise a ValueError if the required AWS credentials are not set as environment variables.

Requirements

  • Python 3.7 or higher
  • boto3 library

Contributing

We welcome contributions to the Avahi Summarizer library! Please feel free to submit issues, fork the repository and send pull requests!

License

MIT License

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

Release files for avahi-summarizer 0.2

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

Source distribution (sdist)

Source distribution for avahi-summarizer 0.2
File Size Uploaded
avahi_summarizer-0.2.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avahi-summarizer 0.2
File Interpreter ABI Platform
avahi_summarizer-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / avahi_summarizer-0.2.tar.gz

Download URL avahi_summarizer-0.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b102eed67bb48f93e22744bf9bb097a2edd4c0f06734bb5f4cee42baf14704b5
BLAKE2b-256 checksum
How to use checksums
fb2c29b878791055874f69fc616a709cc524a49fb61c6bcfde8afac6b4ba1b26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / avahi_summarizer-0.2-py3-none-any.whl

Download URL avahi_summarizer-0.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
737b61172a1fb48f10419ded43777002a6e78822f5654f2f8954a993376d1465
BLAKE2b-256 checksum
How to use checksums
1ec83347e12fcbd280490b5bfd7fa14b786203ba70994b0aea8db6f8121c5321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

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