Skip to content

Commit

Permalink
Added field URLu to output from .get_internal_urls().
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Apr 28, 2015
1 parent b26cee6 commit 1103344
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,10 @@
Changelog
=========

1.1.2
-----
- Added field ``URLu`` to output from ``.get_internal_urls()``.

1.1.1
-----
- ISBN is now discriminated to valid and invalid. Added new method ``.get_invalid_ISBNs()``, ``.get_ISBNs()`` now returns just valid ISBNs.
Expand Down
18 changes: 11 additions & 7 deletions src/marcxml_parser/query.py
Expand Up @@ -451,24 +451,28 @@ def get_originals(self):

def get_urls(self):
"""
Content of field ``856u42``. Typically URL pointing to producers
homepage.
Returns:
list: List of urls defined by producer (typically one pointing to \
producers homepage).
list: List of URLs defined by producer.
"""
urls = self.get_subfields("856", "u", i1="4", i2="2")

return map(lambda x: x.replace("&", "&"), urls)

def get_internal_urls(self):
"""
URL's, which may point to edeposit, aleph, kramerius and so on.
Fields ``856u40``, ``998a`` and ``URLu``.
Returns:
list: List of internal urls. Url's may point to edeposit, aleph, \
kramerius and so on.
list: List of internal URLs.
"""
internal_urls = self.get_subfields("856", "u", i1="4", i2="0")
internal_urls.extend(
self.get_subfields("998", "a")
)
internal_urls.extend(self.get_subfields("998", "a"))
internal_urls.extend(self.get_subfields("URL", "u"))

return map(lambda x: x.replace("&", "&"), internal_urls)

Expand Down

0 comments on commit 1103344

Please sign in to comment.