This is easier said than done. The Python holidays library will not cut it. For instance, the Federal Reserve website says that Veterans Day, a Federal holiday observed on Friday, November 10, 2023, is not a bank holiday. But most "holidays" packages will list it as an observed holiday.
Solutions to this problem include:
https://docs.q2developer.com/docs/api_references/hq_api/wedge_online_banking/GetCalendar.html
https://docs.q2developer.com/docs/api_references/q2_sdk/db/db_objects/hours.html
https://gist.github.com/messiest/c9abb837a02ea4bec53ced79950e75ac