A reverse engineering tool for Python source code

Reverse engineer python source code into UML.

Latest Version 1.60
(c) Andy Bulka 2004-2012
andy@andypatterns.com
http://www.andypatterns.com/index.php/products/pynsource/
License: GPL 3

Features:

pyNsourceGui

  • Generates UML diagrams (see screenshot above)
  • Layout algorithm
  • Toggle between normal and ascii UML view
  • Recognises inheritance, composition and cardinality
  • Colour sibling subclasses to understand the relationships in your uml diagram.
  • Print and Print preview
  • Persistence
  • Now uses standard ast python parsing
  • Windows 7, Mac os x, Linux compatibility
  • Open Source

Proper "Python Friendly" source parsing for Python Software Developers: Unlike most off the shelf uml python code importers, pyNsource attempts to recognise tricky composition relationships that are typical in python software development. The expression

self.somevar

is correctly recognised as a UML attribute "somevar". pyNsource attempts to guess the cardinality of associations - if you use arrays or use

.append() 

then "one to many" is assumed. More advocacy here.

Layout: Use the built in layout algorithm to help you get started in arranging your classes on the workspace. The layout algorithm uses "spring layout" and animates during layout. Overlap removal means your nodes won't overlap (unless you drag them with the SHIFT key held down). A multipass (slower) 'Optimal' Layout is also available which tries to find the best possible layout, within the constraints of not being able to 'bend' lines.

Ascii view: Hit "v" to toggle between normal UML and Ascii UML view. Ascii UML lets you copy and paste ascii uml text into your source code and text based documentation.  Optionally use something like the Java Ascii Versatile Editor to wire up your ascii uml classes nicely before pasting into your source code or documentation. See an example of ascii UML at the bottom of this readme.

pynsource command line

  • Command line tool
  • Generates java and delphi skeleton code from python source code
  • Uses an older (non ast based) python parser

The main purpose of this tool is to provide a command line tool which can generate java and delphi skeleton code from python source code, for the purpose of importing (e.g. Java source code) into other UML tools - which might have better layout and other features.

