Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Federal Register API in Python: final rules taking effect in the next 30 days, by CFR title, in a CSV

Article type: How-to guide (one task: list the final federal rules that take effect in the next 30 days, one row per CFR title, in a CSV) Prerequisites: Python 3.9+ and the requests package. FederalRegister.gov needs no key and no sign-up. You need an Apify account only for the last section. Tested on: 25 November 2026 (live API). A final rule doesn't change the Code of Federal Regulations (CFR)…

To generate a CSV file listing federal rules that take effect in the next 30 days, use Python and the requests package. This script accesses the Federal Register API, which doesn't require authentication or a key. First, import the necessary libraries: csv, re (regular expressions), sys, time, Counter, date, timedelta, RobotFileParser, and requests.

Set the number of days to 30, then initialize a session object and set the User-Agent header. Load the robots.txt file from the API's website to ensure the script complies with the API's usage policy. Define the query parameters including the type of documents (RULE), effective date range (from tomorrow to 30 days from today), and requested fields (document_number, title, action, agencies, publication_date, effective_on, dates, cfr_references, significant, and html_url).

The script initializes an empty list to store documents and a URL variable to track pagination. It loops through pages of results until there are no more pages, appending each result to the documents list. Once all documents are collected, it creates another empty list to store rows for the CSV output. Iterate through the documents, converting the effective_on field to a date object.

Extract and sort dates from the DATES text field, filtering out the current date. If there are extracted dates, add a row to the rows list with the document number, title, action, agencies, publication_date, effective_on, sorted dates, CFR references, significant flag, and HTML URL.

After populating the rows list with the relevant information, write the data to a CSV file using the csv module's writer method. This process allows you to programmatically generate a CSV file listing all federal rules set to take effect within the next 30 days, making it easy to monitor compliance with upcoming regulatory changes.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Best Coolify alternatives for a few apps on one VPS in 2026

If you run three to fifteen apps on one VPS in 2026 and want an alternative to Coolify, Dokploy is the closest web-panel swap (free self-hosted, GitHub preview deployments, $4.50/month hosted option)…

  • Dokploy is a web-panel alternative with TypeScript stack, PostgreSQL, and Traefik
  • Tugport is a lightweight Rust binary alternative requiring minimal resources
  • Easypanel offers a polished UI but requires proprietary license for extensive use

How to Check Energy and Bandwidth of a TRON Address on TronScan

Disclosure: I work on UsdtPull, a TRON energy rental service. This article was first published on the UsdtPull blog . To check the energy of a TRON address, open tronscan.org, paste the address into…

  • Open tronscan.org and enter TRON address in search bar
  • "Energy" and "Bandwidth" rows show resource limits and allowances
  • Compare available energy with 64,285 needed for USDT transfer

More from Wednesday 25 November →