Skip to main content

API for remote interaction with the Ninox360 Surface Inspector 3D scanner

Project description

Surface Inspector Remote Python Library + Demo

This library provides utilities for interacting with the Surface Inspector device through HTTP communication, handling tasks such as packet construction, server interaction, serialization and deserialization, image requests, and error handling.

Table of Contents

Requirements

  • Python 3.x
  • virtualenv

Demo Code Installation/Setup

1. Clone the Repository

git clone https://github.com/NINOX-360/Surface-Inspector-Remote
cd Surface-Inspector-Remote/Python

2. Set Up a Virtual Environment

It is recommended to use a virtual environment to manage dependencies. This ensures that the dependencies for this project do not interfere with other projects on your machine.

python3 -m venv venv

3. Activate the Virtual Environment

On macOS and Linux:

source venv/bin/activate

On Windows:

venv\Scripts\activate

4. Install Dependencies

Once the virtual environment is activated, install the required dependencies:

pip install -r requirements.txt

5. Run the project

pip install .

Then run:

run_python_demo

Make note: Prior to execution the server secret and server IP MUST be set manually by editing the demo code file.

Incorporate into Your Own Project

The easiest way to this library and install it using pip:

pip install SIRemote

Alternatively, you have the option to create a local library, adjusting your import statements accordingly.

1. Package the Library:

Create a setup.py file if it doesn't exist and include the necessary configurations.

2. Install the Library:

Navigate to the root directory of the library, Create a local package directory:

On macOS and Linux:

mkdir -p ~/python-packages

On Windows:

mkdir %USERPROFILE%\python-packages

3. Install the API to the target Directory:

On macOS and Linux:

pip install --target ~/python-packages .

On Windows:

pip install --target %USERPROFILE%\python-packages .

4. Set up venv in your project:

Within the new project, create your venv environment

On macOS and Linux:

python -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate

5. Set the installed library path:

On macOS and Linux:

echo 'export PYTHONPATH=$PYTHONPATH:~/python-packages' >> ~/.bashrc
source ~/.bashrc

On Windows:

setx PYTHONPATH "%PYTHONPATH%;%USERPROFILE%\python-packages"

6. Import the Library: Import the necessary modules in your project files:

from surface_inspector_remote.RemoteApi import RemoteAPI

Usage

Example Code

Here is an example of how to use the library:

import time
from surface_inspector_remote.RemoteApi import RemoteAPI


def main():
   api = RemoteAPI()
   server_secret = 'your_server_secret'
   url_base = 'https://localhost:3003'

   # Set the target URL
   api.set_ip(url_base)

   # Register the device
   api.send_register(server_secret)

   # Print the response
   print(f'Response Message: {api.request_response_msg()}')
   print(f'Response Status: {api.request_response_status()}')

   # start a scan
   api.send_start_scan()

   # sleep
   time.sleep(10)
   
   # stop the scan
   api.send_stop_scan()


if __name__ == "__main__":
   main()

Contributing

Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

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

siremote-1.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

siremote-1.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file siremote-1.1.0.tar.gz.

File metadata

  • Download URL: siremote-1.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for siremote-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0a5fae48fec1b80fc0344e579e8221bbe4708213146718330792b13bbe84a002
MD5 c2251c6bb4dc74334cb70954bd5b9fcf
BLAKE2b-256 6080283959c81ecedab3f86c9d30324cebd6e15bd41da52fe203a418accf5e18

See more details on using hashes here.

File details

Details for the file siremote-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: siremote-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for siremote-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10f3c54fdeb380655a40cf787d8b74a262bb6ee2a2b05503308bc71b3ab99fa2
MD5 d50a97c00ad1e8d55209dab17b9a94c1
BLAKE2b-256 bce6e190abaa9151357c4d197c6f536d332e07df16b4f1c260dee442857dbe32

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