Skip to main content

Neonize - WhatsApp automation for Python

WhatsApp Automation for Python

Python Go License Release WhatsApp

A Python library for WhatsApp automation. A native Go core built on whatsmeow is compiled into a shared library and exposed to Python through a zero-copy FFI layer.

Getting Started | Features | Examples | Documentation | Contributing


Why Neonize?

Go core performance The WhatsApp multidevice protocol runs in Go, called directly through ctypes. No subprocesses, no HTTP bridges.
Python native Fully typed, idiomatic API. Sync and async clients with identical surfaces.
Persistent sessions SQLite or PostgreSQL. Pair once, reconnect forever.
Enterprise ready Structured error hierarchy, FFmpeg diagnostics, robust FFI with retry logic.

Features

Messaging

  • Send and receive text, images, videos, documents, audio, voice notes, stickers
  • Message replies, reactions, polls, interactive buttons and lists
  • Receipt and presence tracking

Groups and Channels

  • Create, update, and manage groups (name, description, photo, participants)
  • Newsletter/channel operations: fetch messages, update profile, send media

Contacts and Presence

  • Profile picture retrieval, push name updates
  • Typing and recording indicators
  • Contact sync and blocklist management

Architecture

  • Sync (NewClient) and async (NewAClient) with identical APIs
  • Multi-session support via ClientFactory
  • Event-driven with 37+ typed event classes
  • QR code and phone-number pairing

Getting Started

Prerequisites

  • Python 3.10 or newer
  • FFmpeg (required for media operations: stickers, audio, video, thumbnails)

Installation

pip install neonize

Quick Start

from neonize.client import NewClient
from neonize.events import ConnectedEv, MessageEv

client = NewClient("session.db")


@client.event(ConnectedEv)
def on_connected(client: NewClient, _: ConnectedEv) -> None:
    print("Connected")


@client.event(MessageEv)
def on_message(client: NewClient, message: MessageEv) -> None:
    text = message.Message.conversation or message.Message.extendedTextMessage.text
    if text == "ping":
        client.reply_message("pong", message)


client.connect()

Async Quick Start

import asyncio
from neonize.aioze.client import NewAClient
from neonize.aioze.events import ConnectedEv, MessageEv

client = NewAClient("async_session.db")


@client.event(ConnectedEv)
async def on_connected(client: NewAClient, _: ConnectedEv) -> None:
    print("Connected")


@client.event(MessageEv)
async def on_message(client: NewAClient, message: MessageEv) -> None:
    text = message.Message.conversation or message.Message.extendedTextMessage.text
    if text == "ping":
        await client.reply_message("pong", message)


async def main():
    await client.connect()
    await client.idle()


asyncio.run(main())

Examples

Sending Media

from neonize.utils.jid import build_jid

jid = build_jid("1234567890", "s.whatsapp.net")

# Text
client.send_message(jid, "Hello from Neonize")

# Image with caption
with open("photo.jpg", "rb") as f:
    msg = client.build_image_message(f.read(), caption="Photo", mime_type="image/jpeg")
    client.send_message(jid, message=msg)

# Document
with open("report.pdf", "rb") as f:
    msg = client.build_document_message(
        f.read(), filename="report.pdf", mime_type="application/pdf"
    )
    client.send_message(jid, message=msg)

Handling Incoming Messages

from neonize.events import MessageEv, ReceiptEv, PresenceEv
from neonize.utils.message import extract_text


@client.event(MessageEv)
def on_message(client: NewClient, event: MessageEv) -> None:
    text = extract_text(event.Message)
    sender = event.Info.MessageSource.Sender

    if text == "help":
        client.reply_message("Available commands: help, time", event)


@client.event(ReceiptEv)
def on_receipt(client: NewClient, event: ReceiptEv) -> None:
    print(f"Receipt: {event.Receipt.Type} for {event.MessageIDs}")


@client.event(PresenceEv)
def on_presence(client: NewClient, event: PresenceEv) -> None:
    print(f"{event.MessageSource.Sender} is {event.Presence}")

Group Management

from neonize.utils.jid import build_jid

# Create group
participants = [build_jid("1234567890"), build_jid("0987654321")]
info = client.create_group("Project Team", participants)
print(f"Group created: {info.JID}")

# Update settings
client.set_group_name(info.JID, "New Name")
client.set_group_description(info.JID, "Updated description")

# Manage participants
client.update_group_participants(info.JID, [build_jid("5555555555")], "add")

Multi-Session (Async)

import asyncio
from neonize.aioze.client import ClientFactory, NewAClient
from neonize.aioze.events import MessageEv, ConnectedEv

factory = ClientFactory("multisession.db")

# Load existing sessions
for device in factory.get_all_devices():
    factory.new_client(device.JID)

# Pair a new account
factory.new_client(uuid="second-account", new_device=True)


