Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Visualize Docker Compose codebase using Pycograph

1 min read

Pycograph is an open source tool that creates a Graph model of your Python code. The tool lets you to explore your Python codebase with graph queries. With Pycograph, you can query the python code with Cypher. The project is hosted over https://pycograph.com/ and package is available in PyPI repository. It was introduced for the first time by Reka Horvath. I was lucky to be one of the contributor for this project.

Let us see how to explore Python code using Pycograph and RedisGraph below:

Step 1. Install Docker

 curl -sSL https://get.docker.com/ | sh

Step 2. Install Pycograph from PyPI

 pip install pycograph

Step 3. Start RedisGraph Module

The redislabs/redismod Docker image provides you all the essential Redis modules.

 docker run -d -p 6379:6379 redislabs/redismod

Step 4. Run RedisInsight

 docker run -d -v redisinsight:/db -p 8001:8001 redislabs/redisinsight:latest

Step 5. Load a sample Python code

We will be using a popular Docker compose project for our sample python code. Clone the Docker Compose project repository

  git clone https://github.com/docker/compose

Step 6. Load Python Code

Load your project’s code with the pycograph load command:

 pycograph load --project-dir compose


 Graph successfully updated.
{'graph name': 'compose', 'nodes added': 2428, 'edges added': 11239}

Step 7. Visualize the project

Open RedisInsight, select RedisGraph on the left menu and run the below query:

Query #1: Return every node


You will see the below output:

My Image

Query #2: Return every non-test object

My Image

Query #3. Displaying the function behind the docker-compose up command

A query returning exactly one node using the unique full_name property. Double-click on the node to display all its relationships.

My Image

Query #4. Displaying the ‘docker-compose up’ and its calls relationships

My Image

Query #5. Displaying the ‘docker-compose up’ vs ‘docker-compose run’

Functions called by the Docker Compose top level commands up and run

My Image



Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

60 Replies to “Visualize Docker Compose codebase using Pycograph”

  1. I like this post, enjoyed this one appreciate it for putting up. “The reward for conformity was that everyone liked you except yourself.” by Rita Mae Brown.

  2. What i do not realize is in fact how you’re now not really much more neatly-liked than you may be now. You’re very intelligent. You recognize thus considerably in the case of this topic, made me in my view believe it from numerous numerous angles. Its like men and women don’t seem to be involved unless it is something to do with Girl gaga! Your personal stuffs nice. All the time deal with it up!

  3. I’m so happy to read this. This is the type of manual that needs to be given and not the accidental misinformation that is at the other blogs. Appreciate your sharing this greatest doc.

  4. It?¦s really a great and useful piece of information. I am glad that you shared this helpful info with us. Please stay us up to date like this. Thanks for sharing.

  5. I¦ve been exploring for a little for any high-quality articles or blog posts on this sort of area . Exploring in Yahoo I ultimately stumbled upon this website. Reading this info So i¦m glad to show that I’ve a very good uncanny feeling I discovered just what I needed. I most indubitably will make certain to do not put out of your mind this site and give it a glance on a relentless basis.

  6. obviously like your web-site but you have to take a look at the spelling on quite a few of your posts. Several of them are rife with spelling problems and I in finding it very troublesome to tell the truth however I?¦ll certainly come back again.

  7. Heya i am for the first time here. I came across this board and I find It really useful & it helped me out much. I hope to give something back and aid others like you helped me.

  8. Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your webpage? My website is in the exact same niche as yours and my visitors would certainly benefit from a lot of the information you provide here. Please let me know if this ok with you. Many thanks!

  9. Its like you read my thoughts! You seem to know a lot approximately this, such as you wrote the e book in it or something. I feel that you just can do with some percent to power the message house a bit, but instead of that, this is wonderful blog. A great read. I’ll certainly be back.

  10. Oh my goodness! a tremendous article dude. Thanks Nonetheless I’m experiencing problem with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting similar rss downside? Anyone who is aware of kindly respond. Thnkx

  11. Do you have a spam problem on this blog; I also am a blogger, and I was wondering your situation; we have created some nice practices and we are looking to swap strategies with others, please shoot me an e-mail if interested.

  12. I have recently started a blog, the info you provide on this website has helped me tremendously. Thank you for all of your time & work. “If you would know strength and patience, welcome the company of trees.” by Hal Borland.

  13. Once I originally commented I clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get 4 emails with the same comment. Is there any way you possibly can take away me from that service? Thanks!

  14. I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Fantastic work!

  15. Hiya very cool site!! Man .. Beautiful .. Superb .. I’ll bookmark your website and take the feeds additionally…I’m happy to find numerous helpful info right here within the submit, we’d like work out more strategies on this regard, thanks for sharing.

  16. Wonderful goods from you, man. I’ve understand your stuff previous to and you are just extremely wonderful. I really like what you’ve acquired here, certainly like what you’re stating and the way in which you say it. You make it enjoyable and you still care for to keep it smart. I can’t wait to read much more from you. This is actually a tremendous web site.

  17. Definitely believe that which you said. Your favorite justification appeared to be on the net the simplest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they plainly don’t know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

  18. Good – I should definitely pronounce, impressed with your web site. I had no trouble navigating through all tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, website theme . a tones way for your client to communicate. Nice task..

  19. I wish to convey my affection for your kindness for persons that have the need for help on this particular concept. Your special commitment to getting the message throughout has been rather productive and has in most cases allowed those much like me to get to their targets. The interesting tips and hints entails a whole lot to me and especially to my peers. Warm regards; from everyone of us.

  20. Great beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea

  21. Çok seçkin ve amatör olan seks videosu ve porno amatör fotograf
    içerin gerçek kız pornosu ishotmyself sikiş videolarını free ishotmyself free sex video olarak izle gerçek güzel ve amatör kızlarla sikiş ishotmyself porn videos Amatör Sex, Bakire Sikiş, Mobil Porno, Mofos, Redtube Sikiş Özlem Acar.

  22. Thanks for your write-up. What I want to say is that when searching for a good on the web electronics retail outlet, look for a web page with full information on critical factors such as the security statement, protection details, any payment procedures, along with terms as well as policies. Always take time to read the help as well as FAQ areas to get a better idea of how a shop is effective, what they are able to do for you, and the way you can make the most of the features.

Leave a Reply

Your email address will not be published.

© Copyright Collabnix Inc

Built for Collabnix Community, by Community