Skip to main content

minimax

Wrapper for Max API.

Install

pip install mini-max-wrapper

You still import minimax in code — only the package name on PyPI differs.

Console examples

If you just want to try the library from a terminal — no browser, no WebSocket server — the examples/ folder has small scripts that prompt for input right in the console:

  • socket_phone.py — phone + SMS login. It asks you for the SMS code (and the 2FA password, if needed) via input().
  • socket_token.py / web_token.py — log in using a token you already have.
  • web_qr.py — QR login. The link is printed in the terminal; open it or paste it into a QR generator to scan.

Run them like this:

python examples/socket_phone.py 79001234567
python examples/socket_token.py 79001234567 YOUR_TOKEN
python examples/web_qr.py 79001234567
python examples/web_token.py 79001234567 YOUR_TOKEN

After login each script calls dump_account(client), which prints your contacts, chats, and recent messages to the terminal. Use these when you just want to poke at the API. For real applications, use the bridge pattern below.

Bridge examples

The examples/ folder contains tiny end-to-end demos showing how to drive the library from a browser through a WebSocket to your backend. Two flavors:

  • socket_ws_bridge.py + socket_ws_bridge.html — phone + SMS login.
  • web_ws_bridge.py + web_ws_bridge.html — QR code login.

How to run

  1. Start the backend:

    python examples/socket_ws_bridge.py
    # or
    python examples/web_ws_bridge.py
    

    It opens a WebSocket server on ws://localhost:8765.

  2. Open the matching .html file in a browser (just double-click it).

  3. Use the form:

    • Socket: enter your phone → click Connect → type the SMS code you receive → if asked, type your 2FA password.
    • Web: click Connect → scan the QR with the MAX mobile app → if asked, type your 2FA password.
  4. After login, the backend logs your contacts, chats, and recent messages to the terminal (dump_account).

What's actually happening

  • The browser (FE) sends small JSON messages — phone, code, password — to your backend (BE) over one WebSocket.
  • The BE runs the minimax library and drives the login flow. Whenever the library needs something (SMS code, 2FA password, QR link to display), the BE asks the FE and waits for the answer.
  • Once login succeeds, the BE holds the authenticated session. Everything the user does on the FE is relayed through the BE to MAX.

This is the pattern any real app using this library should follow: the library lives on the server, the browser only talks to your backend.

Metadata

Release files for mini-max-wrapper 0.1.24

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

Source distribution (sdist)

Source distribution for mini-max-wrapper 0.1.24
File Size Uploaded
mini_max_wrapper-0.1.24.tar.gz 38.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mini-max-wrapper 0.1.24
File Interpreter ABI Platform
mini_max_wrapper-0.1.24-py3-none-any.whl Python 3 none any Details

Total release size: 68.4 kB

Release files / mini_max_wrapper-0.1.24.tar.gz

Download URL mini_max_wrapper-0.1.24.tar.gz
Size 38.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f1fd948ea0b5b8673f180a785ec9033830c4c202896bf19a404d5fb292724fab
BLAKE2b-256 checksum
How to use checksums
c07786c07b6155728a15f7ef0476a988f6f467ba5d270921dfa2faf70d9bc763
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / mini_max_wrapper-0.1.24-py3-none-any.whl

Download URL mini_max_wrapper-0.1.24-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c43124ca959b4071cabcd07fbf7246582aa9ff7b13f3510c581212f384224030
BLAKE2b-256 checksum
How to use checksums
9b753ab3c71ab4ff4d77fd08aa69ce287cd1b4b32ec71b526feed3cb0226114f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release history Release notifications | RSS feed

0.1.25

2 release files

This release

0.1.24 This release

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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