This project synchronizes items and users between Jamf and Snipe-IT asset management systems.
models/jamf_model.py
: Defines theJamfItem
model.models/snipe_model.py
: Defines theSnipeItItem
model.app.py
: Entry point for the script, calls thesync_items
function.config.py
: Configuration file for environment variables.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install pydantic
-
Set up environment variables:
- Use the config file. or
- Create a
.env
file in the root directory of the project. - Add the following variables to the
.env
file:JAMF_API_URL=<your_jamf_api_url> JAMF_USERNAME=<your_jamf_username> JAMF_PASSWORD=<your_jamf_password> SNIPEIT_API_URL=<your_snipeit_api_url> SNIPEIT_API_TOKEN=<your_snipeit_api_token>
-
Uncomment the
load_dotenv()
line inconfig.py
:from dotenv import load_dotenv load_dotenv()
Run the script to synchronize items and users:
python app.py
Represents a model in the Jamf asset management system.
Attributes:
name
(str): The name of the item.serial_number
(str): The serial number of the item.model_identifier
(str): The model identifier.assigned_user
(Optional[str]): The user assigned to the item.model_name
(str): The name of the model.
Represents a model in the Snipe-IT asset management system.
Attributes:
name
(str): The name of the item.serial
(str): The serial number of the item.assigned_user
(Optional[str]): The user assigned to the item.model
(str): The model name.model_number
(str): The model number.