@factory.event(ConnectedEv)
async def on_connected(client: NewAClient, event: ConnectedEv) -> None:
    print("Client connected")


@factory.event(MessageEv)
async def on_message(client: NewAClient, event: MessageEv) -> None:
    if event.Message.conversation == "ping":
        await client.reply_message("pong", event)


async def main():
    await factory.run()
    await factory.idle_all()


asyncio.run(main())

Integration with FastAPI

from contextlib import asynccontextmanager
from fastapi import FastAPI
from neonize.aioze.client import NewAClient
from neonize.aioze.events import MessageEv
from neonize.utils.jid import build_jid

client = NewAClient("fastapi_bot")


@client.event(MessageEv)
async def on_message(client: NewAClient, event: MessageEv) -> None:
    if event.Message.conversation == "/status":
        await client.reply_message("API is running", event)


@asynccontextmanager
async def lifespan(app: FastAPI):
    await client.connect()
    yield
    await client.disconnect()


app = FastAPI(lifespan=lifespan)


@app.get("/send")
async def send(phone: str, message: str):
    await client.send_message(build_jid(phone), message)
    return {"status": "sent"}

Database Configuration

Neonize stores session data in a database. The default is SQLite, which works well for development and single-instance deployments.

# SQLite (default)
client = NewClient("bot", database="./session.db")

# PostgreSQL (recommended for production)
client = NewClient("bot", database="postgres://user:pass@localhost:5432/neonize")

# Connection pooling
client = NewClient(
    "bot", database="postgres://user:pass@localhost/neonize?pool_min_conns=5&pool_max_conns=20"
)

# In-memory (testing only)
client = NewClient("bot", database=":memory:")

Project Structure

neonize/
├── examples/               # Runnable example bots
│   ├── basic.py
│   ├── async_basic.py
│   ├── multisession.py
│   ├── multisession_async.py
│   └── paircode.py
├── goneonize/              # Go shared library (FFI core)
│   ├── main.go
│   ├── defproto/           # Generated protobuf definitions
│   └── utils/              # Go encoder helpers
├── neonize/                # Python package
│   ├── __init__.py
│   ├── client.py           # Sync client (NewClient)
│   ├── aioze/              # Async client (NewAClient)
│   ├── events.py           # Event types and dispatcher
│   ├── exc.py              # Exception hierarchy
│   ├── ext/                # Extensions (interactive messages)
│   ├── proto/              # Python protobuf bindings
│   └── utils/              # Helpers (JID, media, FFmpeg, etc.)
├── docs/                   # Zensical documentation source
├── tools/                  # Build, release, and dev scripts
└── pyproject.toml          # Project metadata and dependencies

Contributing

We welcome contributions. See CONTRIBUTING.md for the branching model, conventional-commit standards, and release process.

# Clone and setup
git clone https://github.com/krypton-byte/neonize.git
cd neonize
uv sync --dev

# Build the Go shared library
CGO_ENABLED=1 uv run task build goneonize

# Run tests
uv run --with pytest python -m pytest

# Lint
uv run ruff check .
uv run ruff format --check .

Workflow: feature branches target dev, merges to master trigger the automated release pipeline.


Documentation

Full documentation is available at neonize.readthedocs.io


Project Description
Thundra High-level bot framework built on Neonize
Tryx Rust-powered Python SDK for WhatsApp automation
Neonize Dart Dart/Flutter wrapper for Neonize
Whatsmeow Go WhatsApp Web API library that powers Neonize

License

This project is licensed under the Apache License 2.0. See LICENSE for details.


Built by krypton-byte and contributors

Metadata

Release files for neonize 0.6.1

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

Built distributions (wheels)

Table of built distributions (wheels) for neonize 0.6.1
File Actions
neonize-0.6.1-py310-none-win_arm64.whl Python 3.10 none Windows ARM64 Details for neonize-0.6.1-py310-none-win_arm64.whl
neonize-0.6.1-py310-none-win_amd64.whl Python 3.10 none Windows x86-64 Details for neonize-0.6.1-py310-none-win_amd64.whl
neonize-0.6.1-py310-none-win32.whl Python 3.10 none Windows x86-32 Details for neonize-0.6.1-py310-none-win32.whl
neonize-0.6.1-py310-none-manylinux2014_x86_64.whl Python 3.10 none Linux glibc 2.17+ x86-64 Details for neonize-0.6.1-py310-none-manylinux2014_x86_64.whl
neonize-0.6.1-py310-none-manylinux2014_s390x.whl Python 3.10 none Linux glibc 2.17+ IBM System/390x Details for neonize-0.6.1-py310-none-manylinux2014_s390x.whl
neonize-0.6.1-py310-none-manylinux2014_i686.whl Python 3.10 none Linux glibc 2.17+ x86-32 Details for neonize-0.6.1-py310-none-manylinux2014_i686.whl
neonize-0.6.1-py310-none-manylinux2014_aarch64.whl Python 3.10 none Linux glibc 2.17+ ARM64 Details for neonize-0.6.1-py310-none-manylinux2014_aarch64.whl
neonize-0.6.1-py310-none-macosx_12_0_x86_64.whl Python 3.10 none macOS 12.0+ x86-64 Details for neonize-0.6.1-py310-none-macosx_12_0_x86_64.whl
neonize-0.6.1-py310-none-macosx_12_0_arm64.whl Python 3.10 none macOS 12.0+ ARM64 Details for neonize-0.6.1-py310-none-macosx_12_0_arm64.whl

