NetBox Query Tip!
If you need to search for a cable by its ID, use GraphQL by visiting: https://your_nb_instance/graphql/
Then run the following query, replacing YOUR_CABLE_ID with the actual cable ID:
query {
cable(id: YOUR_CABLE_ID) {
id
label
type
status
color
length
length_
π Python Tip! Easily add query parameters to your API calls when using Python by using the params argument in requests.get().
Here`s an example π
import requests
# Define API endpoint
url = "http://suzieq-server/api/v2/devices"
# Query parameters to filter the API request
params = {
"namespace": "
In the world of Python development, there are a ton of tools out there. But there are three that I believe should be part of every modern developerβs toolbox:
Uv, Ruff, and Taskfile.
Uv β Fast Python Package Manager
Uv is a modern, drop-in replacement for pip, venv, and pip-tools.
Introduction
Recently someone asked:
Is there a way to fetch CVE (vulnerability) data for platforms like Cisco, Palo Alto, and Fortinet in a programmatic way, so we can integrate it into a solution weβre building?
The short answer: yesβand one of the best ways to do this is
π Python Tip:
When working with large numbers, Python lets you use underscores (_) to enhance readability.
Here is an example: π
β # Difficult to read:
gigabit = 1000000000
ten_gigabit = 10000000000
β # Easier to read with underscores (_):
gigabit = 1_000_000_000
ten_gigabit = 10_000_000_000
print(f"{gigabit=}\n{ten_gigabit=
π Python DX Tip: Save time when running scripts by using `uv run` to automatically activate your virtual environment.
Example below π
β Manually activating the virtual environment
source .venv/bin/activate
./nr_backup_configs.py
β Automatically activate the virtual environment before running the script
uv run nr_backup_configs.py
Until next
1 min read
Subscribe to our newsletter and stay updated.
Don't miss anything. Get all the latest posts delivered straight to your inbox.