Skip to main content

A friendly Python wrapper for the BOOXDrop API — unofficial, but built with care.

Project description

📖 pyBooxDrop

GitHub Actions Workflow Status - Unit Tests GitHub Actions Workflow Status - E2E Tests PyPI - Minimum Required Python Version PyPI - Version GitHub License

🐍 A friendly Python wrapper for the BOOXDrop API — unofficial, but built with care.
📚 Great if you want to manage files on your BOOX device programmatically, automate uploads/downloads, or plug it into your own tools and scripts.

✨ Features

  • Clean and consistent API client for BOOXDrop
  • Fully typed (with pydantic) and 100% modern Python 3.12+
  • No external HTTP dependency — bring your own client, if you will
  • HTTP client agnostic – plug in your own via simple HttpClient interface
  • Open-source, MIT-licensed, built with readability in mind
Supported endpoints
POST /api/1/users/sendVerifyCode
POST /api/1/users/signupByPhoneOrEmail
GET /api/1/users/syncToken

📦 Installation

pip install pybooxdrop

🚀 Quick start

from boox import Boox

# Given it is the very first connection, and no token is available:
with Boox(base_url="https://eur.boox.com") as client:
    payload = {"mobi": "foo@bar.com"}
    _ = client.users.send_verification_code(payload=payload)

# OR, if you don't want to use the context manager

client = Boox(base_url="https://eur.boox.com")
payload = {"mobi": "foo@bar.com"}
_ = client.users.send_verification_code(payload=payload)
client.close()

🔌 Custom HTTP client support

Boox lets you plug in your own HTTP client. To do this, implement a simple HttpClient protocol with the required methods and pass your adapter to Boox.

Example
import httpx
from boox import Boox, HttpClient

class MyAdapter(HttpClient):
    def post(self, url: str, json: dict | None = None) -> Any:
        # your logic using requests, httpx, or anything else
        ...

with Boox(client=MyAdapter(httpx.Client())) as boox: ...

Why? This gives you full control over things like:

  • ⏰ timeouts
  • ♻️ retries
  • 🧾 logging
  • 🌍 proxies or custom headers
  • 🔐 session/cookie handling

By design, Boox does not depend on any specific HTTP library. It only uses Python’s built-in urllib by default — you're free to use requests, httpx, or your own logic.


🧪 Testing

Running unit tests

# to run all but e2e tests do the following:
uv sync
uv run pytest

Alternatively, use:

make test

Running E2E tests

Please note that since the E2E tests are heavy, require real internet connection, and they connect with the real BOOXDrop server, it is not recommended to run them often.

# required environment variables:
# E2E_SMTP_EMAIL - the e-mail address on smtp.dev
# E2E_SMTP_X_API_KEY - the X-API-KEY for the account
# E2E_TARGET_DOMAIN - the target BOOXDrop domain, e.g. push.boox.com
uv sync
uv run pytest -m e2e --e2e

Alternatively, use:

make e2e
  • E2E_SMTP_EMAIL must lead to an e-mail that is connected to a real Boox account. It must be verified prior to the tests.
  • E2E_TARGET_DOMAIN is the domain that the Boox account is used with. AFAIK it can be any Boox' domain, because the account is not bound to any in particular. This might change in the future though, so I would rather play safe there.
  • X-API-KEY for SMTP.dev is required, as this is the client that is being used. Currently there are no plans to support other providers.

📮 Feedback

Got ideas, feedback, or feature requests? Feel free to open an issue or pull request!


👷 Contributing

Contributions are welcome!

  • Please fork the repository and create a branch for your feature or bugfix.
  • Use pytest to run tests and add new tests when applicable.
  • Follow the existing code style, checked by ruff, bandit and pyupgrade.
  • Open a pull request with a clear description of your changes.

🫶 Special thanks

Big thanks to hrw for the project onyx-send2boox. The project was the main inspiration behind this library. While pyBooxDrop is a fresh, focused take on just the API, this project wouldn’t exist without this awesome groundwork.

Thanks for the great job!


🪪 License

MIT – use it, hack it, ship it.

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

pybooxdrop-0.3.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

pybooxdrop-0.3.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file pybooxdrop-0.3.0.tar.gz.

File metadata

  • Download URL: pybooxdrop-0.3.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.3

File hashes

Hashes for pybooxdrop-0.3.0.tar.gz
Algorithm Hash digest
SHA256 87cf57d70e09e00333c9595fc3f55b10b48b1c7383ec996090991a6766d771b3
MD5 df64a0ec23994287c7ac234a8e8d1dec
BLAKE2b-256 cde0bf3b173a5f705fce18cba0d4757a34a589a9006a94848928e838ad26dcc2

See more details on using hashes here.

File details

Details for the file pybooxdrop-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pybooxdrop-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.3

File hashes

Hashes for pybooxdrop-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68c1c6e784ae7364eb9e87a32debb9a4423f16cc98f214bd6bd18d9d201b9654
MD5 ccfb21a0b555da6964f8496c3fa7b163
BLAKE2b-256 99ee27464488f2fe885ab3bf633bafa3a655ef29e22a4189c3bce2c4948c1e2a

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