Skip to main content

pandalone: process data-trees with relocatable-paths

Project description

Latest Version in PyPI Latest version in Anaconda-cloud Latest release in GitHub Documentation Travis build status (Linux) Apveyor build status (Windows) cover-status Dependencies up-to-date? Downloads Issues count Supported Python version Code Style Project License

pandalone is a collection of utilities for working with hierarchical-data using relocatable-paths.




2020-05-14 23:59



PyPI repo:


calculation, data, dependencies, engineering, excel, library, numpy, pandas, processing, python, resolution, scientific, simulink, tree, utility


2015 European Commission (JRC-IET)


EUPL 1.1+

Currently only 2 portions of the envisioned functionality are ready for use:

  • mod(pandalone.xleash): A mini-language for “throwing the rope” around rectangular areas of Excel-sheets.

  • mod(pandalone.mappings): Hierarchical string-like objects that may be used for indexing, facilitating renaming keys and column-names at a later stage.

Our goal is to facilitate the composition of engineering-models from loosely-coupled components. Initially envisioned as an indirection-framework around pandas coupled with a dependency-resolver, every such model should auto-adapt and process only values available, and allow remapping of the paths accessing them, to run on renamed/relocated value-trees without component-code modifications.

It is an open source library written and tested on Python-3.6+ , Windows and Linux.

<nav class="contents" id="table-of-contents" role="doc-toc">

Table of Contents




At the most fundamental level, an “execution” or a “run” of any data-processing can be thought like that:

      .--------------.     _____________        .-------------.
     ;  DataTree    ;    |             |      ;   DataTree   ;
    ;--------------; ==> |  <cfunc_1>  | ==> ;--------------;
   ; /some/data   ;      |  <cfunc_2>  |    ; /some/data   ;
  ;  /some/other ;       |     ...     |   ;  /some/other ;
 ;   /foo/bar   ;        |_____________|  ;   /foo/bar   ;
'--------------'                         '--------------.
  • The data-tree might come from json, hdf5, excel-workbooks, or plain dictionaries and lists. Its values are strings and numbers, numpy-lists, pandas or xray-datasets, etc.

  • The component-functions must abide to the following simple signature:

    cfunc_do_something(pandelone, datatree)

    and must not return any value, just read and write into the data-tree.

  • Here is a simple component-function:

    def cfunc_standardize(pandelone, datatree):
        pin, pon = pandelone.paths(),
        df = datatree.get(pin.A)
        df[pon.A.B_std] = df[pin.A.B] / df[pin.A.B].std()
  • Notice the use of the relocatable-paths marked specifically as input or output.

  • TODO: continue rough example in tutorial…


The program runs on Python-3.5+ and requires numpy, pandas and (optionally) win32 libraries along with their native backends.

pip install pandalone                 ## Use `--pre` if version-string has a build-suffix.

… but probably you need the following for xleash to work:

pip install pandalone[xlrd]

All “extras” are: test, doc, excel, pandas, xlrd, dev, all

In case you need the very latest from master branch :

pip install git+

Or in to install in develop mode, with all dependencies needed for development, and with pre-commit hook for auto-formatting python-code with black, clone locally this project from the remote repo, and run:

pip install -e <pandalone-dr>[dev]
pre-commit install

Project files and folders

The files and folders of the project are listed below:

+--pandalone/       ## (package) Python-code
+--tests/           ## (package) Test-cases
+--doc/             ## Documentation folder         ## (script) The entry point for `setuptools`, installing, testing, etc
+--requirements/    ## (txt-files) Various pip and conda dependencies.


Currently 2 portions of this library are ready for use: mod(pandalone.xleash) and mod(pandalone.mappings)

GUI usage

For a quick-‘n-dirty method to explore the structure of the data-tree and run an experiment, just run:

$ pandalone gui

Excel usage

In Windows and OS X you may utilize the excellent xlwings library to use Excel files for providing input and output to the experiment.

To create the necessary template-files in your current-directory you should enter:

$ pandalone excel

You could type instead samp(pandalone excel {file_path}) to specify a different destination path.


Python usage

Example python REPL (Read-Eval-Print Loop) example-commands are given below that setup and run an experiment.

First run command(python) or command(ipython) and try to import the project to check its version:


>>> import pandalone

>>> pandalone.__version__           ## Check version once more.

>>> pandalone.__file__              ## To check where it was installed.         # doctest: +SKIP

