Skip to content

Commit

Permalink
Packaged version
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Revere committed Jul 10, 2014
1 parent 81ca2f3 commit 0131eff
Show file tree
Hide file tree
Showing 16 changed files with 711 additions and 203 deletions.
Binary file modified .DS_Store
Binary file not shown.
243 changes: 61 additions & 182 deletions .idea/workspace.xml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
The MIT License (MIT)

Copyright (c) 2014 Lauren Revere

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

5 changes: 1 addition & 4 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ LICENSE.txt
README.txt
requirements.txt
setup.py
altmetriclibrary/__init__.py
altmetriclibrary/altmetric_library.py
altmetriclibrary/test/__init__.py
altmetriclibrary/test/test_article.py
altmetricwrapper/__init__.py
56 changes: 56 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
===========
PyAltmetric
===========

PyAltmetric provides an easy python wrapper for the Altmetric API.

Typical usage often looks like this::

from pyaltmetric import Altmetric

Create an Altmetric object::

altmetric_object = Altmetric()

Creating an Altmetric object caches api version number and key. The
object is then used to make calls to the Altmetric API. From here you can
easily create article objects filled with Altmetric information simply by
giving an id for the article you want information on::

article1 = altmetric_object.article_from_doi("doi_of_article")

There are various id's to choose from including: bibcode, pmid, and arxiv id.

After you have an article you can easily extract altmetric information
using the built in attributes such as::

article1.title
article1.abstract
article1.score

If you want to gather multiple article metrics at once you can use the
articles_from_timeframe method. This will give you articles with internet
mentions within a given time period (past 3 days, past month, ect)::

articles = altmetric_object.articles_from_timeframe("1 day")

It returns an article gerator which can easily be iterated through.

If you already have a json from the Altmetric API you can create an
article directly.

First you need to import article::

from pyaltmetric import Article

Then you can simply create atricles. There are three ways to do so:

1. Using supplying a properly constructed dictionary stright into the
constructor.
::article2 = Article(json_dict)
2. Supplying the filename of a properly formatted json and using the
class method from_json_file.
::article3 = Article.from_json_file(file)
3. Supplying an alreay open file of properly formatted json and using the
class method from_json_file.
::article3 = Article.from_json_file("filename.json")

Binary file added pyaltmetric/.DS_Store
Binary file not shown.
Loading

0 comments on commit 0131eff

Please sign in to comment.