Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Pyxley: Easy Web Applications with Flask and React.js

3,533 views

Published on

Slides for the PyGotham presentation on the Pyxley Python package. It covers the motivation behind the creation of Pyxley and how it works. Talk can be found at https://youtu.be/WG2HZeG6zxE

Published in: Data & Analytics
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • -- DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT -- ......................................................................................................................... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... (Unlimited)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ..............ACCESS that WEBSITE Over for All Ebooks ................ ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Download or read that Ebooks here ... ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ACCESS that WEBSITE Over for All Ebooks (Unlimited) ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... DOWNLOAD FULL EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Pyxley: Easy Web Applications with Flask and React.js

  1. 1. Pyxley Easy Web Applications with Flask and React. js Nick Kridler Stitch Fix IIIIIISI 2015
  2. 2. About Me wm; í WWWWW ON 2T Data Scientist (Merch Algorithms) at Stitch Fix Studied Applied Math Previously worked in Defense & Healthcare Winner of Kaggle Whale Detection Challenge
  3. 3. f’ ¿’v i’ m’ 55.‘ ¿’Mi l Stitch Fix How It Works (¡JET Liu": “tl“l, l uingii Iflgl’ 5
  4. 4. Merch Algorithms Inventory Optimization How do we optimize buying, planning, etc? Product Development How do we find the right items? Presenting Data to Our Business Partners is the First Step Towards Answering These Questions
  5. 5. The Merch Team Loves Tables & Spreadsheets They Also Love Drilldowns . ..Sti| | Trying to Get Them Excited About Plots
  6. 6. Enter Shiny ¡i i. É É E S E E É - É É E E S É É < 8 E n. Our n: O8 031 08 08 IM 08 O8 08 O8 ca OI 0B Í É E! ¡ {I [I Si I 1 S Í Í l SÜÉGEIIIÉSII} 5 5 S S E E E 5
  7. 7. How We Use Shiny Cached CSV extracts Data refreshed daily Drilldowns and Tables for exploration
  8. 8. Shiny does the trick, but. .. it's in R it's hard to debug adding custom JavaScript is tricky it's easy to mess up CLI. )
  9. 9. What | Want Lightweight web application Data prep ¡n Python Integration with arbitrary Javascript libraries
  10. 10. NlCk Üñnday <- C‘ l a 127.o. o.1:5ooo Q i 7 Uatav Line Chart Histogram Show lO 2 entrin wm Sun om End nm Calnrin suma su. » Dittmcn (ma 25 ¡cuco-Is ZCIS-Có-l/ ¡943 23602 ¡o s3 2.: 20:3 oo ca zcws co m 20155 mas: 33.2’ 23 2era os c‘ ms cs or zcvs 72092 3721 22 zcimoszs zcisrcsrsv zorro 63244 29.35 21 2o“: 0519 2015 cs 24 20790 75764 315-3 51cm ng l tu 3 ua entries m, 2 N“:
  11. 11. Python Options Bokeh & Spyre Web applications in pure Python Matplotlib in the web-browser Minimalistic web frameworks Missing the Integration with JavaScript piece
  12. 12. The Internet to the Rescue! Real Python Blog The Ultimate Flask Freire-Ene!
  13. 13. Why React? Only concerned with UI Components are easy to organize Modularity makes compositions a breeze It's fast
  14. 14. A Simple React Component Provides a Point of Integration for Python nr ¡[vivian '44 Larmgi-iniqun: nu “tmmprnzniunuu in" Kai-ich. mani-law 4.5514!‘ ‘¡guyikcï- ¡gq-u! oai¡4Ï¡o1¡¡. -:. .{_. _Jgnrïriuïht. vial-Illnlclni, ¿[uiáldulzluiílüdjt "hd-JinlgnlalzloiiïjuqVii Supply Type and Options, React Handles the Rest
  15. 15. Generalize With Factories Let React Figure What to Render «(cuw- figqw — ¡(all-ii. .j"= IIii(¿I"Ïllgk‘1s1i_f ¿iauilpraíoillrilfwoigics Inui-r¡'-; ïo)ni¿ -1 ' uuiurm «f ‘¡apra ifililii, .7“’0J; ¡l'j¡pI= |€. AGHPÏIQLÏs1i(= I!| 'lÏ"= I0L, mini-nun» «q-i-¡Lx-Mqglgvigxqc. nuria-n ‘, <. r'= |¡(vl=8"- ÍIIu-i'-: ÏI¡o1¡l[ Ii mi‘ 2 r 7Tliálrimlliiilr"! Ïjiïkqglflqgk. ¡maná- "ziililrm ¡A ¡Im ¡minv- n a u. n a ae. ., ‘»
  16. 16. Python ciict Handles Specifics t’ ¡I"3[II¡I'_. ‘4: 'I(‘—l' IIIIKÏHIJH: ¡le I ¡Íu ‘niolnl-I“ «¡af-P r "g-linl. ‘ v gqlÍ-Iál. "‘ unn“ v 345w. WI’ Ïrult" ' ‘¡ig! JUL, ‘wlaímr r‘ . ¡(qïoiugi
  17. 17. A Simple Wrapper ¿Inici-j ¡T-liagiïlflliiííltílll‘ïfiÍiigal-ÍI- sla? _Ïln'l"‘-, #1:lf: ’, 14311- Hank. ‘Ïtiasnpïvk ¡laïqlillifi- Cial}: Í :1 jtlild‘ l > Ïhulilzlh "Ïíf-lult" « ¿lui-x "¡If iuk" - kïái‘ "olaïouln". ¡(aïlntlykiji qqgiurhfifiáhudinuiiioig, nah/ M. fihlïi, gm-ïánuiíilllúlólc“, omic. ¡‘Iciar-Z "SeIectButton" is a React Component in PyxIeyJS
  18. 18. When Created. .. ""02" Avril-á" "pÏJiáWc inflar“: Jalgal-íïlíuiïlïülll ' l’ l . TW. ’ in: ï-iiu. Í‘ fiallnzl-iilílliiiolnliw‘ l-ir Liu. . t e’ÍL. "’-ur' "t" Will lead to. .. Click Me!
  19. 19. from pyxley. charts. mg import Linechart, Figure z; c l"; .r, , c, g ¿. , L"; 1m‘ 2;, .; - c fig = FigureC/ rrgchartf’, "mychart") fig. graphics. transition_on_update(True) fig. graphics. animate_on_load() fig. layout. set_size(width=80@, height=400) fig. layout. set_margin(left=40, right=40) lc = LineChart(sf, fig, "Date", [”value"], init_params= {”Data": ”Steps”}, timeseries= True)
  20. 20. Select Metric Line Chart 20k 15k 10k Sk 0 MÉLyXQS May 10 May 17 May 24 May 31 lun 07 lun 14
  21. 21. How does this work?
  22. 22. Basics of Setting Up a Web Application Data Storage (Model) UI (View) Fetching data for the Ul (Controller)
  23. 23. Setting Up a Pyxley Web Application Flask manages Data and APIs React UI composed of Filters & Charts Pyxley is just a little bit of glue
  24. 24. Filters & Charts It's all you really need
  25. 25. Fflters Dropdowns, Sliders, etc. Controls state of the chart Charts Visualizations of data Data retreived through APIs
  26. 26. What Can We Do ln Python? Create and mount React components Wrap reusable charts and filters Hide request routing from the user
  27. 27. PyReact & Jinja2 Templates Create and transform a single JSX component L «(fi — vgl- ÏOIJIIHOIIF-loli — "comi-ui " rl-Iviilil a " «luz-mui; - __» ¡vnruj -. Kilihsiu "CIIIIICI" «Trini-luciana ¿L-i-roipicl- L Iioltillulcllll. ¿(uníaltliiidllllifllvr” a "n-[ï " 1.. .»
  28. 28. JavaScript Charting Libraries Wrappers to handle API routing and Options inflar-tj ¡JudjiIglW-¡(Ellfig alza’? __‘lnI‘. ’;-, ¿hdi-Í viv‘ Truliwz. :-, _, '— ‘ï-IÉIuE" lui: - Íitvrü" ól= s14r*1o¡"-i‘n-ir: “" fm: Iii-FH“ mm. ,_-i-i-'-ruin: cïÍi ifliil= lií= l"ï'-lnzl7vlh-‘l'—: ’ ‘Lmüïiglniiialuni: ¿lo mi": ala’ ¿(al ¿rqiigifi r "aim-Ir 711o1n¡‘5.>"v1l: :1¿l: .r‘ y ‘¡Iflfllíilil asu Jjelgly. :. -r= uu; -l? vqginiaaaa. .aivgpz T l s SllulawilJclzljilvlrii, slzlfL-Ts. JIITI, .'i"'¡¿IIlr"—t. .ciiI0I"‘-, fui-l, iüglIIW-“INI, :1‘- it’ ¿han ¿Luisa ¿(ai ¿{vii-E Every Chart is specified by a to_json method and a dictionary of options
  29. 29. JavaScript Charting Libraries Just a few to start with, but adding new libraries is easy Metricsgraphics. js jQuery Datatables DataMaps
  30. 30. What's Next Documentation Tests Integration with additional libraries More widgets
  31. 31. Contribute! github. com/ stitchfix/ pyx| ey/ github. com/ stitchfix/ pyxIeyJS/
  32. 32. Contact Me Twitter: @nmkridler Github: nmkridler
  33. 33. This presentation was made with Pyxley multithreaded. stitchfix. com/ blog

×