SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
EuroPython 2011




                                  PyF – A dataflow processing framework

                                  Dataflow processing, mining, transforming and 
                                  reporting using Python.


                                  Presented by :
                                  Jonathan Schemoul




         Software Consulting and Services
What is dataflow programming ?

●   In the 70s: John Paul Morrison in Canada
    ●   Bank applications


●   We process data one by one
    ●   Items pass from one block to another, creating a flow

    ●   We transform (adapt) items in the flow like in a production 
        chain.


          Software Consulting and Services
What is dataflow programming ?

In the theory :
●   All the blocks (components) make a network
●   Components have input and output
●   Network in managed by a scheduler
       Checks network state, manage processes


●   Data sent as information packets




     Software Consulting and Services
Dataflow programming with Python
We have generators                       >>> def my_generator(size=100) :
                                         ...     for i in range(size) :
                                         ...         print « I continue », i
                                         ...         yield dict(iteration=i,
                                         ...                    answer=42)

Code execution gets                      >>> iterator = my_generator(size=5)
                                         >>> print repr(iterator.next())
resumed at next item                     I continue 0
                                         {'iteration': 0, 'answer': 42}
                                         >>> for value in iterator :
                                         ...     print repr(value)

What if we tried to use                  I continue 1
                                         {'iteration':   1, 'answer': 42}
that for dataflow                        I continue 2
                                         {'iteration':   2, 'answer': 42}
programming ?                            I continue 3
                                         {'iteration':   3, 'answer': 42}
                                         I continue 4
                                         {'iteration':   4, 'answer': 42}




      Software Consulting and Services
Chaining generators
                                           >>> def my_adapter(flux) :
To use generators for                      ...     for v in flux:
                                           ...         print « I received », v
dataflow programming...                    ...         yield dict(value=v,
                                           ...                    double=v*2)
                                           >>> it1 = xrange(5) # 0 to 5
                                           >>> it2 = my_adapter(it1)

We define the blocks , with                >>> def my_consumer(flux_adapted) :
                                           ...     for nv in flux_adapted:
generators                                 ...
                                           ...
                                                       print nv['double']
                                                       yield True # It's ok.
                                           >>> it3 = my_consumer(it2)
                                           >>> for value in it3:
                                           ...     if value is True:
●   We pass the iterator to                ...         print 'ok so far'
    another generator, making a            ...
                                           ...
                                                   else:
                                                       print 'not ok'
    pipe                                   I received 0
                                           0
                                           ok so far
                                           I received 1
●   We « adapt » the flow with             2
                                           ok so far
    each block                             [...]

        Software Consulting and Services
Just a few words

●   Blocks (components) in a process make a network
●   Each component has input and output ports
●   The network is managed using generators (lazy)
●   Transferred data can be either standard python objects 
    or « Information Packets ».




        Software Consulting and Services
Benefits using lazy flow programming with PyF

●   RAM usage is kept low even with millions of items


●   Easy to learn programmation paradigm (you take one item, you give one item – or 
    several, or none, you choose! :­))


●   All python objects can be used (not only packets)


●   No threads


●   Just standard plain python (no stackless)


●   Need to scale ? Just ask for multiprocessing !

            Software Consulting and Services
PyF in a few words

●   Development framework and environment for dataflow 
    programming

●   Based on Zflow (the low­level core is a « friendly fork »)

●   Much more than the basis : « batteries included ».




        Software Consulting and Services
PyF Architecture




Software Consulting and Services
PyF in detail

●   Plugins system
    ●   A lot of existing plugins
         –   Extraction (website, rss, sql alchemy...), 
         –   Adaptation (summarizing, attribute getters, ...),
         –   Writing (csv, xml, fixed­length, xlsx, pdf with xhtml, odt or rml templating, 
             etc.)
●   Python (and soon javascript and ruby) code can be inserted 
    directly in tube source

●   A lot of other tools (visual designer, scheduling, event logs...)

             Software Consulting and Services
The Web Service




Software Consulting and Services
Creating a tube




Software Consulting and Services
Using Code




Software Consulting and Services
Or plugins




Software Consulting and Services
Link and arrange your nodes...




Software Consulting and Services
Software Consulting and Services
Simple...




      Software Consulting and Services
●   Thank you !

●   Training is tomorrow at 14:30 in Pizza Napoli 

●   For more information :
      http://www.pyfproject.org/
      #pyf on irc.freenode.net
      http://groups.google.com/group/pyf­users


●   Business Cards available


         Software Consulting and Services
PyF Sponsors




                     http://www.xcg-consulting.fr




                      http://www.jmsinfor.com




Software Consulting and Services
Training Info

●   Tomorrow at 14:30 (2:30 PM) at Pizza Napoli

●   Please have :
    ●   Under linux : libxml2­dev libxslt­dev
    ●   Installed virtualenv (« easy_install ­UZ virtualenv »)
