Package: pyreact2
PyReactThe goal of the repo is to introduce a pythonic web application tool similar to ReactJS. As you look through the code or build with PyReact you will notice similarities between the two; this is the point. You should be able to move between the two (PyReact & ReactJS) with ease and without the need to learn an entire new flow.Release State: Alpha (Do not use for production)RequirementsPython 3.6+PyPM (pip install pypm2) - Refer to my repo PyPM for more informationRecommendationsPlease look at thePyPMrepo. This tool is required to run PyReact and is similar to npm.If you're unfamiliar with ReactJS, head over to their site and get an overview of what it is.While PyReact is still in development, it is recommended to use this within a python virtual environment.Installationpipinstallpypm2
gitclonehttps://github.com/ableinc/pyreactcdpyreact
pypminstall
pypmsetupHow to runpypmstartCreate your own PyReact appNote: It is recommended that you install PyReact in a python virtual environment.Make sure you follow the steps above to install PyReactOnce installed, runpyreact initcdinto your new PyReact app directoryRunpypm installAll done!File StructureNotice,/appis unrelated to the PyReact code. It is necessary to develop a PyReact web application, but is not tracked for release under the PyReact repo. Its here for testing purposes.You will notice the start command in the package.json points to the index.py file in/app. This is normal react convention. If you'd like to build your own PyReact application, please follow the installation instructions above and alter the contents of/app. Do NOT edit within the/publicfolder, as you could break your project.Environment VariablesIf you'd like your PyReact project to recognize new environment variables please prepend PYREACT_ to your variable names. Note, you will not need to import or install a library to import enviornment variables, PyReact does it under the hood. Just import variables with os.environ.ExamplesJust like this repo, examples and documentation are on-going. For the meantime, refer to the /app folder to see how everything works. Feel free to explore the pyreact code itself, if you notice something, make a PR!Important InformationWhen you are creating your class views, containing your render function, make sure thatself.root(self)is the first line in render. This flow is very important. In future updates this will not be needed.PyReact is both a client-side and server-side application. You have the full flexibility to do one or the other or both. Go to the/examplesdirectory for examples.ChangelogAppend user defined react class to index file to render -  DoneAdd stylesheet rendering with html - DoneAdd or create a python syntax friendly way of generating views with HTML attributes (i.e. not using multiline strings to create view)Find and replace %PUBLIC_URL% in index.html - DoneWhen user adds list of HTML elements to html content in render, it will be parsed appropriately - DoneFix recurssion  error  generated when setState() is used in either render() orinit() - DoneBe able to render multiple stylesheets for multiple pages - DoneAdd event listeners - DoneStop the browser from reopening the PyReact project homepage after every server refresh. - Disabled (Bug)Add Node dot notation dictionary/Object attributeWhen printing in view, display in browser consoleCreate CLI tool to create PyReact app - Done