React to Python: Creating React Front-End Web Applications with Python
- Length: 533 pages
- Edition: 1
- Language: English
- Publisher: JennaSys
- Publication Date: 2021-05-04
- ISBN-10: B09463VMYS
- ISBN-13: 9781736574706
- Sales Rank: #907243 (See Top 100 Books)
Learn to create responsive front-end web applications in Python using the React and Material-UI JavaScript libraries without having to program in JavaScript! How is this possible? By using the Transcrypt transpiler that turns your Python code into JavaScript.
Let’s face it, JavaScript is the way of the web, and Python doesn’t run in a web browser. BUT, just like the popular TypeScript language that gets compiled into JavaScript to run in a web browser, Transcrypt does the same thing for Python. Because of the way Transcrypt maps Python data types and language constructs to JavaScript, your Python code is able to directly utilize the full ecosystem of JavaScript libraries that exist, taking advantage of existing web application technologies rather than trying to replace them.
Using a Python-centric viewpoint, this book outlines the developer tools and software libraries needed to develop front-end web applications with Python, specifically focusing on the popular React library and open-source Material-UI library that includes a collection of React components based on Google’s Material Design user interface specification. In addition to chapters covering how to implement specific application features, in a learn-by-doing fashion, the last section of the book walks you through building a fully functional example application from start to finish, giving you an idea of how everything fits together.
While this book isn’t necessarily meant for beginning programmers, if you are already familiar with Python and want to create front-end web applications but don’t want to have to delve into the complexities of a full JavaScript ecosystem, don’t want to have to keep switching back and forth between languages for the same full-stack application, or if you just don’t care to program in JavaScript in general, the approach taken in this book gives you another option using Python.
React to Python React to Python 0.1 About the Author 0.2 Foreword 0.3 Preface 0.3.1 Why write this book? 0.3.2 Why use Python for web apps? 0.4 About This Book 0.4.1 Who this book is for 0.4.2 What to expect 0.4.3 Basic requirements 0.4.4 Conventions used in this book 0.4.5 Source Code 1 Getting Started 1.1 Introduction 1.1.1 Full-Stack Python 1.1.2 Transcrypt 1.1.3 React 1.1.4 Node Package Manager 1.1.5 Parcel 1.1.6 Summary 1.2 First Application 1.2.1 Transcrypt Installation 1.2.2 Hello World 1.2.3 Development Cycle 1.2.4 Summary 1.3 JavaScript Functions 1.3.1 Random Numbers 1.3.2 Summary 1.4 Sourcemaps 1.4.1 Function Mapping 1.4.2 Debugging Console 1.4.3 Summary 1.5 External JavaScript Libraries 1.5.1 Working with jQuery 1.5.2 Summary 1.6 Intro to React 1.6.1 Hello React 1.6.2 React State 1.6.3 Summary 1.7 React Concepts 1.7.1 Document Object Model 1.7.2 Components and Elements 1.7.3 Unidirectional Data Flow 1.7.4 Hooks vs. Classes 1.7.5 Summary 1.8 Cleaner Code 1.8.1 Break It Up 1.8.2 Summary 1.9 Managing JavaScript Packages 1.9.1 npm 1.9.2 Using Local JavaScript Libraries 1.9.3 Summary 1.10 Package Bundler 1.10.1 Parcel 1.10.2 Simplified JavaScript Imports 1.10.3 Build Scripts 1.10.4 Summary 1.11 Section Summary 2 Building Blocks 2.1 Text Input 2.1.1 Handling Input 2.1.2 Generated Elements 2.1.3 Summary 2.2 Lists 2.2.1 HTML Lists 2.2.2 List Component 2.2.3 Summary 2.3 Forms 2.3.1 Form Action 2.3.2 Summary 2.4 React Components 2.4.1 Adding Functionality 2.4.2 Adding More Functionality 2.4.3 Decomposition 2.4.4 Summary 2.5 JavaScript Examples 2.5.1 To-Do List 2.5.2 Class Components to Functions 2.5.3 Anonymous Functions 2.5.4 Mapping Functions 2.5.5 Ternary Statements 2.5.6 Dictionaries 2.5.7 Spread Operator 2.5.8 JSX 2.5.9 JavaScript Imports 2.5.10 Using Images 2.5.11 Putting it Together 2.5.12 Summary 2.6 CSS 2.6.1 Stylesheet 2.6.2 Inline Styles 2.6.3 Styled Components 2.6.4 CSS Framework 2.6.5 Summary 2.7 Material-UI 2.7.1 Installing Material-UI 2.7.2 Basic Usage 2.7.3 Optimized Imports 2.7.4 Theming 2.7.5 Styled Components Revisited 2.7.6 Summary 2.8 Parcel Web Proxy 2.8.1 Flask Web Server 2.8.2 Proxy Service 2.8.3 Summary 2.9 Asynchronous Requests 2.9.1 Synchronicity 2.9.2 Async/Await 2.9.3 Summary 2.10 React Context Hook 2.10.1 Nested Components 2.10.2 Context Variables 2.10.3 Summary 2.11 Transcrypt Miscellany 2.11.1 Standard Library 2.11.2 Built-in Functions 2.11.3 Keyword Args 2.11.4 Immutability 2.11.5 Truthiness 2.11.6 Types 2.11.7 Summary 2.12 Application Versioning 2.12.1 NPM Version 2.12.2 Application Version 2.12.3 Summary 2.13 Google Analytics 2.13.1 ReactGA 2.13.2 Request Timing 2.13.3 Summary 2.14 Developer Tools 2.14.1 Bundle Visualizer 2.14.2 React Chrome Extension 2.14.3 GA Debug Chrome Extension 2.14.4 Debug CSS Chrome Extension 2.14.5 Summary 2.15 Section Summary 3 Putting it all Together 3.1 Project Outline 3.1.1 Application Structure 3.1.2 Folder Structure 3.2 Environment Setup 3.2.1 Initial Setup 3.2.2 Parcel Setup 3.2.3 Application Entry Point 3.3 Landing Page 3.3.1 Material-UI Theme 3.3.2 Starting Point 3.3.3 Versioning 3.4 Modal View 3.4.1 Application Data 3.4.2 Modality 3.4.3 About Component 3.4.4 About Link 3.5 REST Service 3.5.1 The Database 3.5.2 The REST Server 3.6 Books 3.6.1 Proxy Server 3.6.2 Updated Fetch 3.6.3 Book List 3.6.4 View Control 3.7 Menus 3.7.1 Landing Page Revisited 3.7.2 View Routing 3.8 User Login 3.8.1 Snackbar 3.8.2 Session User 3.8.3 Login Modal 3.8.4 Login Functionality 3.9 Lookups 3.9.1 Container View 3.9.2 Table List 3.9.3 Menu Control 3.10 User Context 3.10.1 Context Definition 3.10.2 Using the Context 3.11 Editing Lookups 3.11.1 Saving Data 3.11.2 Editing Items 3.11.3 Menu Control 3.12 Filtering Data 3.12.1 Filter Form 3.12.2 Lookup Data 3.13 Editing Books 3.13.1 View Container 3.13.2 Select Lists 3.13.3 Data Entry 3.13.4 Edit Control 3.14 SPA Redirect 3.14.1 Redirect Functionality 3.14.2 Page Routing 3.14.3 Redirecting Pages 3.15 Deploying the Application 3.15.1 Web Server 3.15.2 WSGI Container 3.15.3 Gunicorn 3.15.4 NGINX 3.15.5 Flask for Static Content 3.15.6 Security 3.16 Conclusion
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.