Whilst it currently uses the older python parser, it does have the feature (which my current ast based one used in pyNsourceGui.py doesn't) of optionally treat modules as classes, creating a "pseudo class" for each module/file. In such a case, module variables and functions are treated as attributes and methods of a 'class'. I hope to add the "treat modules as 'classes'" feature to the new ast based parser as used by pyNsourceGui.py in the future, as I think it allows us to visualise modules, not just classes.

pyYumlGui

  • Gui tool which parses python source code and uses the Yuml online service to generate png images of uml
  • Uses an older (non ast based) python parser

This was mainly a fun experiment but seems to work ok. The pynsource.py command
line tool can also generate Yuml text from python source code (use the -y option).


FAQ:

What does pynsource mean?

Since it was built in Australia, which is famous for its meat pies and sauce
at football matches, Pie-and-Sauce. Where Py = Python and Source = source code.

Download

Windows 7, Mac and Linux versions from here

SVN repository for pynsource is

http://code.google.com/p/pynsource/

Report bugs to

http://code.google.com/p/pynsource/issues/list

Mailing List

Join the mailing list and be notified when there are new releases of PyNSource.  Send an email to pynsource-subscribe@yahoogroups.com or visit here.

Send all comments to Andy Bulka.

Comments:

Posted by Marco Renedo on
Hi Andy,

I recently installed your windows executable in a Windows XP machine, I tried to graph simple python code and I got problems with the exponentiation operator. Is that expected?

Thanks in advance.

--Marco
Posted by Eric on
Hi Andy,

Is there a way to create a png or another format from PyNSource? pyYumlGui failed to do this for me, and printing to ps did not work for me either when using lpr.

Thanks,
Eric
Posted by cristian on
Hello,

I am new to pynsource and I am quite impressed of how well it works.

I would like only to find out if the next 2 tasks can also be implemented:
1. for the methods in the java generated file to have the variables included
2. keep comments from python and have them inserted in the java file.

Thank you for you reply.

Best regards,
Cristian
Posted by RajpurohitMangu on
Thanks, Andy..Your pyNsource is superb and very helpfule
Posted by Meng on
Nice post. You may be interested by the UML online modeler called GenMyModel. It designs UML-compliant models in a web-browser and generates code. http://www.genmymodel.com
Posted by Basil Peace on
It is worth to mention, which version of Python (2, 3) is supported/required for running.
Posted by pyguy on
Hi does PynSource generate Python code too? I can't find anything in the menus. I was hoping to generate simple stubs from creating a class diagram with this tool. If not, it would be really useful. Thanks!
Posted by tlzuwwnmfh on
ihgblboezqbuufsot, htaylbcxhn , [url=http://www.qucjssotxi.com/]pawhyrwomf[/url], http://www.wwdlkbhhpr.com/ htaylbcxhn
Posted by Lyzbeth on
With all these silly weeibtss, such a great page keeps my internet hope alive.
Posted by Noura on
A pllnisagey rational answer. Good to hear from you.
Posted by Foge on
For the love of God, keep writing these arecslti. http://dwwafdze.com [url=http://vnashiutnap.com]vnashiutnap[/url] [link=http://txmbgmj.com]txmbgmj[/link]
Posted by Open on
I'm not sure whether the cause is the same, but in Python 2.6, BeautifulSoup is still tihrwong UnicodeDecodeErrors on valid UTF-8 documents (speciifically, the contents of pypi.python.org). You can work around it by omitting everything past ASCII with BeautifulSoup.BeautifulSoup(text.decode( ascii', ignore')) but, of course, you lose data that way.
Posted by Chayma on
Hi, I installed Pynsorce 1.61 but I didn't know how to use it.
Can you help me?
Thank you
Posted by Jeremyinvok on
bw7607wo5036 buy viagra nj1767ca8477rs1641
Posted by Javiercet on
wq6080 http://viagra-rx-online.com women viagra ko5637as3599lg6551 ka9992rb1144
Posted by Javiercet on
lu1201 http://viagra-rx-online.com viagra by mail ga6714tq7646ro6996 oh251tk3970
Posted by Jasontug on
ja8507 http://paydayloan24.bid no teletrack no fax payday loans wo8288yq8985
Posted by Majorker on
is7636 http://paydayloan24.bid pounds for payday eo5916ns7586 vj6786 http://canadapharmacy24.top viagra erection duration ov7668ol4848 wp4375 http://levitra24.pw propecia weight loss levitra online vc2386gp4357
Posted by LanceNes on
dr1044ig5165 buy cialis md5823rq2158er9720
Posted by Georgeges on
iw4788 http://tadalafil365.bid overdose on cialis pharmacy hq3350dn6623 quality of generic cialis online pharmacy yi8557 buy cialis ns3076cl5526ti2377
Posted by Matthewslomy on
xm9394 http://payday365.bid washington state payday laws wk8989ak4193
Posted by ScottQuany on
qk8941 ix3258 Levitra ed6690
Posted by Richardtaws on
wgzqxxu

http://www.prefassecourisme.fr/411-air-jordan-rouge-feu.htm
http://www.comite-jumelage-vigneux-sur-seine.fr/458-saucony-hattori-homme.html
http://www.giovanni17.it/roshe-run-outlet-italia-799.htm
http://www.deco-at.fr/498-nike-cortez-daim-noir
http://www.caminowatch.fr/chaussures-gazelle-og-wc-farm-w-vert-et-jaune-425.html

Converse Comme Des Garçons Prix
Oakley Romeo
Vans Femme Compensé
Nike Air Force Nuovo Modello
Adidas Superstar 2 K W Chaussures
Posted by Richardtaws on
aeoavta

http://www.io-riciclo.it/815-nike-air-force-bianche-e-verdi
http://www.io-riciclo.it/480-air-force-nere-basse-prezzo
http://www.caminowatch.fr/gazelle-rose-adidas-720.html
http://www.uial.it/202-asics-bianche-e-rosse.html
http://www.amadeus-voyance.fr/061-puma-chaussure-homme-2017-ducati.html

Occhiali Ray Ban Da Vista 2016
Chaussures Gazelle Og Grise
Cappello Jordan Rosso E Nero
Saucony Blu E Verdi
New Balance Bordeaux 574 Sonic
Posted by LanceNes on
zk744 http://tadalafil365.bid webmd cialis pharmacy qj8139bd3119
Posted by RonaldSiLi on
ujwuroy

http://www.modeprice.fr/721-longchamp-collection-2016.php
http://www.giovanni17.it/nike-roshe-run-midnight-904.htm
http://www.uial.it/898-scarpe-asics-cumulus-14.html
http://www.caminowatch.fr/gazelle-adidas-homme-43-366.html
http://www.les-amis-de-nicolas-sarkozy.fr/824-nike-stefan-janoski-rose.php

Stan Smith Edition Limitée
Nike Shox Nz Turbo Oz
Vans 2016/2017
Scarpe Asics Nuova Collezione
Air Jordan Blanche Pour Femme
Posted by Curtissi on
wirhrar

http://www.les-amis-de-nicolas-sarkozy.fr/352-nike-janoski-max-noir-bleu.php
http://www.prefassecourisme.fr/661-air-jordan-2016-basse.htm
http://www.faustoparavidino.it/oakley-flak-2.0-xl.aspx
http://www.chaussurespropres.fr/superstar-adidas-rose-clair-825.html
http://www.escargot-de-monceau.fr/reebok-femme-2016-849.php

Nmd 43
Jordan 4 Retro
Nike Cortez Cuir Femme
Vans Shoes Black And White
Nike Shox Nz
Posted by LanceNes on
gi7008 http://payday365.bid vintage payday board game bh8601yw321
Posted by Matthewslomy on
gj1054 http://payday365.bid payday loans in vancouver washington hu6221dh4421
Posted by Normanicoca on
mf1582 sp4059 Cialis Coupon fj6234 ef3501 http://online-pharmacy.review sample viagra qa475cb9353 bv7115vs3483 canadian pharmacy viagra bx2643wy5948ut5632
Posted by Eugeneon on
afkvzru

http://www.animalcare.fr/adidas-stan-smith-rita-ora-030.html
http://www.brocanteur-yonne-89.fr/394-yeezy-boost-350-aliexpress.php
http://www.modeprice.fr/043-sac-longchamp-deauville.php
http://www.amadeus-voyance.fr/481-puma-creepers-blanche.html
http://www.escargot-de-monceau.fr/reebok-homme-kaki-051.php

Timberland Outlet Franciacorta
Adidas Yeezy Boost Acheter
Nike Free Run Bordeaux
Nike Janoski Floral Price Malaysia
Air Max 90 Rosse Uomo
Posted by Richardtaws on
jafaxap

http://www.chaussurespropres.fr/superstar-adidas-bleu-marine-139.html
http://www.lowcostjet.fr/187-adidas-nmd-homme-cdiscount.html
http://www.comite-jumelage-vigneux-sur-seine.fr/467-saucony-femme-running.html
http://www.modeprice.fr/466-sac-longchamp-bleu-marine-pas-cher.php
http://www.wildvisions.it/jordan-scarpe-femminili-2016

Puma Rihanna Fenty Grise
Chaussure Adidas Neo Justin Bieber
Air Force Basse Blu
Converse Femme Haute Noire
Timberland Hiking Shoes Review
Posted by Curtissi on
iwoqlzk

http://www.clinicaviaemilia.it/nike-free-3.0-flyknit-zalando-425
http://www.chaussurespropres.fr/adidas-superstar-rose-gold-femme-922.html
http://www.turismolastminute.it/370-vans-nere-invernali.html
http://www.bagage-de-bonnesante.fr/nike-roshe-run-noir-et-blanc-femme-pas-cher
http://www.alpassocoitempi.it/092-occhiali-da-vista-ray-ban-colorati.htm

Air Max Thea Vert D'eau
Saucony Shadow Femme
Nike Roshe Run Galaxy
Air Jordan 3 Femme Rouge
Superstar Adidas Homme
Posted by RickyGop on
dh2272gt8134 buy cialis online gx9579ne9399eh1299
Posted by Richardtaws on
tzmtzwr

http://www.io-riciclo.it/622-nike-air-force-af-1
http://www.bagage-de-bonnesante.fr/roshe-run-femme-floral
http://www.io-riciclo.it/795-nike-air-force-con-borchie
http://www.clinicaviaemilia.it/free-run-4-126
http://www.microquadcopter.fr/converse-basse-rose-fluo-182

Air Max 2016 Fille
Nmd Prix
Lunar Force
Air Force Scarpe Basse
New Balance Bleu Marine Et Bleu Clair
Posted by GuestBrisy on
guest test post
bbcode
html
http://googlee.te/ simple
Posted by ThomasTus on
Hello, good sites: http://canadian-pharmacy-online.review ; http://zithromax.party ; http://payday-loan-online.review ; http://levitra-online.men ; http://cialis-online.review ; http://viagra-online.men
Posted by Richardtaws on
gvofghe

http://www.tacadetinta.es/camisas-abercrombie-mercadolibre-argentina
http://www.denisemilani.es/658-airmax-outlet.php
http://www.grupoitealbacete.es/855-puma-zapatillas-hombre-meteor.html
http://www.el-codigo-promocional.es/061-reebok-botines.aspx
http://www.denisemilani.es/965-air-max-thea-opiniones.php

Saucony Ignition 4 Caracteristicas
Nmd Cs1 Primeknit
Zapatillas Nike Azules Y Verdes
Nmd 8.5
Nike Free 5.0 Amarillas
Posted by Richardtaws on
hmishae

http://www.sanjuandelamata.es/163-nike-free-run-xt-motion-fit.html
http://www.cdoviaplata.es/zapatos-mbt-de-segunda-mano-788.html
http://www.ibericarsalfer.es/zapatillas-nike-azul-celeste-225.html
http://www.ibericarsalfer.es/zapatillas-nike-hombre-urbanas-300.html
http://www.luismesacastilla.es/074-nike-roshe-run-mujer-floral.php

Nmd Adidas Rosas
Adidas Zx Flux Mujer Ebay
Chaqueta Polo Ralph Lauren Plumas
Nike Air Max 95 Baratas
Oakley Chainlink
Posted by Curtissi on
yiadwit

http://www.younes.es/185-nike-air-max-hombre-puestas
http://www.batalladefloreslaredo.es/lentes-oakley-mujer-029
http://www.younes.es/048-air-max-1-mujer
http://www.ibericarsalfer.es/zapatillas-nike-azul-turquesa-195.html
http://www.ibericarsalfer.es/zapatillas-nike-para-mujeres-ultimos-modelos-201.html

Saucony Mujer Baratas
Ray Ban Models
Nike Sb Trainerendor Merlot
Nike Roshe Run Baratas Ebay
Zapatillas Para Adelgazar Mbt
Posted by Richardtaws on
dnuxzgk

http://www.luismesacastilla.es/663-roshe-run-blancas-y-rosas.php
http://www.denisemilani.es/143-nike-huarache-blancas-y-rosas.php
http://www.ibericarsalfer.es/zapatillas-nike-running-outlet-762.html
http://www.tacadetinta.es/polo-abercrombie-hombre
http://www.felipealonso.es/770-vans-old-skool-altas.html

Tenis Presto Nike
Nike Huarache Baseball 2016
Polo Ralph Lauren Baratos Net Martina
Adidas Nmd Tumblr
Zapatillas Nike Blancas Hombre
Posted by QddieSceni on
Soldes louis vuitton boutique en ligne, ... louis vuitton pas cher a récemment étant une activité nommée "sac homme louis vuitton pas cher portefeuilles Men" a eu ... Pas Cher Louis Vuitton Louis Vuitton Sac Pas Cher odm pts Louis Vuitton pas cherVisitez eBay pour une grande sélection de portefeuilles louis vuitton. Achetez en toute sécurité et ... Nouvelle annonce Louis vuitton sarah purse portefeuille ... fhs dzy
Posted by Lenochkaka on
?????? ????! ????????? ??? ???????? ???????? ?? ???????? ?? ????: ?????? ? ????????? ??? ??????
??? ???????? ????, ??? ????? ?????????? ? ????????? ?????? ???????? ?? ???? ??? ??? ? ???????, ?????????? - ??????????. ??? ????? ??? ???? ?????? ????????? ??????.
?????????? ?? ?????? ???? ? ??????? ??? ???????????
?????????? ?????? fas.st/VPUID
Posted by Curtissi on
jmkauta

http://www.pietjebelldemusical.nl/183-adidas-sneakers-heren-zwart.html
http://www.creativesweat.de/238-saucony-fastwitch-7-herren.html
http://www.fitkid-inform.de/new-era-flex-cap.php
http://www.gombosportal.de/932-louboutin-damen.php
http://www.ausbildung-in-pflegeberufen.de/nike-air-force-schuhe-damen-079.html

Air Max 1 Eminem
Nike Janoski Grün
Nike Huarache Heren Zwart
New Balance 993 Grey/Navy
Oakley Sonnenbrille Reinigen
Posted by Richardtaws on
pwmvgwy

http://www.misstilly.co.uk/nike-running-shoes-for-women-black-and-purple-686.htm
http://www.custard-online.co.uk/609-new-era-colorado-avalanche.html
http://www.howzituk.co.uk/252-free-flyknit-mercurial-sp.html
http://www.northhampshireenterprise.co.uk/nike-stefan-janoski-max-grey-556.html
http://www.bike-courier.co.uk/nike-sb-shoes-janoski-909.html

Adidas Ultra Boost Uncaged 2016
Nike Air Max 95 Khaki
Adidas Ultra Boost Uncaged Size Chart
Nike Air Max 95 Junior Trainers
Adidas Shoes Women 2016 Flux
Leave a Reply



(Your email will not be publicly displayed.)


Captcha Code

Click the image to see another captcha.