Skip to main content

Unofficial Python SDK for MagicBell

Project description

MagicBell-Python SDK

belfry_magicbell logo purple

This SDK provides convenient access to the belfry_magicbell REST API from applications written in Python. It includes helpers for creating notifications, managing users, managing projects, and executing GraphQL.

CI codecov code coverage PyPI - License PyPI - Python Version PyPI Code style: black


This is an unofficial Python SDK for MagicBell open sourced with ❤️ by Noteable, a collaborative notebook platform that enables teams to use and visualize data, together.

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

Requirements

Python 3.8+

Installation

Poetry

poetry add belfry_magicbell

Then import the package:

import belfry_magicbell

Pip

pip install belfry_magicbell

Then import the package:

import belfry_magicbell

Getting Started

import belfry_magicbell
from belfry_magicbell.configuration import Configuration

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

Authentication

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

See the belfry_magicbell API documentation for more information.

Configuration

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

Explicit Configuration

from belfry_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 belfry_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

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

belfry_magicbell-1.2.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

belfry_magicbell-1.2.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file belfry_magicbell-1.2.1.tar.gz.

File metadata

  • Download URL: belfry_magicbell-1.2.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/5.15.0-1053-azure

File hashes

Hashes for belfry_magicbell-1.2.1.tar.gz
Algorithm Hash digest
SHA256 b952b25963b71487877e5b46ae962c5d2790236eb479c10dddfc5075bb0a4853
MD5 720ed490ea8271f1315dbd435f213599
BLAKE2b-256 42b0ebb7778fcb1a5a2430ba9ef5a84737ee250efab02b37b72655d079d6ca71

See more details on using hashes here.

Provenance

File details

Details for the file belfry_magicbell-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: belfry_magicbell-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/5.15.0-1053-azure

File hashes

Hashes for belfry_magicbell-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03f701a9f62444c979b571a84548d95551632ff1df9533c2055567cced8204d1
MD5 767f57013eede23e2cdccfdd846d92ba
BLAKE2b-256 726bf257d67dc6a073e2d04536fbef46085071fcfc534a9ff4cd3f52eeefbff9

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page