Use sqids.encode() to generate a short, URL-safe ID from a list of non-negative integers. Use sqids.decode() to convert an ID back into its original list of numbers.
Important Note on Canonicity: Due to the algorithm's design, multiple different IDs can decode back into the same sequence of numbers. If your system requires canonical IDs, you must manually re-encode the decoded numbers and verify that the resulting ID matches the original input.
sqids = Sqids()
id = sqids.encode([1, 2, 3]) # "86Rf07"
numbers = sqids.decode(id) # [1, 2, 3]