A Python library for demonstration and publishing to PyPI.
Project description
Sturnus
A lightweight Python core library for the Sturnus ecosystem.
Installation
Install Sturnus using pip:
pip install sturnus
Quick Start
Basic Usage
from sturnus import hello
# Simple greeting
print(hello("World"))
# Output: Hello, World! Welcome to the sturnus library.
print(hello("Alice"))
# Output: Hello, Alice! Welcome to the sturnus library.
Custom Greetings
from sturnus import greet
# Customizable greeting
print(greet("Alice"))
# Output: Hello, Alice!
print(greet("Bob", "Hi"))
# Output: Hi, Bob!
print(greet("Charlie", greeting="Hey"))
# Output: Hey, Charlie!
Message Formatting
from sturnus import format_message
# Basic message
print(format_message("Alice", "Welcome aboard"))
# Output: Alice: Welcome aboard
# With prefix
print(format_message("Bob", "Great work", prefix="[INFO]"))
# Output: [INFO] Bob: Great work
# With suffix
print(format_message("Charlie", "Task completed", suffix="✓"))
# Output: Charlie: Task completed ✓
# With both
print(format_message("Diana", "Login successful", prefix="[SUCCESS]", suffix="🎉"))
# Output: [SUCCESS] Diana: Login successful 🎉
Command-Line Interface
Sturnus also provides a simple CLI:
# Basic greeting
python -m sturnus Alice
# Output: Hello, Alice! Welcome to the sturnus library.
# Show version
python -m sturnus --version
# Verbose output
python -m sturnus Bob --verbose
# Output:
# Hello, Bob! Welcome to the sturnus library.
# [Sturnus v0.1.2]
# Help
python -m sturnus --help
Features
- Simple API: Easy-to-use functions for common greeting tasks
- Type-safe: Full type hints for better IDE support
- Validated: Input validation with helpful error messages
- CLI Support: Use as a command-line tool
- Namespace Package: Designed to support ecosystem extensions
- Well-documented: Comprehensive docstrings and examples
API Reference
hello(name: str) -> str
Returns a welcoming greeting message.
Parameters:
name(str): The name to greet (non-empty string)
Returns:
- str: A formatted greeting message
Raises:
TypeError: If name is not a stringValueError: If name is empty or whitespace-only
greet(name: str, greeting: str = "Hello") -> str
Returns a customizable greeting message.
Parameters:
name(str): The name to greet (non-empty string)greeting(str): The greeting word (default: "Hello")
Returns:
- str: A formatted greeting with custom greeting
Raises:
TypeError: If name or greeting is not a stringValueError: If name or greeting is empty or whitespace-only
format_message(name: str, message: str, prefix: str | None = None, suffix: str | None = None) -> str
Formats a message with optional prefix and suffix.
Parameters:
name(str): The name to include in the messagemessage(str): The main message contentprefix(str | None): Optional prefix before the messagesuffix(str | None): Optional suffix after the message
Returns:
- str: A formatted message string
Raises:
TypeError: If arguments are not strings (where required)ValueError: If name or message is empty or whitespace-only
Requirements
- Python >= 3.12, < 3.13
License
Proprietary License. Copyright © 2025 Starling Associates.
Links
- Homepage: https://www.starling.cloud
- PyPI: https://pypi.org/project/sturnus/
- Issues: Report bugs and request features on our issue tracker
Support
For questions and support, please contact info@starling.studio.
Made with ❤️ by Starling Cloud
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sturnus-0.1.2.tar.gz.
File metadata
- Download URL: sturnus-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a060eec4de56d0caea2a3654d8d6dca5cfd0734e597119c34c1378b11efd051
|
|
| MD5 |
6d0d877bd81bec7c120f5bd3cd7774e8
|
|
| BLAKE2b-256 |
d8a5f154da505519bda17ede3e6f61daa71b87588f8b0c4fbe6a8e08765b45a1
|
File details
Details for the file sturnus-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sturnus-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d13db3241572fecee11538967585af940256c35d1b4f7097ea2237b1c90ea556
|
|
| MD5 |
1e822c9c0a78e13b5b6b9b5fea224c76
|
|
| BLAKE2b-256 |
616f0705e14734f5adfc1f54c37663224623160e7afc818881ceb18e4bf0a592
|