Skip to main content

magicbell-python-sdk

magicbell logo purple

An unofficial Python SDK for MagicBell.

CI PyPI - License PyPI - Python Version PyPI Code style: black

Install | Getting Started | Examples | License | Code of Conduct | Contributing

  • API Version: 1.0
  • Package Version: 1.1.0

Requirements

Python 3.8+

Installation & Usage

Poetry

poetry add magicbell

Then import the package:

import magicbell

Pip

pip install magicbell

Then import the package:

import magicbell

Getting Started

import magicbell
from magicbell.configuration import Configuration

config = Configuration(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
)
async with magicbell.MagicBell(config) as mb:
    # Send a notification
    await mb.realtime.create_notification(
        magicbell.WrappedNotification(
            notification=magicbell.Notification(
                title="My first notification from python!",
                recipients=[magicbell.Recipient(email="dan@example.com")],
            )
        )
    )

Authentication

Most API calls require your MagicBell project API Key and API Secret. Some API calls (i.e. projects) require your MagicBell user JWT (enterprise only).

See the MagicBell API documentation for more information.

Configuration

Configuration can be done explicitly using the magicbell.Configuration class, or implicitly by setting environment variables with the MAGICBELL_ prefix.

Explicit Configuration

from magicbell.configuration import Configuration


# Create a configuration object with the required parameters
config = Configuration(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
)

Implicit Configuration

export MAGICBELL_API_KEY="YOUR_API_KEY"
export MAGICBELL_API_SECRET="YOUR_API_SECRET"
from magicbell.configuration import Configuration


config = Configuration()

Examples

For more examples see the examples directory.

Contributing

See CONTRIBUTING.md.


Open sourced with ❤️ by Noteable for the community.

boost data collaboration with notebooks

Download files

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

Source Distribution

magicbell-1.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

magicbell-1.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file magicbell-1.1.0.tar.gz.

File metadata

  • Download URL: magicbell-1.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.2 Linux/5.13.0-1031-azure

File hashes

Hashes for magicbell-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d51653167ec02c1f15f318a1161d8273c0874b21a3070a47389625a9a292bfbf
MD5 a5c8603ce4210de84752272928f62543
BLAKE2b-256 e7dcdb004db7ee60c737f114f0a5e078f58b7d591967729050daa991c5263cb7

See more details on using hashes here.

File details

Details for the file magicbell-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: magicbell-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.2 Linux/5.13.0-1031-azure

File hashes

Hashes for magicbell-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cf874f9555832e8ea1aeedfe4525801d863c12e612d1e0d53fc0ae06c917eaf
MD5 542c68ddae5fdbe50445c8d9af851075
BLAKE2b-256 117e633fe025213416cf971da61e653f744db3764483763963a07fac6054300b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.1

2 files

This release

1.1.0 This release

2 files

1.0.0

2 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