Skip to main content

No project description provided

Project description

nlabapi

Crates.io PyPI - Version License

Documentation Cargo Test Python CI

Low-level software interface for nLab devices. Libraries for Python and Rust are available. The recommended easy way to access data straight from the nLab is the python interface, provided by the nlabapi python package.

Python Usage

  1. Install the nlabapi python package

On an existing python installation, use pip to install the nlabapi package

$ pip install nlabapi
  1. Test Import and Usage of nlabapi Entering the above one-liner python program using python -c should print a list of all connected nLabs.
$ python -c "import nlabapi; nlabapi.LabBench.list_all_nlabs()"
Link to nLab v2 [ available: true ]
  1. Write your own scripts, or use the examples
$ python examples/list_all_nlabs.py
List of all detected nScopes:
Link to nLab v2 [ available: true ]

Building from Source

The nLab API can be built and run from source to enable users and developers to quickly iterate on nLab source code. To establish a development environment, follow the steps below.

Prerequisites

  1. Rust Toolchain (https://rustup.rs)

After installing the development dependencies, check to make sure you have a working environment by running version commands for each of the required tools.

$ rustup --version

The above commands should print a version successfully.

Note - macOS specifics

On macOS the project is configured to build a universal binary, including both x86 and Apple Silicon binaries in one. To enable that, we must add both rust target toolchains as follows:

rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin

Note - Linux specifics

On linux distributions, we need the system library headers for libusb and libudev. To install these on an Ubuntu distribtion, the following command should work.

sudo apt-get install libusb-1.0-0-dev libudev-dev

On other distributions, developers should look to their package managers for these development headers.

Clone and Install Development Dependencies

$ git clone https://github.com/nLabs-nScope/nlabapi.git
$ cd nlabapi

Build and Run

$ cargo build
$ cargo run --example list_all_nscopes

Python Development

This project also supports a python interface to the nLab. To set up an environment for python development, follow the steps below.

Prerequisites

  1. All steps above
  2. A Python 3.9 or newer installation

Create a virtual environment and activate it

$ python3 -m venv venv
$ source venv/bin/activate

Install python dependencies

$ pip install maturin

Build and install the nlabapi package for developement

$ maturin develop
$ python examples/list_all_nlabs.py 

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

nlabapi-1.0.6.tar.gz (101.6 kB view details)

Uploaded Source

Built Distributions

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

nlabapi-1.0.6-cp310-abi3-win_amd64.whl (646.7 kB view details)

Uploaded CPython 3.10+Windows x86-64

nlabapi-1.0.6-cp310-abi3-win32.whl (594.9 kB view details)

Uploaded CPython 3.10+Windows x86

nlabapi-1.0.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nlabapi-1.0.6-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (1.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ i686

nlabapi-1.0.6-cp310-abi3-macosx_11_0_arm64.whl (747.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

nlabapi-1.0.6-cp310-abi3-macosx_10_12_x86_64.whl (767.1 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file nlabapi-1.0.6.tar.gz.

File metadata

  • Download URL: nlabapi-1.0.6.tar.gz
  • Upload date:
  • Size: 101.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for nlabapi-1.0.6.tar.gz
Algorithm Hash digest
SHA256 c0013874d41d0464eea25509190f1975ed8feb61b3dab9563ea708bba7c862d5
MD5 07db5bd3ac2df31a94bc45933a4bb670
BLAKE2b-256 6a63574194f9a2741c984679581293ca8899d34ee0b0763d948f05e1a12316cb

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: nlabapi-1.0.6-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 646.7 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dd991864ec8f369e041e825c4ea15cf41d617b6bf7adb1cb275b3a3bd3a9350e
MD5 dcd47b0a692f532984580d5802bde981
BLAKE2b-256 85675fef56f81d8824743b2dcc9c5e764d963fa8a8f95bf7f1c3306e024a1c0d

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-win32.whl.

File metadata

  • Download URL: nlabapi-1.0.6-cp310-abi3-win32.whl
  • Upload date:
  • Size: 594.9 kB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 9edf1cc8659857c919ba0ea12c0d8c93a4386336c2f89b350dde2cf7dc16dca2
MD5 9db65a5824e268b138134975707cf040
BLAKE2b-256 e6a2ffed8e78fc268dc28bd8ce3e82f9eae5eaee16a20f9cd591c0fa84d5f3d1

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b54f4398962b773cfd6990a02cffd6e7f09c222b32bf6e161ac6da57adea15b
MD5 6f934886c1c6fd8c4368894c1bbcdd3e
BLAKE2b-256 e11cef348f414abec6f5bcab77b9281bd3968bfba21cb17727edf846dcf6ca38

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bde87c70e20adef1cc46d004ce9221d731989ac0a64a4f73397204708e64688c
MD5 0c4d015093c912fa8e99c5e6ef9b8e26
BLAKE2b-256 ce14fbc3fe6280d36f36d0adc6822261795e6637ad6c0d8503c3d39d0876e854

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c92f22c9f7a016df4cde7defe45174630d81ea0dd54d72da6cd85012178a43da
MD5 bc3f46a15162a66423d8e0aa5fdb6235
BLAKE2b-256 22221295e3be823943215ba722c44159a945a6a5ad4d9ad04dda1140400ed67f

See more details on using hashes here.

File details

Details for the file nlabapi-1.0.6-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nlabapi-1.0.6-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6b888c7ba59e4fa63a577c986379d56675d299003e3ae636160373c8d4805c33
MD5 39d9bd73f1fe8b8aed61182131f321e3
BLAKE2b-256 c32e561e5c1eeb68eeaf7dc09ea04237d274613b689f0030593fcaf46da75fb3

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