Skip to content

Commit

Permalink
update docs by revising organization and content
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Nov 7, 2021
1 parent ba71735 commit 50e6c2f
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 73 deletions.
6 changes: 3 additions & 3 deletions biothings/web/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Generate a customized BioThings API given a supported database.
biothings.web.connections: Elasticsearch, MongoDB and SQL database access.
biothings.web.services & query: Data services built on top of connections.
biothings.web.applications: HTTP web application over data services above.
biothings.web.launcher: Launch web applications in different environments.
biothings.web.applications: HTTP web application over data services below.
biothings.web.services & query: Data services built on top of connections.
biothings.web.connections: Elasticsearch, MongoDB and SQL database access.
"""
7 changes: 7 additions & 0 deletions biothings/web/handlers/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ class StatusHandler(BaseHandler):
# to sentry monitoring. choose the desired one basing
# on overall health check architecture.

# It is technically better to return text or HTML
# instead of JSON as this is NOT an API endpoint.
# Instead, it's for automated status check, in which
# case a simple text response of "OK" suffice, or for
# human consumption when "dev" parameter is provided,
# in which case an HTML page is more readible.

def head(self):
return self._check()

Expand Down
8 changes: 0 additions & 8 deletions biothings/web/services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
# from biothings.web import query

# from an architecture perspective,
# query module belongs to this module as one of the data services,
# built on top of the biothings.web.connections layer,
# however, due to the complexity of the query module,
# it is put in the same level of this module
# to simplify the folder structure.
11 changes: 11 additions & 0 deletions biothings/web/services/query.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""A Programmatic Query API supporting Biothings Query Syntax.
From an architecture perspective, :py:mod:`biothings.web.query` is one of
the data services, built on top of the :py:mod:`biothings.web.connections`
layer, however, due to the complexity of the module, it is escalated one
level in organization to simplify the overall folder structure. The features
are available in `biothings.web.services.query` namespace via import.
"""

from biothings.web.query import *
7 changes: 7 additions & 0 deletions biothings/web/templates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
The "templates" folder stores HTML templates for native biothings
web handlers and is structured as a dummy module to facilitate location
resolution. Typically, ``biothings.web.templates.__path__[0]`` returns
a string representing the location of this folder on the file system.
This folder is intended to be used internally by the SDK developer.
"""
3 changes: 0 additions & 3 deletions docs/apidoc/biothings.tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ biothings.tests
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.tests.hub
--------------------------

Expand Down
2 changes: 0 additions & 2 deletions docs/apidoc/biothings.utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ biothings.utils
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.utils.aws
--------------------------
Expand Down
2 changes: 0 additions & 2 deletions docs/apidoc/biothings.web.analytics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ biothings.web.analytics
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.web.analytics.channels
---------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions docs/apidoc/biothings.web.applications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
biothings.web.applications
===============================

.. automodule:: biothings.web.applications
:members:
:undoc-members:
:show-inheritance:
23 changes: 23 additions & 0 deletions docs/apidoc/biothings.web.connections.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
biothings.web.connections
===============================

.. automodule:: biothings.web.connections
:members:
:undoc-members:
:show-inheritance:

Additionally, you can reuse connecions initialized with the same
parameters by getting it from the connection pools every time.
Here's the connection pool interface signature:

.. autoclass:: biothings.web.connections._ClientPool
:members:
:undoc-members:
:show-inheritance:

The module has already initialized connection pools for each supported
databases. Directly access these pools without creating by yourselves.

.. autodata:: es
.. autodata:: sql
.. autodata:: mongo
2 changes: 0 additions & 2 deletions docs/apidoc/biothings.web.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ biothings.web.handlers
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.web.handlers.base
----------------------------------
Expand Down
7 changes: 7 additions & 0 deletions docs/apidoc/biothings.web.launcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
biothings.web.launcher
===============================

.. automodule:: biothings.web.launcher
:members:
:undoc-members:
:show-inheritance:
18 changes: 0 additions & 18 deletions docs/apidoc/biothings.web.options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ biothings.web.options
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.web.options.descriptions
-----------------------------------------

.. automodule:: biothings.web.options.descriptions
:members:
:undoc-members:
:show-inheritance:

biothings.web.options.manager
------------------------------------
Expand All @@ -32,11 +22,3 @@ biothings.web.options.openapi
:members:
:undoc-members:
:show-inheritance:

biothings.web.options.swagger
------------------------------------

.. automodule:: biothings.web.options.swagger
:members:
:undoc-members:
:show-inheritance:
2 changes: 0 additions & 2 deletions docs/apidoc/biothings.web.query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ biothings.web.query
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.web.query.builder
----------------------------------
Expand Down
42 changes: 13 additions & 29 deletions docs/apidoc/biothings.web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ biothings.web
:undoc-members:
:show-inheritance:

Subpackages
Layers
-----------

.. toctree::
:maxdepth: 4

biothings.web.launcher
biothings.web.applications
biothings.web.services
biothings.web.connections


Components
-----------

.. toctree::
Expand All @@ -16,33 +28,5 @@ Subpackages
biothings.web.handlers
biothings.web.options
biothings.web.query
biothings.web.services
biothings.web.settings
biothings.web.templates

Submodules
----------

biothings.web.applications
``````````````````````````

.. automodule:: biothings.web.applications
:members:
:undoc-members:
:show-inheritance:

biothings.web.connections
`````````````````````````

.. automodule:: biothings.web.connections
:members:
:undoc-members:
:show-inheritance:

biothings.web.launcher
``````````````````````

.. automodule:: biothings.web.launcher
:members:
:undoc-members:
:show-inheritance:
9 changes: 7 additions & 2 deletions docs/apidoc/biothings.web.services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ biothings.web.services
:undoc-members:
:show-inheritance:

Submodules
``````````
biothings.web.services.query
-----------------------------

.. automodule:: biothings.web.services.query
:members:
:undoc-members:
:show-inheritance:

biothings.web.services.health
-----------------------------
Expand Down
2 changes: 0 additions & 2 deletions docs/apidoc/biothings.web.settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ biothings.web.settings
:undoc-members:
:show-inheritance:

Submodules
``````````

biothings.web.settings.configs
-------------------------------------
Expand Down

0 comments on commit 50e6c2f

Please sign in to comment.