Giter VIP home page Giter VIP logo

python-sap's Introduction

python-sap

Python package

SAP Algorithm written in Python.

Installing

First make sure you have the igraph library installed at system level:

# In Arch based linux distributions
sudo pacman -S igraph
# In Debian based linux distributions (Ubuntu, etc.)
sudo apt install libigraph0-dev

Then you can install all the python things with:

pip install -U python-sap

Console script

After installing, you get access to some console scripts with which you can start trying things around:

$ sap describe docs/jupyter-sap/savedrecs.txt
IGRAPH DN-- 90 343 --
+ attr: AU (v), BP (v), DI (v), J9 (v), PY (v), VL (v), _connections (v), _elaborate_sap (v), _leaf_connections (v), _raw_sap (v), _root_connections (v), extended_leaf (v), extended_root (v), label (v), leaf (v), name (v), root (v), sap (v), trunk (v)

This one describes all the collections you have,

$ sap root docs/jupyter-sap/savedrecs.txt
1.00 Skumryev V, 2003, NATURE, V423, P850, DOI 10.1038/nature01687 https://dx.doi.org/10.1038/nature01687
0.91 Ferrando R, 2008, CHEM REV, V108, P845, DOI 10.1021/cr040090g https://dx.doi.org/10.1021/cr040090g
0.89 Nogues J, 1999, J MAGN MAGN MATER, V192, P203, DOI 10.1016/S0304-8853(98)00266-2 https://dx.doi.org/10.1016/S0304-8853(98)00266-2
...

Shows the root of the topic in the bibliography collection you pass in, feel free to:

sap --help

to explore all the commands and options you can use.

Python API

The Python API is quite small, here's the minimal working example:

from sap import load, Sap, CollectionLazy

sap = Sap()
graph = next(load(CollectionLazy(file1, file2, ...)))
tree = sap.tree()

then tree is an igraph.Graph labeled with all the things you would need for analysis.

Development

Check the CONTRIBUTING guide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.