This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
api_response = requests.get("https://api.openalex.org/concepts?filter=ancestors.id:C161191863") | |
parsed_response = api_response.json() | |
result_list = parsed_response["results"] | |
for result in result_list: | |
print(result["display_name"], result["id"], result["level"]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials | |
# based on https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html | |
# read that file for how to generate the creds and how to use gspread to read and write to the spreadsheet | |
# use creds to create a client to interact with the Google Drive API | |
scopes = ['https://spreadsheets.google.com/feeds'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_row_iterator_jsonl_gz(filename, log_period_s=5): # log_period_s=None for no logging | |
import gzip | |
import time | |
import os.path | |
import json | |
# this is the compressed file size | |
# looks like the gzip format only defines the uncompressed file size modulo 2^32 | |
file_size = os.path.getsize(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
www.ncbi.nlm.nih.gov | 3482858 | |
arxiv.org | 655343 | |
www.persee.fr | 200061 | |
ftp.ncbi.nlm.nih.gov | 130586 | |
biblio.ugent.be | 23772 | |
cds.cern.ch | 21790 | |
repositorio.unesp.br | 19220 | |
hal.archives-ouvertes.fr | 15174 | |
orbit.dtu.dk | 11655 | |
www.econstor.eu | 10176 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
### Example code to access the Mendeley OAuth2 API | |
### Author: Juan Pablo Alperin | |
import requests | |
import requests.auth | |
import urllib | |
CLIENT_ID = '' | |
CLIENT_SECRET = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Initially written by Heather Piwowar, June 2011 | |
# Public domain: have at it! | |
# For exporting bibtex info into csv for running stats | |
import csv | |
import re | |
from pybtex.database.input import bibtex as bibtex_in | |
from pybtex.database.output import bibtex as bibtex_out | |
from operator import itemgetter, attrgetter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Initially written by Heather Piwowar, June 2011 | |
# Public domain: have at it! | |
# For stratified sampling of bibtex records | |
import random | |
import math | |
import re | |
from collections import defaultdict |
NewerOlder