Given a set of packages and a number of days, find the minimum capacity of a ship to transport all packages within the given time frame. Implement ship_within_days(weights, days), where weights is a list of package weights shipped in order and days is a positive integer. Return the minimum integer capacity that transports every package within at most days days.
def ship_within_days(weights, days):