Calculate start timestamp and end timestamp of promql rest api

Hi All

/api/v1/query_range?query=avg(container_cpu_usage_seconds_total%7Bnamespace%3D%27test1%27%2Cpod%3D~%27httpd1.*%27%7D)%20by%20(namespace)%20&start=1622038429.000&end=1622643229.000&step=2419&_=1622729547000

How can I calculate the step without using promql cli, I want to use python? This is for 1 week range which is 2419.

Also this or last epoch timestamp,
&_=1622729547000

Thanks!