●   Recommended :
    ●   Predownload pyf in a new virtualenv:
         –   « easy_install ­UZ pyf[fullstack] »


         Software Consulting and Services

Contenu connexe

Tendances

[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
Tobias Lindaaker
 

Tendances (17)

[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
 
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager ExecutionTensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
TensorFlow Dev Summit 2018 Extended: TensorFlow Eager Execution
 
Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
 
C++11 Multithreading - Futures
C++11 Multithreading - FuturesC++11 Multithreading - Futures
C++11 Multithreading - Futures
 
nn network
nn networknn network
nn network
 
Free simulation sandipchaudhari_2006
Free simulation sandipchaudhari_2006Free simulation sandipchaudhari_2006
Free simulation sandipchaudhari_2006
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at Pinterest
 
Dive Into PyTorch
Dive Into PyTorchDive Into PyTorch
Dive Into PyTorch
 
The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212
 
C++11 - STL Additions
C++11 - STL AdditionsC++11 - STL Additions
C++11 - STL Additions
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
TeraSort
TeraSortTeraSort
TeraSort
 

En vedette

Functional Reactive Programming by Gerold Meisinger
Functional Reactive Programming by Gerold MeisingerFunctional Reactive Programming by Gerold Meisinger
Functional Reactive Programming by Gerold Meisinger
GeroldMeisinger
 
NoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.jsNoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.js
Henri Bergius
 

En vedette (6)

Functional Reactive Programming by Gerold Meisinger
Functional Reactive Programming by Gerold MeisingerFunctional Reactive Programming by Gerold Meisinger
Functional Reactive Programming by Gerold Meisinger
 
NoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.jsNoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.js
 
20160609 nike techtalks reactive applications tools of the trade
20160609 nike techtalks reactive applications   tools of the trade20160609 nike techtalks reactive applications   tools of the trade
20160609 nike techtalks reactive applications tools of the trade
 
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsPSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
 
Flow Base Programming with Node-RED and Functional Reactive Programming with ...
Flow Base Programming with Node-RED and Functional Reactive Programming with ...Flow Base Programming with Node-RED and Functional Reactive Programming with ...
Flow Base Programming with Node-RED and Functional Reactive Programming with ...
 
Let it Flow - Introduction to Functional Reactive Programming
Let it Flow - Introduction to Functional Reactive ProgrammingLet it Flow - Introduction to Functional Reactive Programming
Let it Flow - Introduction to Functional Reactive Programming
 

Similaire à Teasing talk for Flow-based programming made easy with PyF 2.0

One Path to a Successful Implementation of NaturalONE
One Path to a Successful Implementation of NaturalONEOne Path to a Successful Implementation of NaturalONE
One Path to a Successful Implementation of NaturalONE
Software AG
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
Craig Schumann
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Using R on Netezza
Using R on NetezzaUsing R on Netezza
Using R on Netezza
Ajay Ohri
 

Similaire à Teasing talk for Flow-based programming made easy with PyF 2.0 (20)

One Path to a Successful Implementation of NaturalONE
One Path to a Successful Implementation of NaturalONEOne Path to a Successful Implementation of NaturalONE
One Path to a Successful Implementation of NaturalONE
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
 
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
OSMC 2010 |  NSClient++ - what's new? And what's coming! by Michael MedinOSMC 2010 |  NSClient++ - what's new? And what's coming! by Michael Medin
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
 
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the UglyKotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
 
“Practical Guide to Implementing Deep Neural Network Inferencing at the Edge,...
“Practical Guide to Implementing Deep Neural Network Inferencing at the Edge,...“Practical Guide to Implementing Deep Neural Network Inferencing at the Edge,...
“Practical Guide to Implementing Deep Neural Network Inferencing at the Edge,...
 
Programming python quick intro for schools
Programming python quick intro for schoolsProgramming python quick intro for schools
Programming python quick intro for schools
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Faster computation with matlab
Faster computation with matlabFaster computation with matlab
Faster computation with matlab
 
Using R on Netezza
Using R on NetezzaUsing R on Netezza
Using R on Netezza
 
Python lecture 03
Python lecture 03Python lecture 03
Python lecture 03
 
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & GeneratorsPython Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & Generators
 
Introduction to Tensor Flow for Optical Character Recognition (OCR)
Introduction to Tensor Flow for Optical Character Recognition (OCR)Introduction to Tensor Flow for Optical Character Recognition (OCR)
Introduction to Tensor Flow for Optical Character Recognition (OCR)
 
Parallel Processing with IPython
Parallel Processing with IPythonParallel Processing with IPython
Parallel Processing with IPython
 
F sharp - an overview
F sharp - an overviewF sharp - an overview
F sharp - an overview
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
 
關於測試,我說的其實是......
關於測試,我說的其實是......關於測試,我說的其實是......
關於測試,我說的其實是......
 
Lecture11
Lecture11Lecture11
Lecture11
 
Apache Pinot Meetup Sept02, 2020
Apache Pinot Meetup Sept02, 2020Apache Pinot Meetup Sept02, 2020
Apache Pinot Meetup Sept02, 2020
 

Dernier

RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
amitlee9823
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
amitlee9823
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion pills in Kuwait Cytotec pills in Kuwait
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
saipriyacoool
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
amitlee9823
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
nirzagarg
 

Dernier (20)

Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Nagpur Escorts ☎️8617370543 Starting From 5K to 25K ...
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men  🔝dharamshala🔝  ...
➥🔝 7737669865 🔝▻ dharamshala Call-girls in Women Seeking Men 🔝dharamshala🔝 ...
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfJordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
 

Teasing talk for Flow-based programming made easy with PyF 2.0

  • 1. EuroPython 2011 PyF – A dataflow processing framework Dataflow processing, mining, transforming and  reporting using Python. Presented by : Jonathan Schemoul Software Consulting and Services
  • 2. What is dataflow programming ? ● In the 70s: John Paul Morrison in Canada ● Bank applications ● We process data one by one ● Items pass from one block to another, creating a flow ● We transform (adapt) items in the flow like in a production  chain. Software Consulting and Services
  • 3. What is dataflow programming ? In the theory : ● All the blocks (components) make a network ● Components have input and output ● Network in managed by a scheduler Checks network state, manage processes ● Data sent as information packets Software Consulting and Services
  • 4. Dataflow programming with Python We have generators >>> def my_generator(size=100) : ... for i in range(size) : ... print « I continue », i ... yield dict(iteration=i, ... answer=42) Code execution gets  >>> iterator = my_generator(size=5) >>> print repr(iterator.next()) resumed at next item I continue 0 {'iteration': 0, 'answer': 42} >>> for value in iterator : ... print repr(value) What if we tried to use  I continue 1 {'iteration': 1, 'answer': 42} that for dataflow  I continue 2 {'iteration': 2, 'answer': 42} programming ? I continue 3 {'iteration': 3, 'answer': 42} I continue 4 {'iteration': 4, 'answer': 42} Software Consulting and Services
  • 5. Chaining generators >>> def my_adapter(flux) : To use generators for  ... for v in flux: ... print « I received », v dataflow programming... ... yield dict(value=v, ... double=v*2) >>> it1 = xrange(5) # 0 to 5 >>> it2 = my_adapter(it1) We define the blocks , with  >>> def my_consumer(flux_adapted) : ... for nv in flux_adapted: generators ... ... print nv['double'] yield True # It's ok. >>> it3 = my_consumer(it2) >>> for value in it3: ... if value is True: ● We pass the iterator to  ... print 'ok so far' another generator, making a  ... ... else: print 'not ok' pipe I received 0 0 ok so far I received 1 ● We « adapt » the flow with  2 ok so far each block [...] Software Consulting and Services
  • 6. Just a few words ● Blocks (components) in a process make a network ● Each component has input and output ports ● The network is managed using generators (lazy) ● Transferred data can be either standard python objects  or « Information Packets ». Software Consulting and Services
  • 7. Benefits using lazy flow programming with PyF ● RAM usage is kept low even with millions of items ● Easy to learn programmation paradigm (you take one item, you give one item – or  several, or none, you choose! :­)) ● All python objects can be used (not only packets) ● No threads ● Just standard plain python (no stackless) ● Need to scale ? Just ask for multiprocessing ! Software Consulting and Services
  • 8. PyF in a few words ● Development framework and environment for dataflow  programming ● Based on Zflow (the low­level core is a « friendly fork ») ● Much more than the basis : « batteries included ». Software Consulting and Services
  • 10. PyF in detail ● Plugins system ● A lot of existing plugins – Extraction (website, rss, sql alchemy...),  – Adaptation (summarizing, attribute getters, ...), – Writing (csv, xml, fixed­length, xlsx, pdf with xhtml, odt or rml templating,  etc.) ● Python (and soon javascript and ruby) code can be inserted  directly in tube source ● A lot of other tools (visual designer, scheduling, event logs...) Software Consulting and Services
  • 17. Simple... Software Consulting and Services
  • 18. Thank you ! ● Training is tomorrow at 14:30 in Pizza Napoli  ● For more information : http://www.pyfproject.org/ #pyf on irc.freenode.net http://groups.google.com/group/pyf­users ● Business Cards available Software Consulting and Services
  • 19. PyF Sponsors http://www.xcg-consulting.fr http://www.jmsinfor.com Software Consulting and Services
  • 20. Training Info ● Tomorrow at 14:30 (2:30 PM) at Pizza Napoli ● Please have : ● Under linux : libxml2­dev libxslt­dev ● Installed virtualenv (« easy_install ­UZ virtualenv ») ● Recommended : ● Predownload pyf in a new virtualenv: – « easy_install ­UZ pyf[fullstack] » Software Consulting and Services