Python provides a built-in module called heapq that implements a priority queue using a min-heap. A min-heap is a heap where the smallest value is at the root. To use heapq, you need to import it and then use its functions to create and manipulate a priority queue. Here is an example of how to use heapq in Python:
import heapq
# create an empty priority queue
pq = []
# insert some items with different priorities
heapq.heappush(pq, (3, "Alice")) # priority 3, value "Alice"
heapq.heappush(pq, (1, "Bob")) # priority 1, value "Bob"
heapq.heappush(pq, (2, "Charlie")) # priority 2, value "Charlie"
# peek at the item with the highest priority
print(heapq.heappop(pq)) # (1, "Bob")
# remove the item with the highest priority
print(heapq.heappop(pq)) # (2, "Charlie")
# insert another item
heapq.heappush(pq, (4, "David")) # priority 4, value "David"
# print the remaining items in the priority queue
print(pq) # [(3, "Alice"), (4, "David")]