This project allows for updating assets in Snipe-IT from a CSV file using Item Name rather than asset tag as the key value, as is required for GUI-based CSV imports from within Snipe-IT. Custom fields are well-supported, as are most built-in fields (name, asset tag, warranty months, purchase date, purchase cost, order number, notes).
- Updates to existing items work as expected.
- Updates to nonexistent items should fail gracefully.
- Creation of new items from CSV is not planned.
- A Snipe-IT server accessible from wherever the importer is running.
- A properly formatted CSV file which includes the 'Item Name' column.
- Python 3.
Your CSV must include an 'Item Name' column. Any columns which don't exist in Snipe-IT should be ignored by the importer.
Usage: csvimport.py [options] -f FILE
Options:
-h, --help show this help message and exit
-v, --verbose set verbosity level
-d, --dry-run run without executing changes
-o, --overwrite overwrite in case of multiple entries
-i INIFILE, --inifile=INIFILE
File containing configuration data (default:
config.ini)
Required Options:
-f FILE, --file=FILE
CSV file to read data from
- Edit config.ini:
- Include the proper Snipe-IT server as SNIPE_URL
- Generate and include an API key as API_TOKEN for Snipe-IT access.