Skip to main content

view color images & 3d scientific plots in ssh terminal (screenshots using putty ssh terminal included)

Project description

################################################################################
originally an ascii art graphics library for ssh terminal,
but expanded to include scientific visualization.

this package has 2 main files:
asciiporn/__init__.py ## initialize custom import hook to load main.py
asciiporn/main.py ## contains EVERYTHING

how to enable 256 color in putty: http://www.emacswiki.org/emacs/PuTTY#toc2
how to enable 256 color in xterm: http://www.frexx.de/xterm-256-notes/
how to enable 256 color in screen: http://www.frexx.de/xterm-256-notes/

~ L_ '_-s+ _ ?}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' `{' _~ ` 't` 7~-- ` ^ f@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M@@@@@@@@@@@@@@@@@@@@
_,-),?j{WY+=+j ` ^7^ ` ` H@@@@@@@@@@@@@@@@@@@@@@@MQk9ZIV7=?IM@@@@@@@@@@@@@@@
t' ~``nvi;f*o7L? `L~ ` &#M@M$@@@@@@@@@@@@@@@@@P`/r`,_S^?`>^JT@{M@@@@@@@@@@
rr| + _` _^^LFFLW#W5| > '__`{PRy$y@Wf$N)i'fRM@@@@MM$r`^]g@`{~]{{rg>!'`}@@@@@@@@@
*' '`^!_ ^@&My;r,'p&#MV` 'ujmr)` `Lr( {_`R?@r= `_^'MPM#&B$f1Bp=` -]@@@@@@@@
-r,r9` `_`J]3@$[`P`AVN- -=yE ` _i ` ^`Li~i !YL `kj`'@MNMg@#Wggp{#@@@@@@@@
'` i' l|' F _]I]/#P )vAL >pqA}&_` !J x?g1>LV'i~l+ _ ?Vu__|V@@@@@$${1@@@@@@@@
` '`` '-h$g@@@&$w])#R[X/NF^>-t,r-=`/hTW=~x!'!^`+gg@@&M#&W@@@@Mu#M@@@@@@@@
` _' jg@@@@@M@@@@Mwm@p`#gj/c^ `' 9` v `` _Vg@M@@@@@@M@@M@@@gD{kM@@@@@@
` _ _3H##&@Mg#@@@@@@p#N4@Wu9Mx`` _ `!1 !`| (&@@@W@@@@@@@@$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_iCJ
W^_Jk=v`|,LwT>_^rr||||VL3__=r=i^ _ Y'xtXj`^_ _-^Z#sMU&j2{ ^ J |'t7v 'i!n)
zL''?^`_?YLr^ sr|TV-+?!'+|[Y]'CY]jY^?i+iuL> ^ --Tsja]kIgL, `_ ~i` _ '- >`'-jLu
!C ` `w3Y^ `~(-+--3~sJ71l^i^^L>|?{+^``L - ` ^ ^>7cmQdkzC & '_`'`L' ```(?_' ~ll
r r`+vvr~ xJ__==={f=Ls_L7iVr V?T3`l`-]'t|^_ ' Y`=u}l^ s ]` -' ' `,|_i`t`t~,Lr
-+7 !_^+(----'VSVc>zzl?`L=~ioV'x`^)*>T` x+>77'^ %$` !!^~'` !x``'{`Y[-
``V{ ` Vrr-)?///?VC~l?>zx|_st{-oJ!xf+>!{=r! _ _ #$` ! `| `J,`` `!`!~
L`+_Jvi7++^='r?+n^T?[c!_,S?{{iF~( !^FL~ 'Y ` ' -NNMY ! { >, _,` `i+[
ci ` _`x_rr>_|'r>>`jY( (_kk|`{J)s_^L|V--+ ` ` - !'>)kkMeT s^|T {>L C''^'!-~r

SIDEVIEW Y: Z 0 to 2 Y -0.99983900113 to 1.0 T 0.0 to 7.0 MIN MAX
l?*~_-----_>cC}lTl{7Tx_--------------------------------------------_+*Tll'*+_---
| T, ,r',*l '_ ), .( `-_
| a_ / )_ \_ ,* ,(
| ,C ~C `. , ) )
| ) > \ \ \ / / (
| / / \ '_ ^ ' _^ '
| ( ' '_ `_ ) ' ' ,'
|r _' `c '_ ,' ,' ,
( ' _ c ` , ,' ,
| ' `c c `_ , , .
|' `c _ ` , ,' +
----------------`---------------L-`-------------- --.--------------,'-+--------
| _ c `_ . ,' +
| _ `C ` . ,' +
| c . . ,
| `C , c , , )
| , . ?c ) ) /
| x t . / < /
| \ \ \ ( / _*
| '_ '_ ;C ,' ,'
| x (%) x x _x
| '< _>' ?x_'C >'_r'
|------------------------------`*<____>r------`*<{jy_yj1+*'---------------------

TOPVIEW Z: Z 0.0 to 0.25 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J2}Xeh8 8UKXjts^+:_.` `
dRP]}FY?|>,-' `.'!\vLTSknZA D%I5{ST/|*>!.` `.'(\?;)zyawH# dAPy1FYl|>,-' '
d6Py1F;l|>,-' `._~*xJCjXKI9 $8hGX}oslv:,-' `'!,*r/Cok3IhD 9InkfC/ri~-'` '-
d6wy1=;l+(_.` `-_:+l;c1yw68 #HAKyftY|+>_.` `.'>\L^tjVGOm 86w{oc;x\:_.` `._
d6wz3=s^+(_.` '-,(r?7=[uEA DRZ3kF(7x~i!'` '!,:r/T2n4ZRQ dAEu3=7?+(,-` `'_~
d6wz3(s^*(_.` `''!>vLT2V5G% $8qUV[=J?\(_-` `.'>*?^tjuGAH# p04zSCJxi~'.` '-~i
d6wz3(sx*:'.` `''!ixJ)fXKUh NdAGyft^|*>'.` `-,:v/C2n1ZRQ qe]}(Yl+:_.` `._(+
d04XjcJx\:''` `.'~\^stoywRH W6wKkFTYx:,!' `''>*|^tfya9b& 9GaVST/ri,-' `.'~*x
d04XjcJv\~-'` `._:*lY(3uEAm gpI3[=Jl+(_-` `.,:vlT2n3I6W m6wzj(Jx\:''` `''!>vL
d04XocLv\~-' `-,(+/7F}aG9 @d9GVj);?~i!.` '-i~r/)jyK0d& 8Gakf)?|>!.` '-,(+/T

AUTHOR:
kai zhu
kaizhu256@gmail.com

REQUIREMENTS:
posix os
Python 2.6
Python Imaging Library http://www.pythonware.com/products/pil
numpy http://www.scipy.org/Download

INSTALL:
python setup.py build
python setup.py install
python setup.py dev --quicktest

USAGE:
$ python setup.py dev --quicktest
render color image in shell terminal &
plot scientific functions as well



>>> from asciiporn import *

>>> print( img2txt("filename") )
display color image from gif, jpg, bmp, ... to screen.
only works if u have Python Imaging Library installed

>>> help(img2txt.load)
display img2txt options



>>> plot(ft = lambda t: cos(t), tmin = 0, tmax = 16)
plot cos(t) for t = [0, 16]

>>> plot(ft = [cos, sin], tmin = 0, tmax = 16)
plot 2 functions, cos & sin

>>> plot( y = [1.5, 2.5, 3.5], t = [0, 1, 2] )
plot datapoints (y, t) = (1.5, 0), (2.5, 1), (3.5, 2)

>>> f = lambda t, z: sin( t*(2*pi + z) ) * (0.5 + z) - z
>>> plot3d(ftz = ftz, tmin = 0, tmax = 16, zmin = 0, zmax = 1)
plot f in 3d using specified ranges for t & z

>>> help(plot.__call__)
>>> help(dataZYT.__new__)
display plot options



>>> fitpoly2d.test()
test asciiporn's polynomial fitting routine
peruse fitpoly.test in asciiporn/main.py for usage

>>> fft2d.test()
test asciiporn's cosine fitting routine
peruse fft2d.test in asciiporn/main.py for usage

################################################################################
RECENT CHANGELOG:
20090407
fixed installation bugs
added retro-gif feature
20090328
removed py3to2 requirement
update documentation
20090103
rewrote 3d plotter
fixed more 64bit issues
20081123
fixed bug where 64bit gets truncated to 32 on 32bit machine
256 color support
20081119
fixed bugs in setup.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asciiporn-2009.05.01.tar.gz (358.0 kB view details)

Uploaded Source

File details

Details for the file asciiporn-2009.05.01.tar.gz.

File metadata

File hashes

Hashes for asciiporn-2009.05.01.tar.gz
Algorithm Hash digest
SHA256 a2a51230f429e5ccbe2095a616fde303314b43b947ce0bff9b23d4faeff3d721
MD5 4ee8276f6e0bb3f3b7fb9b089d4a26e2
BLAKE2b-256 7ea8e39edfcbb41abbf76d9fc8121c8d0fc092cfdcbe73ca855fb92a49bd73e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page