SlideShare a Scribd company logo
1 of 31
PyPedia


The free programming environment
       that anyone can edit!
From:
http://wiki.python.org/moin/SandboxedPython




Hmm.. nice idea.

Fortunately, there is a Sandboxed Python: googleappengine

..and an advanced, highly extendable wiki engine: Mediawiki

The combination of all these is… PyPedia


This presentation takes a tour to the core functionality of www.pypedia.com
Let’s say you have a method in python:
• Sign in www.pypedia.com . Suppose that your
  username is “JohnDoe”.
   (In the rest of this presentation replace “JohnDoe” with your username)



• Create an article with title: Foo_user_JohnDoe

• Save the article with the prefilled text unchanged.
The article
should
look like this
• Edit the “code” section and add the code of
  the method.
• Tip: Click three times in the code text area for
  code friendly formatting.
• Save the edit.
• Done! You have a script of your own published
  in PyPedia.
• In the article, press the “Execute on browser”
  button (              )
• The function’s output and returned value
  appear in an area under the button:
• Let’s add some parameters
• Edit the code:
• Then edit the parameters section:
• This is what you see:




• Inside the <inputs> tags add the text:
<param name="arg_1"   type="data" value="default_input"   label="Enter value for argument 1:"/>
<param name="arg_2"   type="eval" value=”4"               label="Enter value for argument 2:"/>
• What are all these??



                                                                 Ignore this part
                                                                 Automatically generated
                                                                 (Edits here will be removed)



                                                                 Add this part


                                                                  Text to display in the form


                           • If type=“data” then the input is treated as
                             string
The name of the argument   • If type=“eval” then the input is treated as     Default values
                             python expression (i.e. [3,4,5])
• Click save. The parameters section of the
  article should look like this:




• Fill the parameters and press the “Execute on
  browser” button. This should appear:

                        Play with the arguments. A complete online
                        script has been created!
Cool, but I want to call the function from my local
computer..

• Install the PyPedia python library:
git clone git://github.com/kantale/pypedia.git

• Load the function in python:
>>> import pypedia
>>> from pypedia import Foo_user_JohnDoe
>>> print foo_user_JohnDoe(“test”, [1,2,3])
  function foo
  Arguments: test [1,2,3]
  42
>>>

• You can call the method of any user and your
  method can be called by anyone
Some tips of the python library:
• pypedia.before_timestamp = “20120416000000”
  – Import the most recent revision of functions and
    classes that are older than 16/4/2012 (something like
    method permalinks..)
• pypedia.enable_cache = True
  – Suppress method download if method already exists
• pypedia.debug = True
  – For debug info
• pypedia.warnings = False
  – Suppress warnings
You can call the function from the PyPedia front page:
Now let’s make another article:
• Create the article: Goo_user_JohnDoe
• Edit the code section:
• Save and press the button “Execute on browser”




• A method can call any other method without
  importing.
• All PyPedia articles belong to the same
  namespace (as with any wiki).
• Same behavior exists for classes.
• In the Goo_user_JohnDoe article press the
  “Download code” button.
• The file Goo_user_JohnDoe.py is downloaded.
• Open this file with a text editor:




• It contains all the code required for executing the
  method (including the user parameters).
• Executing locally the method is as simple as:
#> python Goo_user_JohnDoe.py
• In the Foo_user_JohnDoe article edit the
  section “Unit tests”:
• Now edit the code of the method (edit the
  code section) so that it will not return 42, but
  something else. Upon saving, this pops up:




• With unitests you can guarantee a certain
  behavior of your methods.
• As with any wiki, in PyPedia a method can
  have more than one name:
• Create the page: Hoo_user_JohnDoe
• Replace all the prefilled text with:
  #REDIRECT [[Foo_user_JohnDoe]]
• Save the page
• In the front page run:
Hoo_user_JohnDoe("test", [1,2,3])
• The result is exactly the same as running the
  function: Foo_user_JohnDoe
Executing a method in a remote computer:
• Edit your user page and add an “ssh” section:


                           ==ssh==
                           host=www.example.com
                           username=JohnDoe
                           path=/home/JohnDoe/runPyPedia




• Substitute the above values with real ones for a
  computer that you have remote access (the
  username doesn’t have to be the same as your
  PyPedia username).
• Save the page.
• This content is NOT shown to anyone and
  there isn’t anyway to retrieve it (to change just
  make another “ssh” section).
• Login and cd to the path that you declared of
  your remote computer.
• Install there:
      – The PyPedia python library:
