-
Notifications
You must be signed in to change notification settings - Fork 60
Scripting: Language Dependencies
Before writing Ensembl scripts in Python, Perl, or R, make sure you have the following dependencies for your chosen language:
To make requests in Python, you need the requests package: https://pypi.org/project/requests/.
To decode JSON, you need the json package: this should ship with standard Python installations.
To print JSON in an easy to read way, you need pprint: this should ship with standard Python installations.
import requests, sys, json
from pprint import pprint
To make requests in R, you need the httr library.
To decode JSON, you need the jsonlite package.
To get a more human readable format use the prettify function from the jsonlite package.
library(httr)
library(jsonlite)
To make requests in Perl, you need the HTTP:Tiny module: this should ship with standard Perl installations.
To decode JSON, you need the JSON package: https://metacpan.org/pod/JSON.
To print JSON in an easy to read way, you need Data::Dumper : this should ship with standard Perl installations.
use Data::Dumper;
use HTTP::Tiny;
use JSON;