Total release size: 64.5 MB

Release files / neonize-0.6.1-py310-none-win_arm64.whl

Download URL neonize-0.6.1-py310-none-win_arm64.whl
Size 6.4 MB
Tags Python 3.10 Windows ARM64
SHA-256 checksum
How to use checksums
c444cd7bebb3cef343e27e46f9257a2c36c329ec7200f7b76e0ecb73d778d360
BLAKE2b-256 checksum
How to use checksums
f12873d3e0c2b032967c36e5f0bb4c6b44a3ff04cc858017fb7504e6ab447ed5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-win_amd64.whl

Download URL neonize-0.6.1-py310-none-win_amd64.whl
Size 7.1 MB
Tags Python 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b9017df5a44862ff28083852c6e2aa953048e66dfd0c0de10bc3abcce56a433a
BLAKE2b-256 checksum
How to use checksums
1083b6434757a7a226a7abde34dc640e53e54df86af9a71698acb3d1d0f48c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-win32.whl

Download URL neonize-0.6.1-py310-none-win32.whl
Size 7.0 MB
Tags Python 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
37dcd2790f6c4d6d78cfa5954db8e2241c50b98e9dc3dd52d54009b66d94eda2
BLAKE2b-256 checksum
How to use checksums
6471a6dacfb8eee5746794335eba17741735919d8c8c7571f853bc98d078a3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-manylinux2014_x86_64.whl

Download URL neonize-0.6.1-py310-none-manylinux2014_x86_64.whl
Size 7.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3.10
SHA-256 checksum
How to use checksums
a304bfb4fab31b8f5fe54dda05e30cfe294c35140398f98492be47a1e8c62d13
BLAKE2b-256 checksum
How to use checksums
a804bae115e51ccd72c5c98d1426d49b895d607ec5cc4c3dcef00cfc6c99f99e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-manylinux2014_s390x.whl

Download URL neonize-0.6.1-py310-none-manylinux2014_s390x.whl
Size 7.1 MB
Tags Linux glibc 2.17+ IBM System/390x Python 3.10
SHA-256 checksum
How to use checksums
6f9cc8f091c657feaf7da3729cee5edd996a2695512e961a98241739230d4ee8
BLAKE2b-256 checksum
How to use checksums
746044599df5351f07ccbb1a087e8df910fae9010ced83d45f27dc4c40d275cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-manylinux2014_i686.whl

Download URL neonize-0.6.1-py310-none-manylinux2014_i686.whl
Size 9.7 MB
Tags Linux glibc 2.17+ x86-32 Python 3.10
SHA-256 checksum
How to use checksums
41d630d5588f8832c58f25126fce3b36994a589c9cde591e81412e6209f4c730
BLAKE2b-256 checksum
How to use checksums
1ac83985c5620d4215bee105a8283435a2bb7da16462f24aa8b80eaa745e81f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-manylinux2014_aarch64.whl

Download URL neonize-0.6.1-py310-none-manylinux2014_aarch64.whl
Size 6.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3.10
SHA-256 checksum
How to use checksums
89bce6ce8680f5b26b12a844b9d84fdadf62f7a8bc964ca85a3391e5ddaf0a82
BLAKE2b-256 checksum
How to use checksums
97ef97cc645328b5cc6227042c2f22e5bd1b9850dc9af3b8b077f26de10db9fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-macosx_12_0_x86_64.whl

Download URL neonize-0.6.1-py310-none-macosx_12_0_x86_64.whl
Size 6.9 MB
Tags Python 3.10 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
ebc7fc0ab075ddd7b0a861bd213c464891a65442d78b8b808281c3f8bdeebe4c
BLAKE2b-256 checksum
How to use checksums
deafe35c145d0afc6d6f0d07dec14e7503d8e9612ab76945ba7f401f27b9f734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neonize-0.6.1-py310-none-macosx_12_0_arm64.whl

Download URL neonize-0.6.1-py310-none-macosx_12_0_arm64.whl
Size 6.4 MB
Tags Python 3.10 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
14a33dc48fda81c72c5bae9186c8a9bdbfd7d488dd3bda5993dff01630b216d3
BLAKE2b-256 checksum
How to use checksums
2bd2891ce51005e9dee9c7bc9784e479a93f548be29b5a442199fde986a67ef6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for neonize 0.6.1

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.6.1 This release

9 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