git clone git://github.com/kantale/pypedia.git
      – The utility ssh_wpl_client:
wgethttps://raw.github.com/kantale/PyPedia_server/master/utils/ssh_wpl_client.py
• On the article Foo_user_JohnDoe press the
  “Execute on remote computer” button.
• Enter the password of your remote computer
  and press GO!




• A new tab opens with the following content:
PyPedia’s REST api:
• http://www.pypedia.com/index.php?get_code=G
  oo_user_JohnDoe(1,2)
  – Fetch the constraint-free version necessary to run the
    command Goo_user_JohnDoe(1,2)
  – Use wget or curl to save the content in a file
• http://www.pypedia.com/index.php?b_timestam
  p=20120418000000&get_code=Goo_user_JohnD
  oe(1,2)
  – Fetch the most recent revision of the constraint-free
    version of the code as it was before 18/4/2012
• By sharing these links we can archive and
  reproduce our analysis.
Who can edit my article?
• By default only you (and the admins) can edit
  any part of the article.
• Edit the Permissions subsections and add any
  users (coma separated) that you want to allow
  editing.
• Special user names:
  – SIGNED: Any signed user can edit this section
  – ALL: Any user can edit this section
• On the top of each article there is a button:

• With this you can create a personalized version of the
  article that only you can edit.
• For example if you fork the article:
  Foo_user_Someonethen the article
  Foo_user_JohnDoewill be created with the same
  content but with different user privileges.
• This is similar to the Github’s “fork” feature.
What is the “Development Code” section ?
• ANY user (yes any) can edit this section. The
  code is not parsed, not downloaded and not
  run at all.
• Users (that are not allowed to edit) should use
  this section to make suggestions for code
  corrections.
• Alternatively they can use the Talk pages for
  comments regarding any part of the article.
• The Documentation, Return and See also
  subsections allow any kind of content.
• Use wiki text formatting in these sections to
  document your method and help other people
  to use it.
• All content is under the Simplified BSD License
• Articles that are well written and documented
  with thorough unitests and parameters may be
  copied to the main namespace by the admins
• I.e. if the method Foo_user_JohnDoe is good
  enough, the admins can create the article Foo
  with the same content
• Only the admins can edit the main namespace
How safe are the contents of PyPedia ??
• Run “User” methods only if you trust the code
  or the user (or if you are running in a sandbox).
• The admins can delete methods with misleading
  and/or malicious content.
• Methods in the main namespace should be
  considered safe.
• As with any open content no guarantee is given
  for the security or efficiency of the code.
Thanks for reading!

• Contact: admin@pypedia.com
• Join us in google groups:
  http://groups.google.com/group/pypedia
• Twitter: @PyPedia

• PyPedia’s source code:
  – Mediawiki extension:
    https://github.com/kantale/PyPedia_server
  – Python library:
    https://github.com/kantale/pypedia

More Related Content

What's hot

Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsEffie Arditi
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016Codemotion
 
Sunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil Phani
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans Fabrizio Giudici
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra Sencha
 
WuKong - Framework for Integrated Test
WuKong - Framework for Integrated TestWuKong - Framework for Integrated Test
WuKong - Framework for Integrated TestSummer Lu
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnitWO Community
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engineWO Community
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play FrameworkKnoldus Inc.
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dslMatthew Farwell
 

What's hot (20)

Apache Ant
Apache AntApache Ant
Apache Ant
 
Group111
Group111Group111
Group111
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
119764860 dx-auth
119764860 dx-auth119764860 dx-auth
119764860 dx-auth
 
KAAccessControl
KAAccessControlKAAccessControl
KAAccessControl
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016
How To Structure Go Applications - Paul Bellamy - Codemotion Milan 2016
 
Sunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil phani's take on windows powershell
Sunil phani's take on windows powershell
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans
 
Wt unit 5
Wt unit 5Wt unit 5
Wt unit 5
 
Java JDBC
Java JDBCJava JDBC
Java JDBC
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
WuKong - Framework for Integrated Test
WuKong - Framework for Integrated TestWuKong - Framework for Integrated Test
WuKong - Framework for Integrated Test
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnit
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engine
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dsl
 

Viewers also liked

Presentació1
Presentació1Presentació1
Presentació1marc9296
 
Mag slideshow final
Mag slideshow finalMag slideshow final
Mag slideshow finalagreen1994
 
Music Portfolio
Music PortfolioMusic Portfolio
Music Portfolioamybrandon
 
Practicum fall 2011
Practicum fall 2011Practicum fall 2011
Practicum fall 2011gennasarnak
 
