Giter Site home page Giter Site logo

pymed's Introduction

Gijs Wobben

I love innovation, and I've been studying and practicing it for a long time now. Creating new ideas and leading brainstorm sessions, working with interdisciplinary teams on prototypes and MVPs, and creating strategic documents and plans to steer innovation so it supports the companies vision and long term goals. Every time it's amazing to see a vision of what the future should look like, turn into real products and services that help customers.

Data is at the core of almost any modern innovation. From Facebook to cars and high tech robots, they would not exist without large quantities and varieties of data. In my work as a Data Scientist I make sense of this “Big Data” and come up with small or large innovations and business propositions, that make organizations data driven. I team up with Software developers and domain experts and capture their knowledge and understanding in models and business logic.

Github stats



pymed's People

Contributors

darkbladecr avatar esteininger avatar gijswobben avatar radusuciu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pymed's Issues

Is there a way to fetch Mesh terms?

Is there a way to fetch MESH terms of a publication from the API using the packadge?

This information is found under 'MeshHeadingList' of the xml returned using efetch.

Parse PubMed Central id

Having a PubMed Central id field in the Article object would be great, since this PMC id can be used to retrieve the full text of the article using this API

Could you please add support for API key?

Is your feature request related to a problem? Please describe.
Currently one cannot enter the PubMed API key, so one cannot increase the rate limit to 10calls/sec

Describe the solution you'd like
It would be great to add another param to the PubMed object.

Describe alternatives you've considered
Writing my own code to handle the API :)

Additional context
See here for info about the API key

THANKS!

Access to Affiliation in XML data

Is your feature request related to a problem? Please describe.
It's important to me to see the affiliation information associated with an author if applicable. I can't see where this is being extracted from the returned XML.

Describe the solution you'd like
Ideally, this would be an additional return in the form of .affiliation.

Describe alternatives you've considered

I created a "hack" by editing article.py
def _extractAuthors(self: object, xml_element: TypeVar("Element")) -> list: return [ { "lastname": getContent(author, ".//LastName", None), "firstname": getContent(author, ".//ForeName", None), "initials": getContent(author, ".//Initials", None), "affiliation": getContent(author, ".//AffiliationInfo/Affiliation", None), } for author in xml_element.findall(".//Author") ]

api.py is broken

Describe the bug

When importing pymed I get the following error:

$ python3 
Python 3.5.3 (default, Sep 27 2018, 17:25:39)  
[GCC 6.3.0 20170516] on linux 
Type "help", "copyright", "credits" or "license" for more information.
>>> from pymed import PubMed 
Traceback (most recent call last): 
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/pymed/__init__.py", line 1, in <module> 
    from .api import PubMed
  File "/usr/local/lib/python3.5/dist-packages/pymed/api.py", line 118
    response = requests.get(f"{BASE_URL}{url}", params=parameters)
                                             ^ 
SyntaxError: invalid syntax
>>> import pymed 
Traceback (most recent call last): 
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/pymed/__init__.py", line 1, in <module>
    from .api import PubMed
  File "/usr/local/lib/python3.5/dist-packages/pymed/api.py", line 118
    response = requests.get(f"{BASE_URL}{url}", params=parameters)
                                             ^
SyntaxError: invalid syntax `

To Reproduce
Just try to import it in the interpreter.

Environment (please complete the following information):

  • OS: Same error in WSL Ubuntu and Debian 9
  • Version: Python 3.5.3

some code is userful,i hopy you can add in

I hope you can add this code in article.py

``

__slots__ = (
    "pubmed_id",
    "title",
    "abstract",
    "keywords",
    "journal",
    "publication_date",
    "authors",
    "methods",
    "conclusions",
    "results",
    "copyrights",
    "doi",
    "volume",
    "issue",
    "pubdate_year",
    "pubdate_month"
)







def _extractVolume(self: object, xml_element: TypeVar("Element")) -> str:
    path = ".//Journal/JournalIssue/Volume"
    return getContent(element=xml_element, path=path)

def _extractIssue(self: object, xml_element: TypeVar("Element")) -> str:
    path = ".//Journal/JournalIssue/Issue"
    return getContent(element=xml_element, path=path)

def _extractPubDateYear(self: object, xml_element: TypeVar("Element")) -> str:
    path = ".//Journal/JournalIssue/PubDate/Year"
    return getContent(element=xml_element, path=path)

def _extractPubDateMonth(self: object, xml_element: TypeVar("Element")) -> str:
    path = ".//Journal/JournalIssue/PubDate/Month"
    return getContent(element=xml_element, path=path)





    self.volume = self._extractVolume(xml_element)
    self.issue = self._extractIssue(xml_element)
    self.pubdate_year = self._extractPubDateYear(xml_element)
    self.pubdate_month = self._extractPubDateMonth(xml_element)

``

Articles id parsing issue

While iterating on articles resulting from a PubMed query, I noticed that some article ids have parsing issues.

For instance :
Query : ((Haliaeetus leucocephalus[Title/Abstract])) AND ((prey[Title/Abstract]) OR (diet[Title/Abstract]))

Returns (when printing first 10 results) :
pubmed_id = '22822430\n18959310\n21310968\n21295371\n20439737'
abstract = ('Bald eagles (Haliaeetus leucocephalus) are recovering from severe population declines...

Paginate \ count result

Hi,
Is there a way to get count of the relevant results with respect to the query and \ or to paginate the results. E.g. read the first 500, then 500-1000, etc.?

pypi update

Latest version on pypi is from last year. Could this be updated please? The old version has bugs in it.

Pubmed API filter endpoints

Is your feature request related to a problem? Please describe.
Could you please add some filter features with Pubmed API

Additional context
I'm facing problems passing filter queries to the API.

Pagination on response

Hi Gjis,

I am using pymed package in one of my project. Everything is going well but some queries gives lots of articles. I want to give response in pagination, I have tried #1 but it takes lots of time.
Can you help me out for solution.

Thank you

Incomplete abstract

While iterating on articles resulting from a PubMed query, I also noticed that the abstract is sometimes incomplete :

For instance :
Query : ((Haliaeetus leucocephalus[Title/Abstract])) AND ((prey[Title/Abstract]) OR (diet[Title/Abstract]))

Returns (when printing first 10 results) :
pubmed_id = '31015971'
abstract = 'Bald eagle ('

Abstract is not downloading the information on method and Results

Hi,

Thank you for creating the library, it is very helpful.
Have checked with downloaded data, it gives only the Back Ground or objective or whichever come first in Abstract. Is any possibility to get the entire Abstract(Back Ground, Objective, Methods, Results, Conclusion, Conclusion) as displayed when we search in the website.

happy to help you, if I can do something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.