download_pdf()
Download a single BORME PDF file for a specific date, section, and province.Date as either a tuple
(year, month, day) or a datetime.date objectPath where the PDF file will be saved
Section:
'A', 'B', 'C' or SECCION.A, SECCION.B, SECCION.CProvince object (e.g.,
PROVINCIA.MADRID, PROVINCIA.BARCELONA)Whether to parse the PDF file after downloading
bool - True if downloaded and parsed (when parse=True), False otherwise
Example
download_pdfs()
Download multiple BORME PDF files for a specific date and province or section.Date as either a tuple
(year, month, day) or a datetime.date objectDirectory path where PDF files will be saved
Province to download BORMEs for (mutually exclusive with
seccion)Section to download BORMEs for:
'A' or 'B' only (mutually exclusive with provincia)Use HTTPS instead of HTTP
tuple[bool, list[str]] - (True, list_of_downloaded_files)
You must specify either
provincia or seccion, but not both.Example
download_xml()
Download the XML summary file containing URLs of all BORMEs for a specific date.Date as either a tuple
(year, month, day) or a datetime.date objectPath where the XML file will be saved
Use HTTPS instead of HTTP
bool - True if downloaded, False if file already exists
Example
get_url_pdf()
Get the URL for downloading a specific BORME PDF file.Date as either a tuple
(year, month, day) or a datetime.date objectSection:
'A', 'B', or 'C'Province object
Use HTTPS instead of HTTP
str - URL to download the PDF
This function requires an internet connection as it fetches the XML to determine the bulletin number (nbo).
Example
get_url_pdfs()
Get URLs for downloading multiple BORME PDF files.Date as either a tuple
(year, month, day) or a datetime.date objectSection:
'A' or 'B' only (mutually exclusive with provincia)Province object (mutually exclusive with
seccion)Use HTTPS instead of HTTP
dict - Dictionary mapping province names (or sections) to URLs
Example
get_url_xml()
Get the URL for the XML summary file for a specific date.Date as either a tuple
(year, month, day) or a datetime.date objectUse HTTPS instead of HTTP
str - URL to download the XML summary
Example
URL Patterns
The module uses the following URL patterns:Related
- SECCION enum - BORME section constants
- PROVINCIA enum - Spanish province constants