Mag slideshow final
Mag slideshow finalMag slideshow final
Mag slideshow finalagreen1994
 

Viewers also liked (6)

Presentació1
Presentació1Presentació1
Presentació1
 
Mag slideshow final
Mag slideshow finalMag slideshow final
Mag slideshow final
 
Music Portfolio
Music PortfolioMusic Portfolio
Music Portfolio
 
Pcboverview
PcboverviewPcboverview
Pcboverview
 
Practicum fall 2011
Practicum fall 2011Practicum fall 2011
Practicum fall 2011
 
Mag slideshow final
Mag slideshow finalMag slideshow final
Mag slideshow final
 

Similar to PyPedia

PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Sebastian Witowski
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Antonio Peric-Mazar
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Pei-Hsuan Hsieh
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Processopenstackindia
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jiralenamattt
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
In this project, you will learn to use some of the team” features o.docx
In this project, you will learn to use some of the team” features o.docxIn this project, you will learn to use some of the team” features o.docx
In this project, you will learn to use some of the team” features o.docxbreaksdayle
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityTeamstudio
 
Mercurial training
 Mercurial training Mercurial training
Mercurial trainingTrung Huynh
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell ModulesJune Blender
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyLeslie Doherty
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best PracitcesJustin Filip
 
Owner - Java properties reinvented.
Owner - Java properties reinvented.Owner - Java properties reinvented.
Owner - Java properties reinvented.Luigi Viggiano
 

Similar to PyPedia (20)

PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
In this project, you will learn to use some of the team” features o.docx
In this project, you will learn to use some of the team” features o.docxIn this project, you will learn to use some of the team” features o.docx
In this project, you will learn to use some of the team” features o.docx
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Mercurial training
 Mercurial training Mercurial training
Mercurial training
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
 
Baabtra django framework installation and sample project using aptana
Baabtra django framework installation and sample project using aptanaBaabtra django framework installation and sample project using aptana
Baabtra django framework installation and sample project using aptana
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
 
Owner - Java properties reinvented.
Owner - Java properties reinvented.Owner - Java properties reinvented.
Owner - Java properties reinvented.
 

Recently uploaded

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