If everything works, create the data-tree to hold the input-data (strings and numbers). You assemble data-tree by the use of:

  • sequences,

  • dictionaries,

  • class(pandas.DataFrame),

  • class(pandas.Series), and

  • URI-references to other data-trees.


Getting Involved

This project is hosted in github. To provide feedback about bugs and errors or questions and requests for enhancements, use github’s Issue-tracker.

Sources & Dependencies

To get involved with development, you need a POSIX environment to fully build it (Linux, OSX or Cygwin on Windows).

First you need to download the latest sources:

$ git clone pandalone.git
$ cd pandalone.git

Then you can install all project’s dependencies in `development mode using the file( script:

$ python --help                           ## Get help for this script.
Common commands: (see '--help-commands' for more) build      will build the package underneath 'build/' install    will install the package

Global options:
  --verbose (-v)      run verbosely (default)
  --quiet (-q)        run quietly (turns verbosity off)
  --dry-run (-n)      don't actually do anything

$ python develop                           ## Also installs dependencies into project's folder.
$ python build                             ## Check that the project indeed builds ok.

You should now run the test-cases to check that the sources are in good shape:

$ python test


See architecture live-document.


Why another XXX? What about YYY?

These are the knowingly related python projects:

  • OpenMDAO: It has influenced pandalone’s design. It is planned to interoperate by converting to and from it’s data-types. But it is Python-2 only and its architecture needs attending from programmers (no, no official test-cases).

  • PyDSTool: It does not overlap, since it does not cover IO and dependencies of data. Also planned to interoperate with it (as soon as we have a better grasp of it :-). It has some issues with the documentation, but they are working on it.

  • xray: Pandas for higher dimensions; data-trees should in principle work with “xray”.

  • Blaze: NumPy and Pandas interface to Big Data; data-trees should in principle work with “blaze”.

  • netCDF4: Hierarchical file-data-format similar to hdf5; a data-tree may derive in principle from “netCDF4 “.

  • hdf5: Hierarchical file-data-format, supported natively by pandas; a data-tree may derive in principle from “netCDF4 “.

Which other projects/ideas have you reviewed when building this library?



    The *container* of data consumed and produced by a :term`model`, which
    may contain also the model.
    Its values are accessed using **path** s.
    It is implemented by class(`pandalone.pandata.Pandel`) as
    a mergeable stack of **JSON-schema** abiding trees of strings and
    numbers, formed with:

        - sequences,
        - dictionaries,
        - mod(`pandas`) instances, and
        - URI-references.

    That part of the **data-tree**  that relates only to the I/O data

    A collection of **component** s and accompanying **mappings**.

    Encapsulates a data-transformation function, using **path**
    to refer to its inputs/outputs within the **value-tree**.

    A `/file/like` string functioning as the *id* of data-values
    in the **data-tree**.
    It is composed of **step**, and it follows the syntax of
    the **JSON-pointer**.

    The parts between between two conjecutive slashes(`/`) within
    a **path**.  The class(`Pstep`) facilitates their manipulation.

    Specifies a transformation of an "origin" path to
    a "destination" one (also called as "from" and "to" paths).
    The mapping always transforms the *final* path-step, and it can
    either *rename* or *relocate* that step, like that::

        ------          -----------   -----------
        /rename/path    foo       --> /rename/foo        ## renaming
        /relocate/path  foo/bar   --> /relocate/foo/bar  ## relocation
        /root           a/b/c     --> /a/b/c             ## Relocates all /root sub-paths.

    The hierarchy is formed by class(`Pmod`) instances,
    which are build when parsing the **mappings** list, above.

    The `JSON schema <>`_ is an `IETF draft
    that provides a *contract* for what JSON-data is required for
    a given application and how to interact with it.
    JSON Schema is intended to define validation, documentation,
    hyperlink navigation, and interaction control of JSON data.
    You can learn more about it from this `excellent guide
    and experiment with this `on-line validator <>`_.

    JSON Pointer(rfc(`6901`)) defines a string syntax for identifying
    a specific value within a JavaScript Object Notation (JSON) document.
    It aims to serve the same purpose as *XPath* from the XML world,
    but it is much simpler.

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

pandalone-0.5.0.tar.gz (1.2 MB view hashes)

Uploaded source

Built Distribution

pandalone-0.5.0-py2.py3-none-any.whl (123.4 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page