Giter Site home page Giter Site logo

numbat's Introduction

Numbat

Numbat is an API to create and manipulate Sourcetrail databases. Sourcetrail is a code source explorer which allows users to navigate through the different components (functions, classes, types, etc.) easily.

Numbat main goal is to offer a full-python SDK given the fact that the current one, SourcetrailDB cannot be used anymore efficiently. It is not user-friendly at first sight, need to be compiled to provide Python bindings and, moreover, it is no longer maintained. Finally, we have added some little new features as finding an element in the database.

With Numbat, you will be able to visualize your data quickly with the nice graphical Sourcetrail interface. For example, Pyrrha uses Numbat to map firmware structure.

Installation

Numbat is available on pypi.

pip install numbat

From sources

You can also install it from the git repository. Either using the following oneliner:

pip install 'numbat @ git+https://github.com/quarkslab/numbat'

or doing it in few steps:

# Download the repo
git clone [email protected]:quarkslab/numbat.git
cd numbat
# Install numbat locally
pip install .

Build Documentation

If you want to build the documentation by first installing Numbat with the required [doc] dependencies and then serve the documentation on a local server.

# if you already have a local clone of the project
cd NUMBAT_DIR
pip install .[doc]

# otherwise
pip install 'numbat[doc]'

# serve doc locally
mkdocs serve

Basic Usage

A complete usage with examples is available in the documentation but here is a quick usage to begin with Numbat.

To use Numbat, you must first create a SourcetrailDB object and either create a new database or open an existing one:

from pathlib import Path
from numbat import SourcetrailDB

# Create DB
db = SourcetrailDB.open(Path('my_db'), clear=True)

# Create a first class containing the method 'main'
my_main = db.record_class(name="MyMainClass")
meth_id = db.record_method(name="main", parent_id=my_main)

# Create a second class with a public field 'first_name'
class_id = db.record_class(name="PersonalInfo")
field_id = db.record_field(name="first_name", parent_id=class_id)

# The method 'main' is using the 'first_name' field
db.record_ref_usage(meth_id, field_id)

# Save modifications and close the DB
db.commit()
db.close()

Authors

  • Sami Babigeon (@sbabigeon), Quarkslab
  • Eloïse Brocas (@ebrocas), Quarkslab

The logo is a creation of Benoît Forgette and Sami Babigeon.

numbat's People

Contributors

ebrocas avatar fenrisfulsur avatar robindavid avatar

Stargazers

Theodor Arsenij avatar Suha Sabi Hussain avatar  avatar Ryan Mast avatar Hamid avatar Parsia Hakimian avatar  avatar Jhe avatar Sam L. Thomas avatar G6 avatar Filipe Casal avatar zzt avatar Peter Goodman avatar thelumberjhack avatar

Watchers

 avatar  avatar  avatar Jhe avatar  avatar  avatar

Forkers

l2dy-sonarcloud

numbat's Issues

Questions about this project

First of all, congratulations on this project.

I would like to ask if the current Python API implementation covers all of the Sourcetrail DB kind of data/fields, or if some features are still missing.

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.