{"id":22147239,"url":"https://github.com/centerforopenscience/pyaltmetric","last_synced_at":"2025-07-26T02:31:45.840Z","repository":{"id":18269349,"uuid":"21430362","full_name":"CenterForOpenScience/PyAltmetric","owner":"CenterForOpenScience","description":"A python wrapper for the Altmetric API","archived":false,"fork":false,"pushed_at":"2024-01-16T02:17:38.000Z","size":62,"stargazers_count":17,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-14T05:19:05.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CenterForOpenScience.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-02T15:55:50.000Z","updated_at":"2024-03-15T09:17:04.000Z","dependencies_parsed_at":"2022-07-13T06:30:31.040Z","dependency_job_id":null,"html_url":"https://github.com/CenterForOpenScience/PyAltmetric","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2FPyAltmetric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2FPyAltmetric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2FPyAltmetric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenterForOpenScience%2FPyAltmetric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CenterForOpenScience","download_url":"https://codeload.github.com/CenterForOpenScience/PyAltmetric/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227642219,"owners_count":17797850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T23:15:33.939Z","updated_at":"2024-12-01T23:15:34.626Z","avatar_url":"https://github.com/CenterForOpenScience.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===========\nPyAltmetric\n===========\n\nPyAltmetric provides an easy python wrapper for the Altmetric API.\n\nTypical usage often looks like this:\n\n    from pyaltmetric import Altmetric\n\nCreate an Altmetric object:\n\n    altmetric_object = Altmetric()\n\nCreating an Altmetric object caches api version number and key. The \nobject is then used to make calls to the Altmetric API. From here you can\neasily create article objects filled with Altmetric information simply by\ngiving an id for the article you want information on:\n\n    article1 = altmetric_object.article_from_doi(\"doi_of_article\")\n\nThere are various id's to choose from including: bibcode, pmid, and arxiv id.\n\nAfter you have an article you can easily extract altmetric information\nusing the built in attributes such as:\n\n    article1.title\n    article1.abstract\n    article1.score\n\nIf you want to gather multiple article metrics at once you can use the\narticles_from_timeframe method. This will give you articles with internet\nmentions within a given time period (past 3 days, past month, ect):\n\n    articles = altmetric_object.articles_from_timeframe(\"1 day\")\n\nIt returns an article gerator that is easily iterable.\n\nIf you already have a json from the Altmetric API you can create\narticles directly.\n\nFirst you need to import article:\n\n    from pyaltmetric import Article\n\nThen you can simply create articles. There are three ways to do so.\n\n1. Supplying a properly constructed dictionary stright into the constructor:\n        \n        article2 = Article(json_dict)\n        \n2. Supplying the filename of a properly formatted json and using the class method from_json_file:\n       \n        article3 = Article.from_json_file(file)\n        \n3. Supplying an alreay open file of properly formatted json and using the class method from_json_file:\n        \n        article3 = Article.from_json_file(\"filename.json\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenterforopenscience%2Fpyaltmetric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenterforopenscience%2Fpyaltmetric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenterforopenscience%2Fpyaltmetric/lists"}