Installation

Required dependencies

pandaSDMX is a pure Python package requiring Python 3.9 or higher, which can be installed:

pandaSDMX also depends on:

Optional dependencies for extra features

  • for cache, allowing the caching of SDMX messages in memory, MongoDB, Redis, and more: requests-cache.

  • for schema, allowing validation of SDMXML messages against the XML schemas included in section 3b of the SDMX 2.1 standard: appdirs.

  • for doc, to build the documentation: sphinx and IPython.

  • for test, to run the test suite: pytest, requests-mock.

Instructions

  1. (optional) If using a conda environment, use source activate [ENV] to activate the environment in which to install pandaSDMX.

  2. From the command line, issue:

    $ pip install pandasdmx
    

    or optionally from a conda environment:

    $ conda install pandasdmx -c conda-forge
    
  3. To also install optional dependencies, use commands like:

    $ pip install pandasdmx[cache]             # just requests-cache
    $ pip install pandasdmx[cache,doc,test]  # all extras
    

From source

  1. Download the latest code:

    • from PyPI,

    • from Github as a zip archive, or

    • by cloning the Github repository:

      $ git clone git@github.com:dr-leo/pandaSDMX.git
      
  2. In the package directory, issue:

    $ pip install  .
    

    or:

    $ flit install
    

Note

The build process adheres to PEP 517 using flit as build backend.

Running tests

As per v1.1.0, the test suite is no longer packaged with any pandaSDMX distribution. You can run it anyway by installing the source from Github, including the tests optional dependencies. Then, in the package directory, issue:

$ pytest

By default, tests that involve retrieving data over the network are skipped. To run these tests, use:

$ pytest -m network

Note

Many tests requesting data or metadata from SDMX data providers are out of sync with either the data provided or with the source code. So expect a lot of failures when running tests with the -m network option.

pytest offers many command-line options to control test invocation; see py.test --help or the documentation.