PyPedia

  • 1. PyPedia The free programming environment that anyone can edit!
  • 2. From: http://wiki.python.org/moin/SandboxedPython Hmm.. nice idea. Fortunately, there is a Sandboxed Python: googleappengine ..and an advanced, highly extendable wiki engine: Mediawiki The combination of all these is… PyPedia This presentation takes a tour to the core functionality of www.pypedia.com
  • 3. Let’s say you have a method in python:
  • 4. • Sign in www.pypedia.com . Suppose that your username is “JohnDoe”. (In the rest of this presentation replace “JohnDoe” with your username) • Create an article with title: Foo_user_JohnDoe • Save the article with the prefilled text unchanged.
  • 6. • Edit the “code” section and add the code of the method. • Tip: Click three times in the code text area for code friendly formatting.
  • 7. • Save the edit. • Done! You have a script of your own published in PyPedia. • In the article, press the “Execute on browser” button ( ) • The function’s output and returned value appear in an area under the button:
  • 8. • Let’s add some parameters • Edit the code:
  • 9. • Then edit the parameters section: • This is what you see: • Inside the <inputs> tags add the text: <param name="arg_1" type="data" value="default_input" label="Enter value for argument 1:"/> <param name="arg_2" type="eval" value=”4" label="Enter value for argument 2:"/>
  • 10. • What are all these?? Ignore this part Automatically generated (Edits here will be removed) Add this part Text to display in the form • If type=“data” then the input is treated as string The name of the argument • If type=“eval” then the input is treated as Default values python expression (i.e. [3,4,5])
  • 11. • Click save. The parameters section of the article should look like this: • Fill the parameters and press the “Execute on browser” button. This should appear: Play with the arguments. A complete online script has been created!
  • 12. Cool, but I want to call the function from my local computer.. • Install the PyPedia python library: git clone git://github.com/kantale/pypedia.git • Load the function in python: >>> import pypedia >>> from pypedia import Foo_user_JohnDoe >>> print foo_user_JohnDoe(“test”, [1,2,3]) function foo Arguments: test [1,2,3] 42 >>> • You can call the method of any user and your method can be called by anyone
  • 13. Some tips of the python library: • pypedia.before_timestamp = “20120416000000” – Import the most recent revision of functions and classes that are older than 16/4/2012 (something like method permalinks..) • pypedia.enable_cache = True – Suppress method download if method already exists • pypedia.debug = True – For debug info • pypedia.warnings = False – Suppress warnings
  • 14. You can call the function from the PyPedia front page:
  • 15. Now let’s make another article: • Create the article: Goo_user_JohnDoe • Edit the code section:
  • 16. • Save and press the button “Execute on browser” • A method can call any other method without importing. • All PyPedia articles belong to the same namespace (as with any wiki). • Same behavior exists for classes.
  • 17. • In the Goo_user_JohnDoe article press the “Download code” button. • The file Goo_user_JohnDoe.py is downloaded. • Open this file with a text editor: • It contains all the code required for executing the method (including the user parameters). • Executing locally the method is as simple as: #> python Goo_user_JohnDoe.py
  • 18. • In the Foo_user_JohnDoe article edit the section “Unit tests”:
  • 19. • Now edit the code of the method (edit the code section) so that it will not return 42, but something else. Upon saving, this pops up: • With unitests you can guarantee a certain behavior of your methods.
  • 20. • As with any wiki, in PyPedia a method can have more than one name: • Create the page: Hoo_user_JohnDoe • Replace all the prefilled text with: #REDIRECT [[Foo_user_JohnDoe]] • Save the page • In the front page run: Hoo_user_JohnDoe("test", [1,2,3]) • The result is exactly the same as running the function: Foo_user_JohnDoe
  • 21. Executing a method in a remote computer: • Edit your user page and add an “ssh” section: ==ssh== host=www.example.com username=JohnDoe path=/home/JohnDoe/runPyPedia • Substitute the above values with real ones for a computer that you have remote access (the username doesn’t have to be the same as your PyPedia username).
  • 22. • Save the page. • This content is NOT shown to anyone and there isn’t anyway to retrieve it (to change just make another “ssh” section). • Login and cd to the path that you declared of your remote computer. • Install there: – The PyPedia python library: git clone git://github.com/kantale/pypedia.git – The utility ssh_wpl_client: wgethttps://raw.github.com/kantale/PyPedia_server/master/utils/ssh_wpl_client.py
  • 23. • On the article Foo_user_JohnDoe press the “Execute on remote computer” button. • Enter the password of your remote computer and press GO! • A new tab opens with the following content:
  • 24. PyPedia’s REST api: • http://www.pypedia.com/index.php?get_code=G oo_user_JohnDoe(1,2) – Fetch the constraint-free version necessary to run the command Goo_user_JohnDoe(1,2) – Use wget or curl to save the content in a file • http://www.pypedia.com/index.php?b_timestam p=20120418000000&get_code=Goo_user_JohnD oe(1,2) – Fetch the most recent revision of the constraint-free version of the code as it was before 18/4/2012 • By sharing these links we can archive and reproduce our analysis.
  • 25. Who can edit my article? • By default only you (and the admins) can edit any part of the article. • Edit the Permissions subsections and add any users (coma separated) that you want to allow editing. • Special user names: – SIGNED: Any signed user can edit this section – ALL: Any user can edit this section
  • 26. • On the top of each article there is a button: • With this you can create a personalized version of the article that only you can edit. • For example if you fork the article: Foo_user_Someonethen the article Foo_user_JohnDoewill be created with the same content but with different user privileges. • This is similar to the Github’s “fork” feature.
  • 27. What is the “Development Code” section ? • ANY user (yes any) can edit this section. The code is not parsed, not downloaded and not run at all. • Users (that are not allowed to edit) should use this section to make suggestions for code corrections. • Alternatively they can use the Talk pages for comments regarding any part of the article.
  • 28. • The Documentation, Return and See also subsections allow any kind of content. • Use wiki text formatting in these sections to document your method and help other people to use it.
  • 29. • All content is under the Simplified BSD License • Articles that are well written and documented with thorough unitests and parameters may be copied to the main namespace by the admins • I.e. if the method Foo_user_JohnDoe is good enough, the admins can create the article Foo with the same content • Only the admins can edit the main namespace
  • 30. How safe are the contents of PyPedia ?? • Run “User” methods only if you trust the code or the user (or if you are running in a sandbox). • The admins can delete methods with misleading and/or malicious content. • Methods in the main namespace should be considered safe. • As with any open content no guarantee is given for the security or efficiency of the code.
  • 31. Thanks for reading! • Contact: admin@pypedia.com • Join us in google groups: http://groups.google.com/group/pypedia • Twitter: @PyPedia • PyPedia’s source code: – Mediawiki extension: https://github.com/kantale/PyPedia_server – Python library: https://github.com/kantale/pypedia