Skip to main content

nurapy

PyPI - Version PyPI - Python Version OS ARCH


Pure Python driver for NordicID UHF RFID readers

Table of Contents

Installation

pip install nurapy

Usage

Connect to the reader

# Create driver
reader = NurAPY()

# Connect
reader.connect(connection_string='COM8')

# Check connection status
if not reader.ping():
    logging.error('Could not connect to NURAPY')
    exit()

... use the reader ...

# Disconnect reader
reader.disconnect()

Get basic information about the reader

## GET INFO
reader_mode = reader.get_mode()
reader_info = reader.get_reader_info()
device_caps = reader.get_device_capabilities()
current_setup = reader.get_module_setup(setup_flags=[
    ModuleSetupFlags.ALL
])

Sample response values:

reader_mode = Mode.APPLICATION

reader_info = NurReaderInfo(serial='K134500382', alt_serial='K134700326', name='STIX', fcc_id='', hw_version='PWM00226', sw_version='5.10.A', dev_build=None, num_gpio=None, num_sensors=0, num_regions=21, num_antennas=1, max_antennas=1)

device_caps = NurDeviceCaps(dwSize=40, flagSet1=15696847, flagSet2=0, maxTxdBm=27, txAttnStep=1, maxTxmW=500, txSteps=20, szTagBuffer=630, curCfgMaxAnt=1, curCfgMaxGPIO=0, chipVersion=<ReaderChipVersion.AS3993: 2>, moduleType=<ModuleType.NUR_L2_05W: 3>, moduleConfigFlags=4)

current_setup = ModuleSetup(link_freq=<ModuleSetupLinkFreq.BLF_256: 256000>, rx_decoding=<ModuleSetupRxDec.MILLER_4: 2>, tx_level=0, tx_modulation=<ModuleSetupTxMod.PRASK: 1>, region_id=<ModuleSetupRegion.EU: 0>, inventory_q=2, inventory_session=0, inventory_rounds=0, antenna_mask=1, scan_single_trigger_timeout=500, inventory_trigger_timeout=1000, selected_antenna=0, op_flags=2, inventory_target=<ModuleSetupInvTarget.AB: 2>, inventory_epc_length=255, write_rssi_filter=NurRssiFilter(min=0, max=0), inventory_rssi_filter=NurRssiFilter(min=0, max=0), read_to=500, write_to=500, lock_to=500, kill_to=500, period_setup=<ModuleSetupPowerSave.NOT_IN_USE: 0>, ant_power=[0, -1, -1, -1], power_offset=[-1, 0, 0, 0], antenna_mask_ex=256, autotune=NurAutoTuneSetup(mode=0, threshold_dBm=3), ant_power_ex=[-10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], rx_sensitivity=<ModuleSetupRxSens.NOMINAL: 0>)

Configure the reader

## MODULE SETUP
new_setup = ModuleSetup()
new_setup.link_freq = ModuleSetupLinkFreq.BLF_256
new_setup.rx_decoding = ModuleSetupRxDec.MILLER_4
new_setup.tx_level = 0
new_setup.antenna_mask = 1
new_setup.selected_antenna = 0
updated_setup = reader.set_module_setup(setup_flags=[
    ModuleSetupFlags.LINKFREQ,
    ModuleSetupFlags.RXDEC,
    ModuleSetupFlags.TXLEVEL,
    ModuleSetupFlags.ANTMASK,
    ModuleSetupFlags.SELECTEDANT
], module_setup=new_setup)

Perform single synchronous inventory

# Trigger a simple inventory
inventory_response = reader.simple_inventory()
if inventory_response.tags_in_memory:
    # Get data of read tags
    tags = reader.get_id_buffer_with_metadata(clear=True)
    logging.info(tags)

Perform continuous asynchronous inventory

def my_notification_callback(inventory_stream_notification: InventoryStreamNotification,
                             notified_tags: List[NurTagDataMeta]):
    # If stream stopped, restart
    if inventory_stream_notification.stopped:
        logging.info('Restarting inventory stream')
        reader.start_inventory_stream()
    for tag in notified_tags:
        logging.info(tag)
    reader.clear_notified_tags()


# Configure the callback
reader.set_notification_callback(my_notification_callback)

# Start inventory stream
reader.start_inventory_stream()

# Do other stuff
time.sleep(1)

# Stop inventory stream
reader.stop_inventory_stream()

Sample report:

inventory_stream_notification = InventoryStreamNotification(stopped=False, rounds=2, collisions=0, last_q=2)

notified_tags = [NurTagDataMeta(rssi=-51, scaled_rssi=93, timestamp=5, frequency=866300, pc=13312, channel=1, antenna_id=0, epc=bytearray(b'Q\x10\x12\x03(\x000\x00\x00\x00V\x04'))]

License

nurapy is distributed under the terms of the MIT license.

Metadata

Release files for nurapy 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nurapy 1.1.1
File Size Uploaded Provenance Actions
nurapy-1.1.1.tar.gz 17.8 kB Without provenance Details for nurapy-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nurapy 1.1.1
File Interpreter ABI Platform Actions
nurapy-1.1.1-py3-none-any.whl Python 3 none any Details for nurapy-1.1.1-py3-none-any.whl

Total release size: 37.2 kB

Release files / nurapy-1.1.1.tar.gz

Download URL nurapy-1.1.1.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8533c90ff2c83c6fc243021129ea55a96837547650d300ea71683a4b41881913
BLAKE2b-256 checksum
How to use checksums
ed24217140244844ae3f4833c3225b7f398b980ced55dbbfe0bbe37116f5ebd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / nurapy-1.1.1-py3-none-any.whl

Download URL nurapy-1.1.1-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2a8c83a0dcfda5d87a2fc83dfb754d16043ef3a5d782b625b4bb5a9dd425174
BLAKE2b-256 checksum
How to use checksums
48d04c7b20ee41fde4e30fa3741277f8c4414cb2d63369b78fbfce1e89b4605b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for nurapy 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page