---
title: Python Library
description: A guide for installing and using the Notecard Python library, known as note-python.
source_url: https://dev.blues.io/tools-and-sdks/firmware-libraries/python-library/
canonical_url: https://dev.blues.io/tools-and-sdks/firmware-libraries/python-library/
markdown_url: https://dev.blues.io/tools-and-sdks/firmware-libraries/python-library.md
---

# Python Library

[note-python](https://github.com/blues/note-python) is the official Python library for communicating with the Notecard over serial or I2C. This library works in a desktop setting, on single-board computers like the Raspberry Pi, and on microcontrollers with MicroPython or CircuitPython support.

> **Note:**
>
> This library is supported in Python 3.9 and above. The library may work, but is not supported, in Python 2.x environments.

## Installation

### PC and Single-Board Computer Use

With `pip` via [PyPi](https://pypi.org/project/note-python/):

```bash
pip install note-python
```

or

```bash
pip3 install note-python
```

### CircuitPython & MicroPython

For use with MicroPython or CircuitPython, clone the [note-python](https://github.com/blues/note-python) repo to your computer. Then, copy the contents of the `notecard` directory into the `lib` directory of your device.

## Usage

To use `note-python`, start by importing it at the top of any Python file.

```python
import notecard
```

The `note-python` library requires a pointer to a serial or i2c object that you initialize and pass into the library. This object differs based on your platform or device.

### PC & Single-Board Computer Configuration

To communicate with the Notecard from a PC or Single-Board Computer, you'll need to first install a library for the interface you plan to use: [`python-periphery`](https://pypi.org/project/python-periphery/) for I2C, and [`pyserial`](https://pypi.org/project/pyserial/) for serial.

```bash
pip install python-periphery pyserial
```

#### Serial Configuration

To initialize the Notecard over Serial, configure a PySerial Serial object and use the `OpenSerial` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use pySerial on a PC or SBC
import serial
port = serial.Serial("/dev/serial0", 9600)

nCard = notecard.OpenSerial(port)
```

#### I2C Configuration

To initialize the Notecard over I2C, configure a Periphery I2C object and use the `OpenI2C` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use python-periphery on a PC or SBC
from periphery import I2C
port = I2C("/dev/i2c-1")

nCard = notecard.OpenI2C(port, 0, 0)
```

`OpenI2C` takes two positional arguments after the port: the Notecard's I2C `address` and the maximum I2C transfer size (`max_transfer`), in bytes. Passing `0` for either one tells the library to use its default: `0x17` for the address and `255` bytes for the transfer size. Pass explicit values only if you have [changed the Notecard's I2C address](https://dev.blues.io/notecard/notecard-walkthrough/advanced-notecard-configuration.md#change-the-notecard-i2c-address) or need to work within a smaller transfer size on a constrained host.

### CircuitPython Configuration

Both Serial and I2C are accessible in CircuitPython using the built-in `busio` and `board` modules, which should be imported at the top of your Python file.

```python
import board
import busio
```

#### Serial Configuration

To initialize the Notecard over Serial, configure a `busio` UART object with the `TX` and `RX` pins on the device, and use the `OpenSerial` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use busio on a CircuitPython Device
port = busio.UART(board.TX, board.RX, baudrate=9600)

nCard = notecard.OpenSerial(port)
```

#### I2C Configuration

To initialize the Notecard over I2C, configure a `busio` I2C object with the `SCL` and `SDA` pins on the device, and use the `OpenI2C` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use busio on a CircuitPython Device
port = busio.I2C(board.SCL, board.SDA)

nCard = notecard.OpenI2C(port, 0, 0)
```

### MicroPython Configuration

Both Serial and I2C are accessible in MicroPython using the built-in `machine` library.

#### Serial Configuration

To initialize the Notecard over Serial, configure a `machine` UART object and use the `OpenSerial` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use busio on a MicroPython Device
from machine import UART
port = UART(2, 9600)
port.init(9600, bits=8, parity=None, stop=1)

nCard = notecard.OpenSerial(port)
```

#### I2C Configuration

To initialize the Notecard over I2C, configure a `machine` I2C object and use the `OpenI2C` method. This method returns a `notecard` object that can be used to perform Notecard requests.

```python
# Use busio on a MicroPython Device
from machine import I2C
port = I2C()

nCard = notecard.OpenI2C(port, 0, 0)
```

### Debug Mode

If you're connected to a Python terminal, you can put the Notecard library in debug mode, which will output raw JSON requests and responses. Set `debug` to `True` when initializing the Notecard with `OpenSerial` or `OpenI2C`:

```python
nCard = notecard.OpenI2C(port, 0, 0, debug=True)
```

### Sending Notecard Requests

Whether using Serial or I2C, sending Notecard requests and reading responses follows the same pattern:

1. Create a JSON object that includes a [valid Notecard API Request](https://dev.blues.io/api-reference/notecard-api.md).

2. Call one of the `notecard` methods and pass in the request JSON object.

3. If you called a method that returns a response, make sure the response contains the data you need.

```python
# Construct a JSON Object to add a Note to the Notecard
req = {"req": "note.add"}
req["body"] = {"temp": 18.6}

rsp = nCard.Transaction(req)
print(rsp) # {"total":1}
```

### `notecard` Methods

The `notecard` object returned by `OpenSerial` and `OpenI2C` provides two methods for performing requests, depending on whether you need a response from the Notecard.

1. **`Transaction()`** should be used if you need a response from the Notecard after a request is executed. All requests made with this method should include the `req` key.

   ```python
   req = {"req": "card.status"}

   rsp = nCard.Transaction(req)
   print(rsp)
   ```

2. **`Command()`** should be used if you do **not** need a response from the Notecard after a request is executed. All requests made with this method should include the `cmd` key.

   ```python
   cmd = {"cmd": "hub.sync"}

   nCard.Command(cmd)
   ```

### Using the Library Fluent API

The `notecard` class allows complete access to the [Notecard API](https://dev.blues.io/api-reference/notecard-api.md) via manual JSON object construction and the `Transaction`, `Command` methods. Alternatively, you can import one or more Fluent API helpers to work with common aspects of the Notecard API without having to author JSON objects by hand.

> **Note:**
>
> Not all aspects of the Notecard API are available using these helpers. For a complete list of supported helpers, see the [detailed reference below](#detailed-reference).

Here's an example that uses the `hub` helper to set the Notecard Product UID in CircuitPython:

```python
import board
import busio

import notecard
from notecard import hub

port = busio.I2C(board.SCL, board.SDA)
nCard = notecard.OpenI2C(port, 0, 0, debug=True)

productUID = "com.your-company.your-name:your_product"
rsp = hub.set(nCard, productUID, mode="continuous", sync=True)

print(rsp) # {}
```

## Examples

We provide a number of examples for using `note-python` with Python on a Raspberry Pi, CircuitPython, or MicroPython.

- [Notecard Basics](https://github.com/blues/note-python/tree/main/examples/notecard-basics)
  - Examples for connecting to a Notecard over I2C, using a Raspberry Pi, using CircuitPython, and more.
- [Reading and Syncing Sensor Data with the Notecard](https://github.com/blues/note-python/tree/main/examples/sensor-tutorial)
  - Use Python on a Raspberry Pi, or CircuitPython, to read from a BME680 sensor and sync those values with the cloud.
- [Writing Binary Data to the Notecard](https://github.com/blues/note-python/tree/main/examples/binary-mode)
  - This example writes an array of bytes to the binary data store on a Notecard and reads them back.
- [Python Notecard DFU](https://github.com/blues/note-samples/tree/main/python-dfu)
  - Shows how to use the Notecard to update a Python application running on a Raspberry Pi.
- [Python Large File Upload](https://github.com/blues/note-samples/tree/main/python-large-file-upload)
  - Shows how to use the Notecard to upload a large file using the `card.binary` API and the Notecard Web request API.
- [Python Raspberry Pi ATTN Pin](https://github.com/blues/note-samples/tree/main/python-remote-commands-attn-rpi)
  - Example Raspberry Pi application that enables users to send commands to Raspberry Pi from Notehub using the ATTN Pin on the Notecard.

## Detailed Reference

### Library Classes

| Class                                   | Usage                       | Description                                                                       |
| --------------------------------------- | --------------------------- | --------------------------------------------------------------------------------- |
| [`notecard`](#notecard-class-reference) | `import notecard`           | Main Library class for initializing Notecard connections and performing requests. |
| [`card`](#card-class-reference)         | `from notecard import card` | Fluent API Class for `card.*` requests.                                           |
| [`env`](#env-class-reference)           | `from notecard import env`  | Fluent API Class for `env.*` requests.                                            |
| [`file`](#file-class-reference)         | `from notecard import file` | Fluent API Class for `file.*` requests.                                           |
| [`hub`](#hub-class-reference)           | `from notecard import hub`  | Fluent API Class for `hub.*` requests.                                            |
| [`note`](#note-class-reference)         | `from notecard import note` | Fluent API Class for `note.*` requests.                                           |

## notecard Class Reference

### Members

| Member                                          | Description                                                                                      |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `def serialReadByte(port)`                      | Read a single byte from a Notecard. *Internal method utilized by class methods.*                 |
| `def serialReset(port)`                         | Send a reset command to a Notecard. *Internal method utilized by class methods.*                 |
| `def serialTransaction(port,req,debug)`         | Perform a single write to and read from a Notecard. *Internal method utilized by class methods.* |
| `def serialCommand(port,req,debug)`             | Perform a single write to and read from a Notecard. *Internal method utilized by class methods.* |
| `class `[`notecard::Notecard`](#notecard-class) | Base Notecard class.                                                                             |
| `class `[`notecard::OpenI2C`](#openi2c-class)   | Notecard class for I2C communication.                                                            |
| `class `[`notecard::OpenSerial`](#openserial)   | Notecard class for Serial communication.                                                         |

### Notecard Class

Base Notecard class. Provides a shared **init** to reset the Notecard via Serial or I2C.

| Method                      | Description                              |
| --------------------------- | ---------------------------------------- |
| `public def __init__(self)` | Initialize the Notecard through a reset. |

### OpenI2C Class

Notecard subclass for I2C communication.

| Member                                                     | Description                                                                                                |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `public i2c`                                               | An instance of the host (PC, MCU) I2C bus controller.                                                      |
| `public addr`                                              | The I2C Address to use for Notecard communications.                                                        |
| `public max`                                               | Maximum length of I2C data segments.                                                                       |
| `public def __init__(self,i2c,address,max_transfer,debug)` | Initialize the Notecard over I2C.                                                                          |
| `public def `[`Transaction`](#transaction)`(self,req)`     | Perform a Notecard transaction and return the result.                                                      |
| `public def `[`Command`](#command)`(self,req)`             | Perform a Notecard command and exit with no response.                                                      |
| `public def `[`Reset`](#reset)`(self)`                     | Reset the Notecard.                                                                                        |
| `public def lock(self)`                                    | Lock the I2C port so the host can interact with the Notecard. *Internal method utilized by class methods.* |
| `public def unlock(self)`                                  | Unlock the I2C port. *Internal method utilized by class methods.*                                          |

#### `__init__`

Initialize the Notecard over I2C.

```python
from periphery import I2C
port = I2C("/dev/i2c-1")

nCard = notecard.OpenI2C(port, 0, 0, debug=True)
```

#### Transaction

Perform a Notecard transaction and return the result.

```python
req = {"req": "note.add"}
req["body"] = {"temp": 18.6}

rsp = nCard.Transaction(req)
print(rsp) # {"total":1}
```

#### Command

Perform a Notecard command and exit with no response.

```python
req = {"cmd": "note.add"}
req["body"] = {"temp": 18.6}

nCard.Command(req)
```

#### Reset

Reset the Notecard.

```python
nCard.Reset()
```

### OpenSerial

Notecard class for Serial communication.

| Members                                                       | Descriptions                                                                        |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `public uart`                                                 | An instance of the host (PC, MCU) UART bus controller.                              |
| `public lock`                                                 | A filelock object for locking access to the Serial port in a PC or SBC environment. |
| `public def __init__(self,uart_id,debug)`                     | Initialize the Notecard before a reset.                                             |
| `public def `[`Transaction`](#serial-transaction)`(self,req)` | Perform a Notecard transaction and return the result.                               |
| `public def `[`Command`](#serial-command)`(self,req)`         | Perform a Notecard command and exit with no response.                               |
| `public def `[`Reset`](#serial-reset)`(self)`                 | Reset the Notecard.                                                                 |

#### `__init__`

Initialize the Notecard over Serial.

```python
import serial
port = serial.Serial("/dev/serial0", 9600)

nCard = notecard.OpenSerial(port, debug=True)
```

#### Serial Transaction

Perform a Notecard transaction and return the result.

```python
req = {"req": "note.add"}
req["body"] = {"temp": 18.6}

rsp = nCard.Transaction(req)
print(rsp) # {"total":1}
```

#### Serial Command

Perform a Notecard command and exit with no response.

```python
req = {"cmd": "note.add"}
req["body"] = {"temp": 18.6}

nCard.Command(req)
```

#### Serial Reset

Reset the Notecard.

```python
nCard.Reset()
```

## card Class Reference

### Public Methods

| Method                                                                          | Description                                                     |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `public def `[`card.attn`](#card-attn)`(card,mode,files,seconds,payload,start)` | Configure interrupt detection between a host and Notecard.      |
| `public def `[`card.time`](#card-time)`(card)`                                  | Retrieve the current time and date from the Notecard.           |
| `public def `[`card.status`](#card-status)`(card)`                              | Retrieve the status of the Notecard.                            |
| `public def `[`card.temp`](#card-temp)`(card,minutes)`                          | Retrieve the current temperature from the Notecard.             |
| `public def `[`card.version`](#card-version)`(card)`                            | Retrieve firmware version information from the Notecard.        |
| `public def `[`card.voltage`](#card-voltage)`(card,hours,offset,vmax,vmin)`     | Retrieve current and historical voltage info from the Notecard. |
| `public def `[`card.wireless`](#card-wireless)`(card,mode,apn)`                 | Retrieve wireless modem info or customize modem behavior.       |
| `public def `[`card.transport`](#card-transport)`(card,method,allow)`           | Configure the Notecard's connectivity method.                   |

### card.attn()

Configure interrupt detection between a host and Notecard. See [`card.attn` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-attn).

```python
rsp = card.attn(nCard,
                mode="arm, files",
                files=["data.qi"])

print(rsp)
```

### card.time()

Retrieve the current time and date from the Notecard. See [`card.time` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-time).

```python
rsp = card.time(nCard)

print(rsp)
```

### card.status()

Retrieve the status of the Notecard. See [`card.status` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-status).

```python
rsp = card.status(nCard)

print(rsp)
```

### card.temp()

Retrieve the current temperature from the Notecard. See [`card.temp` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-temp).

```python
rsp = card.temp(nCard, minutes=10)

print(rsp)
```

### card.version()

Retrieve firmware version information from the Notecard. See [`card.version` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-version).

```python
rsp = card.version(nCard)

print(rsp)
```

### card.voltage()

Retrieve current and historical voltage info from the Notecard. See [`card.voltage` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-voltage).

```python
rsp = card.voltage(nCard,
                   hours=120,
                   offset=24,
                   vmax=4.3,
                   vmin=2.7)

print(rsp)
```

### card.wireless()

Retrieve wireless modem info or customize modem behavior. See [`card.wireless` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-wireless).

```python
rsp = card.wireless(nCard, mode="nb")

print(rsp)
```

### card.transport()

Configure the Notecard's connectivity method. See [`card.transport` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-transport).

```python
rsp = card.transport(nCard, method="wifi-cell-ntn")

print(rsp)
```

## env Class Reference

### Public Methods

| Method                                                       | Description                                                             |
| ------------------------------------------------------------ | ----------------------------------------------------------------------- |
| `public def `[`env.default`](#env-default)`(card,name,text)` | Perform an env.default request against a Notecard.                      |
| `public def `[`env.get`](#env-get)`(card,name)`              | Perform an env.get request against a Notecard.                          |
| `public def `[`env.modified`](#env-modified)`(card)`         | Perform an env.modified request against a Notecard.                     |
| `public def `[`env.set`](#env-set)`(card,name,text)`         | Perform an env.set request against a Notecard (this API is deprecated). |

### env.default()

Perform an `env.default` request against a Notecard. See [`env.default` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/env-requests.md#env-default)

```python
rsp = env.default(nCard,
                  name="monitor-pump",
                  text="true")

print(rsp)
```

### env.get()

Perform an `env.get` request against a Notecard. See [`env.get` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/env-requests.md#env-get)

```python
rsp = env.get(nCard,
              name="monitor-pump")

print(rsp)
```

### env.modified()

Perform an `env.modified` request against a Notecard. See [`env.modified` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/env-requests.md#env-modified)

```python
rsp = env.modified(nCard)

print(rsp)
```

### env.set()

> **Warning:**
>
> The `env.set` API is deprecated as of v7.2.2. We recommend setting environment variables in Notehub using either the Notehub user interface or [Notehub API](https://dev.blues.io/api-reference/notehub-api.md). You may also use the `env.default` API to provide a default value for an environment variable, until that variable is overridden by a value from Notehub.

Perform an `env.set` request against a Notecard. See [`env.set` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/env-requests.md#env-set)

```python
rsp = env.set(nCard,
              name="monitor-pump",
              text="false")

print(rsp)
```

## file Class Reference

### Public Methods

| Method                                                             | Description                                         |
| ------------------------------------------------------------------ | --------------------------------------------------- |
| `public def `[`file.changes`](#file-changes)`(card,tracker,files)` | Perform individual or batch queries on Notefiles.   |
| `public def `[`file.delete`](#file-delete)`(card,files)`           | Delete individual notefiles and their contents.     |
| `public def `[`file.pendingChanges`](#file-pendingchanges)`(card)` | Retrieve information about pending Notehub changes. |
| `public def `[`file.stats`](#file-stats)`(card)`                   | Obtain statistics about local notefiles.            |

### file.changes()

Perform individual or batch queries on Notefiles. See [`file.changes` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/file-requests.md#file-changes).

```python
rsp = file.changes(nCard,
                   tracker="multi-file-tracker",
                   files=["my-settings.db", "other-settings.db"])

print(rsp)
```

### file.delete()

Delete individual notefiles and their contents. See [`file.delete` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/file-requests.md#file-delete)

```python
rsp = file.delete(nCard,
                  files=["my-settings.db"])

print(rsp)
```

### file.pendingChanges

Retrieve information about pending Notehub changes. See [`file.changes.pending` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/file-requests.md#file-changes-pending).

```python
rsp = file.pendingChanges(nCard)

print(rsp)
```

### file.stats()

Obtain statistics about local notefiles. See [`file.stats` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/file-requests.md#file-stats)

```python
rsp = file.stats(nCard)

print(rsp)
```

## hub Class Reference

### Public Methods

| Method                                                                                                                   | Description                                            |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| `public def `[`hub.get`](#hub-get)`(card)`                                                                               | Retrieve the current Notehub configuration parameters. |
| `public def `[`hub.log`](#hub-log)`(card,text,alert,sync)`                                                               | Send a log request to the Notecard.                    |
| `public def `[`hub.set`](#hub-set)`(card,product,sn,mode,outbound,inbound, duration,sync,align,voutbound,vinbound,host)` | Configure Notehub behavior on the Notecard.            |
| `public def `[`hub.status`](#hub-status)`(card)`                                                                         | Retrieve the status of the Notecard's connection.      |
| `public def `[`hub.sync`](#hub-sync)`(card)`                                                                             | Initiate a sync of the Notecard to Notehub.            |
| `public def `[`hub.syncStatus`](#hub-syncstatus)`(card,sync)`                                                            | Retrieve the status of a sync request.                 |

#### hub.get()

Retrieve the current Notehub configuration parameters. See [`hub.get` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-get).

```python
rsp = hub.get(nCard)

print(rsp)
```

### hub.log()

Send a log request to the Notecard. See [`hub.log` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-log).

```python
rsp = hub.log(nCard,
              text="something is wrong!",
              alert=True,
              sync=True)

print(rsp)
```

### hub.set()

Configure Notehub behavior on the Notecard. See [`hub.set` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-set)

```python
rsp = hub.set(nCard,
              mode="continuous",
              outbound=30,
              inbound=120,
              duration=240,
              sync=True)

print(rsp)
```

### hub.status()

Retrieve the status of the Notecard's connection. See [`hub.status` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-status).

```python
rsp = hub.status(nCard)

print(rsp)
```

### hub.sync()

Initiate a sync of the Notecard to Notehub. See [`hub.sync` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-sync).

```python
rsp = hub.sync(nCard)

print(rsp)
```

### hub.syncStatus()

Retrieve the status of a sync request. See [`hub.sync.status` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/hub-requests.md#hub-sync-status).

```python
rsp = hub.syncStatus(nCard, sync=True)

print(rsp)
```

## note Class Reference

### Public Methods

| Method                                                                                              | Description                                       |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `public def `[`note.add`](#note-add)`(card,file,body,payload,sync,port)`                            | Add Note to a Notefile.                           |
| `public def `[`note.changes`](#note-changes)`(card,file,tracker,maximum,start,stop,deleted,delete)` | Incrementally retrieve changes within a Notefile. |
| `public def `[`note.delete`](#note-delete)`(card,file,note_id)`                                     | Delete a DB note in a Notefile by its ID.         |
| `public def `[`note.get`](#note-get)`(card,file,note_id,delete,deleted)`                            | Retrieve a note from an inbound or DB Notefile.   |
| `public def `[`note.template`](#note-template)`(card,file,body,length,port,compact)`                | Create a template for new Notes in a Notefile.    |
| `public def `[`note.update`](#note-update)`(card,file,note_id,body,payload)`                        | Update a note in a DB Notefile by ID.             |

### note.add()

Add a Note to a Notefile. See [`note.add` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-add).

```python
rsp = note.add(nCard,
               file="sensors.qo",
               body={"temp":72.22},
               sync=True)

print(rsp)
```

### note.changes()

Incrementally retrieve changes within a Notefile. See [`note.changes` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-changes).

```python
rsp = note.changes(nCard,
                   file="my-settings.db",
                   tracker="inbound-tracker",
                   start=True)

print(rsp)
```

### note.delete()

Delete a DB note in a Notefile by its ID. See [`note.delete` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-delete).

```python
rsp = note.delete(nCard,
                 file="my-settings.db",
                 note_id="measurements")

print(rsp)
```

### note.get()

Retrieve a note from an inbound or DB Notefile. See [`note.get` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-get).

```python
rsp = note.get(nCard,
              file="requests.qi",
              )

print(rsp)
```

### note.template()

Create a template for new Notes in a Notefile. See [`note.template` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-template).

```python
rsp = note.template(nCard,
                   file="readings.qo",
                   body={"new_vals": True,"temperature": 1.1,"humidity": 1,"pump_state": "aaaa"},
                   length=32)

print(rsp)
```

### note.update()

Update a note in a DB Notefile by ID. See [`note.update` in the Notecard API Reference](https://dev.blues.io/api-reference/notecard-api/note-requests.md#note-update).

```python
rsp = note.update(nCard,
                  file="my-settings.db",
                  note_id="measurements",
                  body={"internal":60})

print(rsp)
```
