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.1.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.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: siremote-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6df171048612d3b6fb1873f94c617787efd7f7886537833ef8106b70e2a868f6
MD5 dc1c1f52e8e2b815b36f1621ace9f20b
BLAKE2b-256 ab420d9ea752c108d1fa79e85ef1c67d1ee74f918e669ea0e6b31e270e4ece25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: siremote-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a82467790dbae82f4ef74e19cfd59034f187b6b296f15adb7d51420b859c75ca
MD5 b14c00ddf9b39c4ed020aa81e2981b5a
BLAKE2b-256 9ac066edc1fdace00de7e9a5e748c1f5b8bce873e271d6e4693582dbc44dd5a8

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