Code Monkey home page Code Monkey logo

xapitodict's Introduction

XAPI to dict (and to json)

xapitodict is a library to extract the a xapi db dump into a python dictionary for ease of analysis and debugging investigation.

CLI

If you are more comfortable using other tools (e.g. jq) it also provides an executable, xapi-to-json to load the xml database and dump it into as json into a file or the standard output. For additional information run xapi-to-json --help.

Python Module

If you import xapitodict in your python (or jupyter) session, you have access to the following function:

xapi_to_dict: xml_database_path -> (xapi_db_dict, xapi_db_version_dict)

This takes the path of a xml xapi db dump and returns the database dictionary and the version metadata dictionary.

Requirements

The library is compatible with python 2.7 and python 3.

The packages sexpdata and xmltodict are required. They are both available on pypi and installable via pip or easy_install.

Install

Run either of:

  • python setup.py install (or python setup.py install --user if you prefer a local install)

  • pip install . (or pip install --user . if you prefer a local install)

Make sure that the binary install path is in your env path.

xapitodict's People

Contributors

marksymsctx avatar mseri avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xapitodict's Issues

Deserialize all types and do it recursively in the subdicts

We are not de-serialising fields of type bool, int, double, ... It could be worth trying to detect the type and convert it to the appropriate value.

This is complicated by the fact that some fields have inconsistent serialisations:

  • last_booted_record: can be a sexp or xml string
  • snapshot_metadata: contains practically a copy of the vm metadata, including sexped and xmled fields

Print json to stdout

As suggested by @lindig, the cli tool in xapi-to-dict should print the output to stdout unless a -o filename is passed.

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.