This lesson is being piloted (Beta version)

DUNE HWDB Training: QuickStart on the Python HWDB Upload Tool




This page describes a quick-start guide on the Python HWDB Upload Tool with a single example. We emphasize that the method described in this page is not the only way to employ the Tool. There are other ways with various helpful options that are described here.


With the example provided in this page, you will be able to:

Getting ready

Installing the Tool:

Configuring the Tool:

If everything is setup correctly, you should see a screen similar to the one below. configured screen Notice that the REST API base path points to the development version of the HWDB, which is the default setup. When you are ready to work with the official Production server, enter:

hwdb-configure --prod 

Likewise, to set it back to Development, enter:

hwdb-configure --dev 

Configuring a Component Type and a Test Type in the HWDB:



Uploading contents to the HWDB

Understanding the basic concept:

We’ll start to look at the example spreadsheet file first and understand our contents. We’ll then go through the docket file to see how it works, including setting up the database schema for Specifications.

QuickStartExample.xlsx: “My Items” sheet:

A B C D E
1 Serial Number Comments Drawing Number MySubComp 1 MySubComp 2
2 HA-MURAMATSU-00003 here is my item DFD-XX-FF00 HA-MURAMATSU-00001 HA-MURAMATSU-00002
3 HA-MURAMATSU-00004 another item DFD-XX-FF01
the first half of My Items sheet
F G H
1 Location Arrived Location Comments
2 (186) University of Minnesota Twin Cities 10/14/2024 10:12:13 AM comments for 1st item
3 (186) University of Minnesota Twin Cities 10/13/2024 9:38:58 PM comments for 2nd item
the second half of My Items sheet


Column Description
A It defines a specific Item, and thus acts as a PID. There is no specific scheme to define serial numbers, but each of them must be unique for a given Component Type. One could use External ID as its label name here, instead. In that case, you would have to specify existing PIDs. The Tool then overwrite the contents of the specified PIDs.
B This column represents comments for each of the Items.
C Drawing numbers, to be stored in each of the Item’s Specifications in the HWDB.
D & E The label names here need to coincide with those functional position names that are defined in its Component Type definition. Notice that the Item, HA-MURAMATSU-00003, will have 2 sub-component links, one to HA-MURAMATSU-00001 and another to HA-MURAMATSU-00002, while the Item, HA-MURAMATSU-00004, will not have any sub-component link.
F The column specifies a location of the Item. It expects both Institution ID and Institution name. If you like, you could only specify ID (name) with a label name, Institution ID (Institution Name), instead.
G Represents arriving date&time of the corresponding Item. One can add a time-zone. Without it, by default it takes it in the North American Central Time Zone.
H Represents comments for each locations.

QuickStartExample.xlsx: “My Images” sheet:

A B C
1 Serial Number Image File Comments
2 HA-MURAMATSU-00003 images/apple.jpeg image 1
3 HA-MURAMATSU-00003 images/banana.jpeg image 2
4 HA-MURAMATSU-00004 images/broccoli.jpeg image 3
4 HA-MURAMATSU-00004 images/apple.jpeg image 4
My Images sheet


Column Description
A Represents the same Serial Numbers that are found in the My Items sheet.
B Specifies the locations and file names of the images to be uploaded.
C Comments for each image files.

QuickStartExample.xlsx: “My Tests” sheet:

A B C D E F G H I
1Serial Number Comments OperatorTest Location PSU Serial Number Visual Inspection PSU ManufacturerPSU Test 1PSU Test 2
2 HA-MURAMATSU-00003 Looks good Hajime Minneapolis 2PH30-230 Passed TOSHIBA Failed Passed
3 HA-MURAMATSU-00004 Looks ok Andy Tucson 2PH30-231 Passed TOSHIBA Passed Failed
the first half of My Tests sheet
J K L M
1Fan Serial NumberFan ManufacturerFan Test 1Fan Test 2
2 W0909101451 Champion Lab Passed Failed
3 W0909101452 Champion Lab Failed Passed
the second half of My Tests sheet


Column Description
A Represents the same Serial Numbers that are found in the My Items and My Images sheets.
B Comments on each of the Tests.
C-M These columns represent my test data. We’ll describe how exactly we like to format them below.

QE-docket.json: “Values” blob:

Here, you provide Component Type ID of the Items you like to upload (in this case, D00599800015), your Institution, and Manufacturer.

QE-docket.json: “Sources”:

QE-docket.json: Encoders: “My Item Encoder”:

QE-docket.json: Encoders: “My Image Encoder”:

QE-docket.json: Encoders: “My Test Encoder”:

Let’s upload them:

uploaded screen



After uploading contents to the HWDB

Bar/QR-code labels

Code Type
Paper Size
Label Size
# of labels/sheet
Bar
A4 (210×297 mm)
51.5×26.6 mm
44
Bar
Letter (8.5”×11”)
4”×1.5”
12
Bar
Letter (8.5”×11”)
4”×1.333”
14
Bar
Letter (8.5”×11”)
2.625”×1”
30
QR
A4 (210×297 mm)
67×72 mm
12
QR
Letter (8.5”×11”)
5”×3.5”
4
QR
Letter (8.5”×11”)
4”×3.333”
6
QR
Letter (8.5”×11”)
4”×1.5”
12
QR
Letter (8.5”×11”)
2.625”×2”
15

QRBARA4