Easy, elegant and customizable toast notifications for macOS with icons, sounds, and more.
Project description
Mactoast 🍞
An elegant and super easy to use Python library for creating customizable toast notifications on macOS.
Features
- 🎨 Customizable: Colors, size, position, timing, and more
- 💊 Modern Design: Borderless, modern UI with no title bar or buttons
- ⚡ Non-Blocking: Run toasts asynchronously without blocking your script
- 🎭 Animated: Smooth fade-in and fade-out animations
- 🪶 Lightweight: Minimal dependencies, uses a bundled native macOS app
- 🎯 Icons: Native SF Symbols support for beautiful icons
- 👆 Click to Dismiss: Tap any toast to dismiss it immediately
- 📏 Auto-Size: Automatically calculates optimal dimensions for your message
- 🔊 Sound Effects: Built-in notification sounds with custom sound support
Toast Styles
| Success | Error | Warning | Info |
|---|---|---|---|
Installation
pip install mactoast
Quick Start
from mactoast import toast
# Simple toast
toast("Hello from macOS!")
# With icon and sound
toast("Success!", icon="checkmark.circle.fill", sound="confirmation1")
# Preset styles
from mactoast import show_success, show_error, show_warning, show_info
show_success("File saved!")
show_error("Connection failed!")
Key Examples
Colors & Positioning
from mactoast import toast, ToastPosition
# Custom colors
toast("Blue toast", bg="#0080FF", text_color="#FFFFFF")
# Position
toast("Top Right", position=ToastPosition.TOP_RIGHT)
toast("Custom", position=(500, 500))
Auto-Size
# Automatically sizes to fit content
toast("Short!", auto_size=True)
toast("This is a longer message that wraps", auto_size=True)
Non-Blocking Mode
# Launch toast and continue immediately
process = toast("Background", blocking=False)
print(f"Toast PID: {process.pid}")
# Launch multiple toasts at once
for i in range(4):
toast(f"Toast {i+1}", blocking=False)
Sound Effects
# 16 bundled sounds in 4 categories
toast("Beep!", sound="beep1")
toast("Success", sound="confirmation1")
toast("Pop!", sound="pop2")
toast("Sci-fi", sound="scifi1.m4a")
# Custom sound file
toast("Custom", sound="/path/to/sound.wav")
Icons (SF Symbols)
# Use any SF Symbol name
toast("Download complete", icon="arrow.down.circle.fill")
toast("Settings", icon="gearshape.fill")
toast("Message", icon="paperplane.fill")
Complete Documentation
For comprehensive documentation including:
- Full API reference
- ToastHUD Swift app architecture
- Sound system details
- Building from source
- Advanced examples
- Troubleshooting
See DOCS.md
Requirements
- macOS 10.15+
- Python 3.8+
Links
- Documentation: DOCS.md
- PyPI: https://pypi.org/project/mactoast/
- GitHub: https://github.com/rafa-rrayes/mactoast
- SF Symbols: https://developer.apple.com/sf-symbols/
License
MIT License - see LICENSE file for details
Project details
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 mactoast-0.1.1.tar.gz.
File metadata
- Download URL: mactoast-0.1.1.tar.gz
- Upload date:
- Size: 7.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86bdfef234494147a21671843f57bacf1d63bd0734a133ac694dcd928ee266c9
|
|
| MD5 |
06b93aaa5830b3f014d791cd4d6f0c42
|
|
| BLAKE2b-256 |
8559b5792a896b016f216ccd26af39c3110b862d1211fb82ffa8d9418187e698
|
Provenance
The following attestation bundles were made for mactoast-0.1.1.tar.gz:
Publisher:
publish.yml on rafa-rrayes/mactoast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mactoast-0.1.1.tar.gz -
Subject digest:
86bdfef234494147a21671843f57bacf1d63bd0734a133ac694dcd928ee266c9 - Sigstore transparency entry: 763884782
- Sigstore integration time:
-
Permalink:
rafa-rrayes/mactoast@f2d79cd2f789cde83a410cacb2ca888a9f664391 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rafa-rrayes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2d79cd2f789cde83a410cacb2ca888a9f664391 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mactoast-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mactoast-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbe77fec7327f882c61ccf8f6eb05fc6845941fc221d30185968817042085fb
|
|
| MD5 |
3809d08461826a712be801ab25b082db
|
|
| BLAKE2b-256 |
eb131f4bb7b0b7a004b93c18286fa0e8dc6ad24c0723b45d65726458617d4b07
|
Provenance
The following attestation bundles were made for mactoast-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on rafa-rrayes/mactoast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mactoast-0.1.1-py3-none-any.whl -
Subject digest:
3bbe77fec7327f882c61ccf8f6eb05fc6845941fc221d30185968817042085fb - Sigstore transparency entry: 763884783
- Sigstore integration time:
-
Permalink:
rafa-rrayes/mactoast@f2d79cd2f789cde83a410cacb2ca888a9f664391 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rafa-rrayes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f2d79cd2f789cde83a410cacb2ca888a9f664391 -
Trigger Event:
release
-
Statement type: