pythonpyreverse

pyreverse: How to set output directory for generated diagrams


Documentation on pyreverse is sparse and half of the pages that google presented me, redirect to some exotic pages that will require some explaining should your boss find them in your browser history.
Due to the way how pyreverse seems to work, you have to use it from inside your root project/django app directory (running it when in, say, MyApp/docs/ may not find every ancestor of a class your interested in). Meaning the generated diagrams will 'clog' up your project folder unless you manually move them elsewhere.

Is there a way to designate an output folder for pyreverse?


Solution

  • This is now possible since pylint-2.7.3 with the output-directory option.

    For example:

    pyreverse -ASmy a.py --output-directory <path to directory>
    

    Alternatively:

    pyreverse -ASmy a.py -d <path to directory>
    

    Please see pyreverse --help for this information.