{"id":30878595,"url":"https://github.com/sciris/scirisweb","last_synced_at":"2025-09-08T05:11:55.809Z","repository":{"id":33431646,"uuid":"154411622","full_name":"sciris/scirisweb","owner":"sciris","description":"ScirisWeb Python tools","archived":false,"fork":false,"pushed_at":"2024-08-21T03:53:38.000Z","size":1197,"stargazers_count":3,"open_issues_count":12,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-28T19:26:32.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sciris.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-23T23:53:29.000Z","updated_at":"2024-08-21T03:53:39.000Z","dependencies_parsed_at":"2023-01-15T00:53:27.964Z","dependency_job_id":"cd003ed1-234f-4652-a904-11d49c62ff2e","html_url":"https://github.com/sciris/scirisweb","commit_stats":{"total_commits":388,"total_committers":11,"mean_commits":35.27272727272727,"dds":"0.35051546391752575","last_synced_commit":"b170daa481096f6247563bba86c132d011cf6135"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sciris/scirisweb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciris%2Fscirisweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciris%2Fscirisweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciris%2Fscirisweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciris%2Fscirisweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sciris","download_url":"https://codeload.github.com/sciris/scirisweb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciris%2Fscirisweb/sbom","scorecard":{"id":804917,"data":{"date":"2025-08-11","repo":{"name":"github.com/sciris/scirisweb","commit":"d2ea7d526ad34e93bf512d3340f2f705adf78cfe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":3,"reason":"Found 1/3 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sciris/scirisweb/tests.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sciris/scirisweb/tests.yaml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/tests.yaml:23","Warn: pipCommand not pinned by hash: .github/workflows/tests.yaml:26","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"49 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-858 / GHSA-q4xr-rc97-m4xx","Warn: Project is vulnerable to: PYSEC-2018-66 / GHSA-562c-5r94-xh97","Warn: Project is vulnerable to: PYSEC-2019-179 / GHSA-5wv5-4vpf-pj6m","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-43qf-4rqw-9q2g","Warn: Project is vulnerable to: GHSA-7rxf-gvfg-47g4","Warn: Project is vulnerable to: GHSA-84pr-m4jr-85g5","Warn: Project is vulnerable to: GHSA-8vgw-p6qm-5gr7","Warn: Project is vulnerable to: PYSEC-2024-71 / GHSA-hxwh-jpp2-84pm","Warn: Project is vulnerable to: PYSEC-2020-43 / GHSA-xc3p-ff3m-f46v","Warn: Project is vulnerable to: PYSEC-2019-124 / GHSA-38fc-9xqv-7f7q","Warn: Project is vulnerable to: PYSEC-2019-123 / GHSA-887w-45rq-vxgf","Warn: Project is vulnerable to: PYSEC-2012-9 / GHSA-hfg2-wf6j-x53p","Warn: Project is vulnerable to: GHSA-32gv-6cf3-wcmq","Warn: Project is vulnerable to: PYSEC-2020-214 / GHSA-3gqj-cmxr-p4x2","Warn: Project is vulnerable to: PYSEC-2019-129 / GHSA-65rm-h285-5cc5","Warn: Project is vulnerable to: PYSEC-2019-128 / GHSA-6cc5-2vg4-cc7m","Warn: Project is vulnerable to: GHSA-8r99-h8j2-rw64","Warn: Project is vulnerable to: PYSEC-2022-195 / GHSA-c2jg-hw38-jrqq","Warn: Project is vulnerable to: GHSA-c8m8-j448-xjx7","Warn: Project is vulnerable to: PYSEC-2024-75 / GHSA-cf56-g6w6-pqq2","Warn: Project is vulnerable to: PYSEC-2020-259 / GHSA-h96w-mmrf-2h6v","Warn: Project is vulnerable to: PYSEC-2020-260 / GHSA-p5xh-vx83-mxcj","Warn: Project is vulnerable to: PYSEC-2023-224 / GHSA-xc8x-vp79-p3wm","Warn: Project is vulnerable to: PYSEC-2019-212","Warn: Project is vulnerable to: GHSA-2g68-c3qc-8985","Warn: Project is vulnerable to: PYSEC-2020-157 / GHSA-3p3h-qghp-hvh2","Warn: Project is vulnerable to: GHSA-f9vj-2wh5-fj8j","Warn: Project is vulnerable to: PYSEC-2019-140 / GHSA-gq9m-qvpx-68hc","Warn: Project is vulnerable to: PYSEC-2017-43 / GHSA-h2fp-xgx6-xh6f","Warn: Project is vulnerable to: PYSEC-2023-221 / GHSA-hrfv-mqp8-q5rw","Warn: Project is vulnerable to: GHSA-j544-7q9p-6xp8","Warn: Project is vulnerable to: PYSEC-2023-57 / GHSA-px8h-6qxv-m22q","Warn: Project is vulnerable to: GHSA-q34m-jh98-gwm2","Warn: Project is vulnerable to: PYSEC-2023-58 / GHSA-xg9f-g7g7-2323","Warn: Project is vulnerable to: PYSEC-2022-203","Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: PYSEC-2024-225 / GHSA-6vqw-3v5j-54x4","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: GHSA-h4gh-qq45-vh27","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: PYSEC-2023-117"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T11:30:33.675Z","repository_id":33431646,"created_at":"2025-08-23T11:30:33.675Z","updated_at":"2025-08-23T11:30:33.675Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274135710,"owners_count":25228209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-08T05:11:48.292Z","updated_at":"2025-09-08T05:11:55.794Z","avatar_url":"https://github.com/sciris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Welcome to ScirisWeb\n====================\n\n**NOTE:** While Sciris is still in active development, ScirisWeb is no longer actively maintained. It is still functional, but you may wish to use a more modern Python webapp framework instead, such as `Shiny for Python \u003chttps://shiny.posit.co/py\u003e`_, `Plotly Dash \u003chttps://dash.plotly.com\u003e`_, or `Streamlit \u003chttps://streamlit.io/\u003e`_.\n\nWhat is Sciris?\n---------------\n\nGlad you asked! **Sciris** (http://sciris.org) is a library of tools that can make it easier and more pleasant to write scientific Python code. Built on top of `NumPy \u003chttps://numpy.org/\u003e`__ and `Matplotlib \u003chttps://matplotlib.org/\u003e`__, Sciris provides functions covering a wide range of common array and plotting operations. This means you can get more done with less code, and spend less time looking things up on StackOverflow.\n\n**ScirisWeb** is an extension of Sciris that allows you to build Python webapps without reinventing the wheel – kind of like `Shiny \u003chttps://shiny.rstudio.com/\u003e`__ for Python. In contrast to `Plotly Dash \u003chttps://plotly.com/dash/\u003e`__ and `Streamlit \u003chttps://www.streamlit.io/\u003e`__, which have limited options for customization, ScirisWeb is completely modular, so you have control over which tools to use for which aspects of the project. Out of the box, ScirisWeb provides a \"just works\" solution using `Vuejs \u003chttps://vuejs.org/\u003e`__ for the frontend, `Flask \u003chttps://flask.palletsprojects.com/\u003e`__ as the web framework, `Redis \u003chttps://redis.io/\u003e`__ for the (optional) database, and Matplotlib/`mpld3 \u003chttps://github.com/mpld3/mpld3\u003e`__ for plotting. But if you want a React frontend linked to an SQL database with Plotly figures, ScirisWeb can serve as the glue holding all of that together.\n\nScirisWeb is available on `PyPi \u003chttps://pypi.org/project/scirisweb/\u003e`__ (``pip install sciris``) and `GitHub \u003chttps://github.com/sciris/scirisweb\u003e`__. Full documentation is available at http://docs.sciris.org. If you have questions, feature suggestions, or would like some help getting started, please reach out to us at info@sciris.org.\n\n\nHighlights\n~~~~~~~~~~\nSome highlights of ScirisWeb (``import scirisweb as sw``):\n\n-  **ScirisApp** – An extension of a Flask App that can be created as simply as ``app = sw.ScirisApp(config)`` and run with ``app.run()``.\n-  **RPCs** – Simple \"remote procedure calls\" that define how the frontend (web interface) interacts with the backend (Python server).\n-  **Datastore** – For more fully-featured webapps, user and data management are available based on Redis (with additional options for SQL or file-based databases).\n\n\nWhere did Sciris come from?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\nDevelopment of Sciris began in 2014 to support development of the `Optima \u003chttp://optimamodel.com\u003e`__ suite of models. We kept encountering the same issues and inconveniences over and over while building scientific webapps, and began collecting the tools we used to overcome these issues into a shared library. This library evolved into Sciris. (Note: while \"Sciris\" doesn't mean anything, \"iris\" means \"rainbow\" in Greek, and the name was loosely inspired by the wide spectrum of scientific computing features included in Sciris.)\n\n\nWhere has ScirisWeb been used?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nScirisWeb is currently used by a number of scientific computing libraries, including `Atomica \u003chttp://atomica.tools\u003e`__ and `Covasim \u003chttp://covasim.org\u003e`__. ScirisWeb also provides the backend for webapps such as the `Cascade Analysis Tool \u003chttp://cascade.tools\u003e`__, `HIPtool \u003chttp://hiptool.org\u003e`__, and `Covasim \u003chttp://app.covasim.org\u003e`__.\n\n\nInstallation and run instructions\n---------------------------------\n\n\n5-second quick start guide\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. Install ScirisWeb: ``pip install scirisweb``\n\n2. Use ScirisWeb: ``import scirisweb as sw``\n\n\n20-second quick start guide\n\n1. Download ScirisWeb (e.g. ``git clone http://github.com/sciris/scirisweb``)\n\n2. Install ScirisWeb (which will install Sciris as well): ``cd scirisweb; pip install -e .``\n\n3. Change to the Hello World folder: ``cd examples/helloworld``\n\n4. Run the app: ``python app.py``\n\n5. Go to ``localhost:8080`` in your browser\n\n6. Have fun!\n\n\nMedium-quick start guide\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nNote: if you're a developer, you'll likely already have some/all of these packages installed.\n\n1. Install `NodeJS \u003chttps://nodejs.org/en/download/\u003e`__ (JavaScript manager)\n\n2. Install `Redis \u003chttps://redis.io/topics/quickstart\u003e`__ (database)\n\n3. Install `Anaconda Python \u003chttps://www.anaconda.com/download/\u003e`__ (scientific Python environment)\n\n4. Clone and install Sciris: ``git clone http://github.com/sciris/sciris``\n\n5. Clone ScirisWeb: ``git clone http://github.com/sciris/scirisweb``\n\n6. Once you've done all that, to install, simply run ``pip install -e .`` in the root folders of ``sciris`` and ``scirisweb``. This should install Sciris and ScirisWeb as importable Python modules.\n\nTo test, open up a new Python window and type ``import sciris`` (and/or ``import scirisweb``)\n\nIf you have problems, please email info@sciris.org, or consult the rest of this guide for more information.\n\n\nInstalling on Linux\n~~~~~~~~~~~~~~~~~~~\n\nThe easiest way to install Sciris is by using pip: ``pip install scirisweb`` (which will also automatically install ``sciris``). If you want to install from source, follow these steps:\n\n1. Install Git: ``sudo apt install git``\n\n2. Install NodeJS: ``sudo apt install nodejs``\n\n3. Install Redis: https://redis.io/topics/quickstart\n\n4. (Optional) Install `Anaconda Python \u003chttps://www.anaconda.com/download/\u003e`__ (as of version 0.15, Sciris is only compatible with Python 3), and make sure it's the default Python, e.g.\n\n::\n\n   your_computer:~\u003e python\n   Python 3.7.4 (default, Aug 13 2019, 20:35:49)\n   [GCC 7.3.0] :: Anaconda, Inc. on linux\n   Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n5. Clone the Sciris repositories:\n   ``git clone http://github.com/sciris/sciris.git`` and\n   ``git clone http://github.com/sciris/scirisweb.git``.\n\n6. Run ``pip install -e .`` in each of the two Sciris folders.\n\n7. To test, open up a new Python window and type ``import sciris`` and\n   ``import scirisweb``. You should see something like:\n\n::\n\n   \u003e\u003e\u003e import sciris\n   \u003e\u003e\u003e import scirisweb\n\n\nInstalling on Windows\n~~~~~~~~~~~~~~~~~~~~~\n\n\nPackage and library dependencies\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFirst, make sure that you have ``npm`` (included in Node.js installation) and ``git`` installed on your machine.\n\nInstall `Anaconda Python \u003chttps://www.anaconda.com/download/\u003e`__. In your Python setup, you also need to have the following packages (instructions in parentheses show how to install with Anaconda Python environment already installed). **Note**, these should all be installed automatically when you type ``pip install -e .`` in the Sciris and ScirisWeb folders.\n\n\nDatabase dependencies\n^^^^^^^^^^^^^^^^^^^^^\n\nIf you use Redis as your DataStore mode, you will need to have Redis installed on your computer (as a service). Redis does not directly support Windows, but there is a `MicrosoftArchive page on GitHub \u003chttps://github.com/MicrosoftArchive/redis\u003e`__ where you may go for installation directions on your Windows machine. (For example, it can be installed at `this site \u003chttps://github.com/MicrosoftArchive/redis/releases\u003e`__ , downloading a .msi file). It ends up being installed as a service which you can navigate to by going the Windows Task Manager and going to the Services tab. Make sure the ``Redis`` service is in the Running state.\n\nMost likely, the directory for your Redis executables will be installed at ``C:\\Program Files\\Redis``. In that directory, you can double-click the icon for ``redis-cli.exe`` to start the redis database command line interface at the default Redis database (#0). You can do ``keys *`` to look at all of the store key / value pairs in the database, and ``exit`` exits the interface.\n\nYou will probably want to use a non-default (i.e. ``N`` is not 0) database. To investigate what keys are in, for example, database #2, while you are within ``redis-cli``, you can type ``select 2`` to switch to that database.\n\n\nInstalling on Mac\n~~~~~~~~~~~~~~~~~\n\n1. Install Git. This can be done by installing Xcode commandline tools.\n\n::\n\n        xcode-select --install\n\n2. Install NodeJS. Visit https://nodejs.org/en/download/ and download the Mac version and install.\n\n3. Install Redis: https://redis.io/topics/quickstart or run (Assumming brew is installed)\n\n::\n\n        brew install redis\n\n4. Install `Anaconda Python 3 \u003chttps://www.anaconda.com/download/\u003e`__, and make sure it's the default Python, e.g.\n\n::\n\n   your_computer:~\u003e python\n   Python 3.7.4 (default, Aug 13 2019, 20:35:49)\n   [GCC 7.3.0] :: Anaconda, Inc. on linux\n   Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n5.  Create a directory that will hold Sciris. For reference purposes we will create and refer to that directory as ``pyenv``.\n\n6.  Clone the Sciris repository into ``pyenv``:\n    ``git clone http://github.com/sciris/sciris.git``\n\n7.  Create a Python virtual environment (venv) inside the directory of your choice. This will be the parent of the Sciris folder.\n\n::\n\n     `virtualenv venv`\n\nMore information about `python virtual environments \u003chttp://docs.python-guide.org/en/latest/dev/virtualenvs/\u003e`__ can be found `here \u003chttp://docs.python-guide.org/en/latest/dev/virtualenvs/\u003e`__. The project structure should be as follows;\n\n::\n\n          -pyenv\n              -venv\n              -sciris\n\n8.  Get into the virtual environment. While inside the ``pyenv`` folder, to activate the virtual environment, type:\n\n::\n\n      ./venv/bin/activate\n\n9.  Change to the Sciris root folder and type:\n\n::\n\n   python setup.py develop\n\n10. Repeat in the ScirisWeb root folder:\n\n::\n\n   python setup.py develop\n\n11. To test if the if everything is working accordingly, open Python window within the virtual environment and type ``import sciris`` and ``import scirisweb``. If no errors occur, then the import worked.\n\n\nMulthreaded deployment\n----------------------\n\nThe problem with the simple deployment method described above is that requests are single-threaded. If this is an issue, recommended deployment is using ``nginx`` to serve the static files, and ``gunicorn`` to run the Flask app. Note that it is common for an application to call several RPCs with each page load. This means that the multithreaded deployment can result in improved site performance even for a single user.\n\n\nRequirements\n~~~~~~~~~~~~\n\nYou must have nginx (``sudo apt install nginx``) and gunicorn\n(``pip install gunicorn``) installed.\n\n\nSet up nginx\n~~~~~~~~~~~~\n\n1. Copy ``examples/gunicorn/example_nginx_config`` to e.g.\n   ``/etc/nginx/sites-enabled/my_app`` (can change filename if desired)\n2. Edit the copied file to specify\n\n   -  The hostname/URL for the site e.g. ``my_app.com``\n   -  The full path to the directory containing ``index.html`` on the\n      system running ``nginx``\n   -  Change the port in ``proxy_pass`` line if desired - it must match\n      the port in ``launch_gunicorn``\n\n3. Reload or restart ``nginx`` e.g. ``sudo service nginx reload``\n\nFor example, this will start it running at ``localhost:8188``:\n\n.. code:: bash\n\n   server {\n       listen 8188;\n       server_name localhost;\n       location / {\n           root /home/my_username/my_sciris_app;\n       }\n       location /api {\n           proxy_pass http://127.0.0.1:8097/;\n       }\n   }\n\n\nRun gunicorn\n~~~~~~~~~~~~\n\n1. Copy ``examples/gunicorn/example_launch_gunicorn`` to the folder with your app (e.g. ``launch_my_app_gunicorn``), and set the number of workers as desired - usual recommendation is twice the number of CPUs but for applications that are CPU bound (e.g., an RPC call runs a model) then it may be better to reduce it to just the number of CPUs.\n2. The example script references the Flask app using ``name_of_your_app:flask_app``. The ``name_of_your_app`` should be importable in Python (either via running Python in the current directory, or installing as a package via ``pip``) and ``flask_app`` is the name of a variable containing the Flask application. So for  example, you might have a file ``foo.py`` containing\n\n.. code:: python\n\n   app = sw.ScirisApp(__name__, name=\"My App\")\n   the_app = app.flask_app\n\nin which case the ``launch_my_app_gunicorn`` script should contain ``foo:the_app`` instead of ``name_of_your_app:flask_app``.\n\n3. Run ``launch_my_app_gunicorn``. This will need to be kept running to support the site (so run via ``nohup`` or ``screen`` etc.).\n\nFor example:\n\n.. code:: bash\n\n   cd my_app\n   screen -S my_app_session\n   ./launch_my_app_gunicorn\n   \u003cyou can now close the terminal\u003e\n\n   ...\n\n   \u003ccoming back later, you can restart it with\u003e\n   screen -R my_app_session\n\nNote that for local development, you can add the ``--reload`` flag to the ``gunicorn`` command to automatically reload the site. This can be helpful if using the ``nginx+gunicorn`` setup for local development.\n\n\nExamples\n--------\n\nIn the ``examples`` and ``vue_proto_webapps`` directories are contained a number of working examples of web applications combining Vue, Flask, and Twisted. These are being used as stepping stones for developing the main framework based in ``user_interface``, ``session_manager``, ``model_code``, and ``bin``.\n\n\nHello World\n~~~~~~~~~~~\n\nA very simple test case of Sciris. In the ``examples/helloworld`` folder, type ``python app.py``. If you go to ``localhost:8080`` in your browser, it should be running a simple Python webapp.\n\nSee the directions `here \u003chttps://github.com/sciris/scirisweb/tree/develop/examples/helloworld\u003e`__ on how to install and run this example.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciris%2Fscirisweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciris%2Fscirisweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciris%2Fscirisweb/lists"}