Giter Site home page Giter Site logo

upsilon.py's Introduction

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()

upsilon.py's People

Contributors

yaya-cout avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.