Skip to main content

Python packaging wrapper for the vendored @yxim/nim-bot Node.js SDK

Project description

yxim-nim-bot

yxim-nim-bot packages the Node.js SDK @yxim/nim-bot as a Python distribution.

This is a wrapper package, not a source-to-source port. The Python package vendors:

  • @yxim/nim-bot@10.9.81
  • ws

and provides:

  • Python helpers to locate the vendored Node.js entrypoint
  • a small runtime wrapper that launches node
  • a CLI for running inline JavaScript or external .mjs scripts with the SDK preloaded

Requirements

  • Python 3.10+
  • Node.js 20+

The SDK itself still runs in Node.js. This package only makes it distributable through pip.

Install

pip install .

Python API

from yxim_nim_bot import NimBotRuntime

runtime = NimBotRuntime()

result = runtime.eval(
    """
    const nim = nimModule.default ?? nimModule;
    return Object.keys(nim).slice(0, 10);
    """,
    json_output=True,
)

print(result.stdout)

Useful helpers:

from yxim_nim_bot import package_root, entrypoint, node_binary

CLI

Show vendored paths:

yxim-nim-bot paths

Evaluate inline JavaScript with nim and nimModule injected:

yxim-nim-bot eval "return Object.keys(nim).slice(0, 3)" --json

Run an external script:

yxim-nim-bot run ./demo.mjs -- foo bar

When using run, the bootstrap injects:

  • globalThis.nim
  • globalThis.nimModule
  • globalThis.nimArgs
  • process.env.YXIM_NIM_BOT_ENTRY
  • process.env.YXIM_NIM_BOT_PACKAGE_ROOT

So a script can use either:

const nim = globalThis.nim;

or:

const nimModule = await import(process.env.YXIM_NIM_BOT_ENTRY);
const nim = nimModule.default ?? nimModule;

Package layout

The vendored Node.js dependencies live under:

src/yxim_nim_bot/_vendor/node_modules/

This keeps Node's normal module resolution working for the SDK's ws dependency.

Notes

  • This package does not try to wrap the full SDK surface into native Python classes.
  • It is intended for Python projects that still want to execute the official Node.js SDK.
  • If you need a true Python-native SDK, the Node.js logic has to be reimplemented.

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

yxim_nim_bot-10.9.81.1b1.tar.gz (389.8 kB view details)

Uploaded Source

Built Distribution

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

yxim_nim_bot-10.9.81.1b1-py3-none-any.whl (432.1 kB view details)

Uploaded Python 3

File details

Details for the file yxim_nim_bot-10.9.81.1b1.tar.gz.

File metadata

  • Download URL: yxim_nim_bot-10.9.81.1b1.tar.gz
  • Upload date:
  • Size: 389.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yxim_nim_bot-10.9.81.1b1.tar.gz
Algorithm Hash digest
SHA256 a0a65381e80acf54cf6dd4628481bd6304fda6ed8003be230871b3c223714110
MD5 8caa4d18e95188d1abf520605df1dcef
BLAKE2b-256 5792549ed4c9b7063bb365bdd77171a3a1e80425bcff7ab14d0b330aeaf095ba

See more details on using hashes here.

File details

Details for the file yxim_nim_bot-10.9.81.1b1-py3-none-any.whl.

File metadata

  • Download URL: yxim_nim_bot-10.9.81.1b1-py3-none-any.whl
  • Upload date:
  • Size: 432.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yxim_nim_bot-10.9.81.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 07c96b056fe100e7d02c76d5ca7dbd69f4cd32dec241e61cabf6011428797b7f
MD5 a1e621e9e760b43ac6e5c9e1dfe24168
BLAKE2b-256 97e5a0d1dcb8ac8283973c61cf38e2e9733d996e7d2425c4168374176d344102

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