It allows to load data into a remote Tripal instance, and explore its content, directly from Python code, or using a CLI (Command Line Interface).
See below for examples of what you can do using the tripal python module, and the tripaille CLI.
(in case you wonder: Tripaille’s name comes from a bad french word play)
Requirements
The tripal_rest_api module needs to be installed on your Tripal instance (choose the master branch for Tripal 2, or the branch 7.x-3.x for Tripal 3).
Installation
$ pip install tripal
# On first use you'll need to create a config file to connect to the tripal server, just run:
$ tripaille init
Welcome to Tripal's Tripaille!
TRIPAL_URL: http://localhost/
TRIPAL_USER: admin
TRIPAL_PASS: changeme
This will create a tripaille config file in ~/.tripaille.yml
Examples
from tripal import TripalInstance
ti = TripalInstance(tripal_url='http://localhost:8500/', username='admin', password='changeme')
# Create human species
org = ti.organism.add_organism(genus="Homo", species="sapiens", common="Human", abbr="H.sapiens")
# Then display the list of organisms
orgs = ti.organism.get_organisms()
for org in orgs:
print('{} {}'.format(org['genus'], org['species']))
# Create an analysis
an = ti.analysis.add_analysis(name="My cool analysis",
program="Something",
programversion="1.0",
algorithm="Google",
sourcename="src",
sourceversion="2.1beta",
sourceuri="http://example.org/",
date_executed="2018-02-03")
# Then display the list of organisms
ans = ti.analysis.get_analyses()
# And load some data
ti.analysis.load_fasta(fasta="./test-data/Citrus_sinensis-scaffold00001.fasta", analysis_id=ans[0]['analysis_id'], organism_id=orgs[0]['organism_id'])
ti.analysis.load_gff3(gff="./test-data/Citrus_sinensis-orange1.1g015632m.g.gff3", analysis_id=ans[0]['analysis_id'], organism_id=orgs[0]['organism_id'])
GFF3: removed bugged ‘refresh’ and ‘remove’ loading mode (no more available in Tripal3)
Renamed organism get_organism_nodes to organism get_organisms_tripal
and analysis get_analysis_nodes to analysis get_analyses_tripal.
Both now return Drupal Nodes for Tripal 2 or Entities for Tripal 3.
Added delete_orphans methods for organisms and analyses
Added tests
2.0.4
Small bug fixes
2.0.3
More reliable detection of job failures
2.0.2
Fix broken pip install tripal
2.0.1
Fix missing requirements
2.0
Rewritten most of the code, now working in a similar way as parsec or chakin
New cli tool named ‘tripaille’
Tripal jobs can now be run directly by python-tripal and stdout and stderr are retrieved at the end of jobs.
Updated indexing code to latest tripal_elasticsearch module
Tripal Library
A Python library for interacting with Tripal.
It allows to load data into a remote Tripal instance, and explore its content, directly from Python code, or using a CLI (Command Line Interface).
See below for examples of what you can do using the
tripalpython module, and thetripailleCLI.(in case you wonder: Tripaille’s name comes from a bad french word play)
Requirements
The tripal_rest_api module needs to be installed on your Tripal instance (choose the master branch for Tripal 2, or the branch 7.x-3.x for Tripal 3).
Installation
This will create a tripaille config file in ~/.tripaille.yml
Examples
Or with the Tripaille client:
History
3.2.1
3.2
3.1.1
3.1
3.0
job add_import_jobfor generic Tripal 3 importerorganism get_organism_nodestoorganism get_organisms_tripalandanalysis get_analysis_nodestoanalysis get_analyses_tripal. Both now return Drupal Nodes for Tripal 2 or Entities for Tripal 3.delete_orphansmethods for organisms and analyses2.0.4
2.0.3
2.0.2
2.0.1
2.0
1.9
License
Available under the MIT License