Skip to main content

macomb-bedrock

Amazon Bedrock helpers for the ITIA 1510 lab activities at Macomb Community College. The package sends prompts to Amazon Nova Micro (amazon.nova-micro-v1:0, us-east-1) through the Amazon Bedrock Converse API.

Install

python3.13 -m pip install macomb-bedrock==0.1.0

Use

from macomb_bedrock import ask, ask_history

print(ask("What makes a password strong?"))

conversation = [
    "Is Summer2024! a strong password?",
    "It is weak: it follows a season and year pattern.",
    "Why does that pattern matter?",
]
print(ask_history(conversation))
Name What it does
ask(prompt, system, client) Sends one prompt and returns the reply text
ask_history(messages, system, client) Sends a conversation (user, assistant, user, ...) and returns the reply text
call_cost(input_tokens, output_tokens) Returns the cost of one call in US dollars
make_client() Returns a boto3 bedrock-runtime client for us-east-1
FakeClient(replies) A stand-in client for tests; returns the given replies in order and records each request
fake_response(text, ...) A dictionary shaped like a Converse response
BedrockError Raised with a plain explanation when a call fails or the reply is blocked by the content filter

The lab server's IAM role grants the permission to call the model. The package holds no keys or passwords.

Build and publish

py -m build
py -m twine upload --repository testpypi dist/*
py -m twine upload dist/*

A version number can be uploaded to PyPI only once. Change version in pyproject.toml and __version__ in src/macomb_bedrock/__init__.py before each release.

Metadata

Release files for macomb-bedrock 0.1.0

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

Source distribution (sdist)

Source distribution for macomb-bedrock 0.1.0
File Size Uploaded Provenance Actions
macomb_bedrock-0.1.0.tar.gz 4.0 kB Without provenance Details for macomb_bedrock-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for macomb-bedrock 0.1.0
File Interpreter ABI Platform Actions
macomb_bedrock-0.1.0-py3-none-any.whl Python 3 none any Details for macomb_bedrock-0.1.0-py3-none-any.whl

Total release size: 8.0 kB

Release files / macomb_bedrock-0.1.0.tar.gz

Download URL macomb_bedrock-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
30d62a3a216298721c6422ba4163ab950b2d68145865fe2852b4501823a45a2b
BLAKE2b-256 checksum
How to use checksums
1041f45389253bda28c7ccf9d7d9ed70799fe0698310a4e923b3e2ddb50094af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.1

Release files / macomb_bedrock-0.1.0-py3-none-any.whl

Download URL macomb_bedrock-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f0b0840d3d15e2b5d7132732479b14119e28db4be7ca0c9880a793c6043caa0
BLAKE2b-256 checksum
How to use checksums
4a12c61d0875d8e094be2cd00aa09cdca5e74ccadfa1c1e6f572ebf0dc0e177d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.1

Security for macomb-bedrock 0.1.0

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

0.1.0 This release

2 release files No provenance

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