Skip to main content

MAX wrapper

Project description

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.

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

mini_max_wrapper-0.1.11.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

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

mini_max_wrapper-0.1.11-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file mini_max_wrapper-0.1.11.tar.gz.

File metadata

  • Download URL: mini_max_wrapper-0.1.11.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for mini_max_wrapper-0.1.11.tar.gz
Algorithm Hash digest
SHA256 92880ab65a3d0922db0ffe03f9bc0519c7e033212dc2d7b16d64bee8980ded12
MD5 64a435e9f81fdd24deb496c00994fc91
BLAKE2b-256 10ad792b8da11941f9bec2d5b0664f87f1ca13616f8c64993813a477fb925ecc

See more details on using hashes here.

File details

Details for the file mini_max_wrapper-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for mini_max_wrapper-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 7918d72d10e3d2fa04fd2404d1be1afd8a222528830fc59b31d5d2756783858d
MD5 04f77c57bc89516dc746d951dded4512
BLAKE2b-256 370e084aa0ec8f839d2623945389cf3b5c5552dda115b5e90de5198a9286861d

See more details on using hashes here.

Supported by

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