Skip to main content

Connect to NumWorks calculators using Python

Project description

Upsilon.py

Upsilon.py is a wrapper for upsilon.js. It allow controlling the NumWorks from Python. To use this library, because of the dependency on Upsilon.js, you will need a working installation of Node with Npm

Installation

To install Upsilon.py, you can use pip:

python3 -m pip install upsilon.py

After the installation, you will have to install Upsilon.js and its dependencies:

npm install -g "upsilon.js@^1.4.1" usb

Usage

To use Upsilon.py, you will need to import it:

import upsilon_py

Then, you can create a new NumWorks object:

numworks = upsilon_py.NumWorks()

You will then be able to start the object and connect to the NumWorks:

await numworks.start()
await numworks.connect()

Now, the connection is established, you can send commands to the NumWorks:

# Get the status of the NumWorks (connected/disconnected)
status = await numworks.status()
print("Status:", status)

# Get the model of the NumWorks (return 100/110/120)
model = await numworks.get_model()
print("Model:", model)

# Get the platform info of the NumWorks (information about the OS)
platform_info = await numworks.get_platform_info()
print("Platform info:", platform_info)

# Backup the storage of the NumWorks
storage = await numworks.backup_storage()

# Add a file to the storage
storage["records"].append({
    "name": "Test",
    "type": "py",
    "autoImport": True,
    "code": "print(\"Hello World!\")"
})

# Install the modified storage
await numworks.install_storage(storage)

# Stop the object (you can also use numworks.disconnect() to keep the object
# running and connect to another NumWorks)
await numworks.stop()

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

upsilon_py-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

upsilon_py-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file upsilon_py-1.0.0.tar.gz.

File metadata

  • Download URL: upsilon_py-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for upsilon_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 928aa52006dd6bc1f214e085f8b42b6d5624406c2e60557aea45f0777c5c858e
MD5 9dd051dd340d9b35eb82727265137b28
BLAKE2b-256 d461bbc2c4c73feb2162885972b34921c8c28f544806507e4daa1729e58fa25b

See more details on using hashes here.

File details

Details for the file upsilon_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: upsilon_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for upsilon_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 062f5e0c86b35091007b41ddcad80332fba8ab120fed1806ea9bca2445bcbd9f
MD5 ee8388499a8237336c25d1a9b6129f80
BLAKE2b-256 186f61760af13f56055638598efccc804c346bfc7b76678cc59d54ea888c3932

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