Skip to content

About-Time-Technologies/Trail-API-Extended

 
 

Repository files navigation

Bulk add to Trail Reservation Py Utility

Written by Sam Lane 18/07/25
Version A.1

A simple Python utility to automate the bulk modification of assets in a Trail.fi database

Environment Setup

Clone the repository

git clone https://github.com/About-Time-Technologies/Trail-API-Extended

Create a api key in Trail with the minimum required privileges for the task and copy the details of the key to a .env file as below, located in the same directory as this project.

TRAIL_KEY_ID = trailkeyid
TRAIL_KEY_SECRET = trailsecret
TRAIL_BASIC_AUTH_API_TOKEN = trailapitoken

Using the utility

  • Install all required modules:
pip install -r requirements.txt 
  • Define a list of asset ids in a .CSV file that you want to add to the reservation

  • Run the script

Commands

  • all commands make use of -target to define the asset id (or CSV file containing asset ids)
  • add -h to a command to access the help

Delete

python trail-api-extended.py delete -target sample.csv --reason redundant --description "Removed from FOH"

Command Line Switches

  • --reason Reason for deletion e.g.; redundant
  • --description The reason for the deletion. Always enclose in "" e.g.; "Removed from stores"
  • --force If this switch is used then the utility will not ask the user to confirm the item before deletion.
  • --permanent Permanently deletes the item. Use with caution.

About

Python Utility to automate interactions with a Trail.fi asset database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%