Skip to content

Commit

Permalink
Nueva función get_borme_website() en bormeparser.utils
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Apr 7, 2016
1 parent 3997b7a commit 5903510
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Version 0.2 [unreleased]

- Eliminado primer argumento "date" de BormeXML.get_url_pdfs()
- Nuevo método: BormeXML.get_urls_cve()
- Arregladas algunas incompatibilidades con Python 2
- Nueva función: get_borme_website()

Version 0.1.5 [2015-09-25]
--------------------------
Expand Down
8 changes: 8 additions & 0 deletions bormeparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
2015: datetime.date(2015, 1, 2)}


BORME_WEB_URL = "{protocol}://www.boe.es/borme/dias/{year}/{month:02d}/{day:02d}"


def get_borme_website(date, secure=True):
protocol = 'https' if secure else 'http'
return BORME_WEB_URL.format(protocol=protocol, year=date.year, month=date.month, day=date.day)


def remove_accents(string):
try:
return ''.join((c for c in unicodedata.normalize('NFKD', string) if unicodedata.category(c) != 'Mn'))
Expand Down

0 comments on commit 5903510

Please sign in to comment.