Skip to main content

Python Tree of Science package

Project description

python-sap

Python package Binder

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, Collection, giant

sap = Sap()
graph = giant(Collection(file1, file2, ...))
tree = sap.tree(graph)

Or if you prefer to user the filenames, you may use:

from sap import load, Sap, Collection, giant

sap = Sap()
graph = giant(Collection.from_filenames(filename1, filename2, ...))
tree = sap.tree(graph)

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

Development

Check the CONTRIBUTING guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-sap-2.0.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

python_sap-2.0.0-py2.py3-none-any.whl (10.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file python-sap-2.0.0.tar.gz.

File metadata

  • Download URL: python-sap-2.0.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for python-sap-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cd6a7c7e7326052c09560ccc930d76a13415a088643cccaa7a047f3441d7bc90
MD5 c1abc0ff9b089a318d9bec1adbed0c69
BLAKE2b-256 1cad941c064682a4dd6a596456cf0985d4eb193ad56e4b8d945b83f76dde267a

See more details on using hashes here.

File details

Details for the file python_sap-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: python_sap-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for python_sap-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 010b7654c0db432d18c5c005d9164f7fab95e94c5c08df5e458b08620516c23d
MD5 99c42cbfafae69535deb6395bf4c1819
BLAKE2b-256 f089c41006e3f9fbcd17a8bec259bc20a8f621bbd5783efad1834d49fa224fa0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page