diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 000000000..5e04b77f8 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,42 @@ +# Maintainer Notes + +## Building Distribution + + pip install -U build + python3 -m build + +### Incrementing the lib version + +- Edit `fhirclient/client.py` and change the `__version__` field. +- Edit `docs/Doxyfile` and change the `PROJECT_NUMBER` field. + +## Docs Generation + +Docs are generated with [Doxygen](https://www.doxygen.nl/) +and [doxypypy](https://github.com/Feneric/doxypypy). +You can install doxypypy via pip: `pip install doxypypy`. +Then you can just run Doxygen. Configuration is stored in `docs/Doxyfile`. + +Running Doxygen will put the generated HTML documentation into `docs/html`. +Those files make up the content of the `gh-pages` branch. +I usually perform a second checkout of the _gh-pages_ branch and copy the HTML files over, with: + + doxygen docs/Doxyfile + rsync -a docs/html/ ../client-py-web/ + +## PyPi Publishing (notes for SMART team) + +Using flit (*Note*: Alternatively, you can use [twine](https://twine.readthedocs.io/)): + +### Make sure that you have the PyPi account credentials in your account + + copy server.smarthealthit.org:/home/fhir/.pypirc to ~/.pypirc + +### Test the build + + python3 -m build + +### Upload the packages to PyPi + + pip install -U flit + flit publish diff --git a/README.md b/README.md index 82d10de7f..845e17d48 100644 --- a/README.md +++ b/README.md @@ -152,69 +152,29 @@ patient.name[0].given ### Flask App -Take a look at [`flask_app.py`][flask_app] to see how you can use the client in a simple (Flask) app. -This app starts a web server, listening on [_localhost:8000_](http://localhost:8000), and prompts you to log in to our sandbox server and select a patient. -It then retrieves the selected patient's demographics and med prescriptions and lists them on a simple HTML page. +Take a look at +[flask_app.py](https://github.com/smart-on-fhir/client-py/blob/main/demos/flask/flask_app.py) +to see how you can use the client in a simple (Flask) app. +This app starts a web server, +listening on [_localhost:8000_](http://localhost:8000), +and prompts you to log in to our sandbox server and select a patient. +It then retrieves the selected patient's demographics and med prescriptions +and lists them on a simple HTML page. The Flask demo app has separate requirements. -Clone the _client-py_ repository, then create a virtual environment (not compulsory but recommended) and install the needed packages as shown: +Clone the _client-py_ repository, +then create a virtual environment (not compulsory but recommended) +and install the needed packages as shown: git clone https://github.com/smart-on-fhir/client-py.git - cd client-py - virtualenv -p python3 env + cd client-py/demos/flask + python3 -m venv env . env/bin/activate - pip install -r requirements_flask_app.txt - python flask_app.py - - -## Building Distribution - - pip install -U build - python3 -m build - - -### Incrementing the lib version - -- Edit `fhirclient/client.py` and change the `__version__` field. -- Edit `Doxyfile` and change the `PROJECT_NUMBER` field. - - -## Docs Generation - -Docs are generated with [Doxygen][] and [doxypypy][]. -You can install doxypypy via pip: `pip install doxypypy`. -Then you can just run Doxygen. Configuration is stored in the `Doxyfile`. - -Running Doxygen will put the generated documentation into `docs`, the HTML files into `docs/html`. -Those files make up the content of the `gh-pages` branch. -I usually perform a second checkout of the _gh-pages_ branch and copy the html files over, with: - - doxygen - rsync -a docs/html/ ../client-py-web/ - - -## PyPi Publishing (notes for SMART team) - -Using flit (*Note*: Alternatively, you can use [twine](https://twine.readthedocs.io/)): - -### Make sure that you have the PyPi account credentials in your account - - copy server.smarthealthit.org:/home/fhir/.pypirc to ~/.pypirc - -### Test the build - - python3 -m build - -### Upload the packages to PyPi - - pip install -U flit - flit publish + pip install -r requirements.txt + ./flask_app.py [fhir]: http://www.hl7.org/implement/standards/fhir/ [smart]: http://docs.smarthealthit.org [fhir-parser]: https://github.com/smart-on-fhir/fhir-parser [docs]: https://smart-on-fhir.github.io/client-py -[flask_app]: https://github.com/smart-on-fhir/client-py/blob/main/flask_app.py -[doxygen]: http://www.stack.nl/~dimitri/doxygen -[doxypypy]: https://github.com/Feneric/doxypypy diff --git a/flask_app.py b/demos/flask/flask_app.py old mode 100644 new mode 100755 similarity index 99% rename from flask_app.py rename to demos/flask/flask_app.py index d8bf54e81..4b36a030a --- a/flask_app.py +++ b/demos/flask/flask_app.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 import logging from fhirclient import client diff --git a/flaskbeaker.py b/demos/flask/flaskbeaker.py similarity index 95% rename from flaskbeaker.py rename to demos/flask/flaskbeaker.py index daf3d2cb6..f14cc0e30 100644 --- a/flaskbeaker.py +++ b/demos/flask/flaskbeaker.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - from flask.sessions import SessionInterface from beaker.middleware import SessionMiddleware diff --git a/demos/flask/requirements.txt b/demos/flask/requirements.txt new file mode 100644 index 000000000..e69d659de --- /dev/null +++ b/demos/flask/requirements.txt @@ -0,0 +1,3 @@ +beaker>=1.13.0 +fhirclient>=4 +flask>=2.3.2 diff --git a/Doxyfile b/docs/Doxyfile similarity index 99% rename from Doxyfile rename to docs/Doxyfile index 81fb29dc2..c7a291b58 100644 --- a/Doxyfile +++ b/docs/Doxyfile @@ -908,7 +908,7 @@ INPUT_FILTER = # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = *.py=Doxyfilter +FILTER_PATTERNS = *.py=./docs/Doxyfilter # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for @@ -1140,7 +1140,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = Doxystyle.css +HTML_EXTRA_STYLESHEET = ./docs/Doxystyle.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note diff --git a/Doxyfilter b/docs/Doxyfilter similarity index 100% rename from Doxyfilter rename to docs/Doxyfilter diff --git a/Doxystyle.css b/docs/Doxystyle.css similarity index 100% rename from Doxystyle.css rename to docs/Doxystyle.css diff --git a/requirements_flask_app.txt b/requirements_flask_app.txt deleted file mode 100644 index 91c6a41fc..000000000 --- a/requirements_flask_app.txt +++ /dev/null @@ -1,8 +0,0 @@ -Beaker>=1.13.0 -Flask>=2.3.2 -Jinja2>=3.1.2 -MarkupSafe>=2.1.1 -Werkzeug>=2.3.3 -isodate>=0.6.1 -itsdangerous>=2.1.2 -requests>=2.22.0