Skip to content

Commit

Permalink
📝 minor changes in RTD documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bunop committed Jun 20, 2024
1 parent 56d175b commit 159033b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions flask-data/smarter/docs/source/accessing/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ urls. Eventually, we will transform data into a ``pandas`` DataFrame.
Deal with data and pagination in python
---------------------------------------

We can define some utility functions to deal with data and pagination:
We can define some utility functions to deal with data and pagination. Those
functions are general and can be used to access any endpoint of the SMARTER API:

.. code-block:: python
Expand Down Expand Up @@ -83,7 +84,7 @@ Read data with Python
---------------------

Now we can read data from the API using the functions we defined before. We can
get the data from the API and transform it into a pandas DataFrame. We can define
get the data from the API and transform it into a ``pandas.DataFrame`` by creating
a custom function in order to call the API with different parameters:

.. code-block:: python
Expand All @@ -97,7 +98,7 @@ a custom function in order to call the API with different parameters:
return pd.json_normalize(results)
By calling the function ``get_smarter_datasets`` we can get the data from the API
and transform it into a pandas DataFrame to collect all the *datasets* object from
and transform it into a ``pandas.DataFrame`` to collect all the *datasets* object from
the *Dataset* endpoint. Similarly, we can define a function to get the data from the
*Breed* endpoint:

Expand All @@ -113,7 +114,7 @@ the *Dataset* endpoint. Similarly, we can define a function to get the data from
``get_smarter_breeds`` and ``get_smarter_datasets`` functions can be used to return
all the SMARTER *datasets* and *breeds*. However you can pass additional parameters to
the endpoint using the ``params`` parameter (which can be a dictionary or a list
the endpoints using the ``params`` parameter (which can be a dictionary or a list
of tuples, when specifying the same parameter multiple times). For
example, you could retrieve all goats breeds using the ``species`` option:

Expand Down
2 changes: 1 addition & 1 deletion flask-data/smarter/docs/source/accessing/r.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ endpoints relying on parameters:
query = list(breed_code = "LNR")
)
As for the breed example, we can refine our query, for example by selecting
We can refine our query, for example by selecting
Landrace goat samples which have a locations (GPS coordinates) and phenotypes
defined (mind to the double ``_`` in ``locations__exists`` and
``phenotype__exists``):
Expand Down
9 changes: 3 additions & 6 deletions flask-data/smarter/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Welcome to SMARTER-backend's documentation!
This documentation describes how to install and interact with the SMARTER database
backend. Briefly, the SMARTER database created and maintained with the
`SMARTER-database <https://github.com/cnr-ibba/SMARTER-database>`_ project is
made accessible to SMARTER partners using this API. This API is the same used
by the `SMARTER-frontend <https://github.com/cnr-ibba/SMARTER-frontend>`_ in
made accessible to the community using this API. This API is the same used
by the `SMARTER-frontend <https://webserver.ibba.cnr.it/smarter/>`_ in
order to access and browse SMARTER data using a web browser.

SMARTER-backend is a `flask-API <https://flask.palletsprojects.com/en/2.0.x/>`_
Expand All @@ -24,10 +24,7 @@ the data they need using a `PLINK <https://zzz.bwh.harvard.edu/plink/>`_ command
Documentation is organized as following: in :ref:`Introduction` we describe what
SMARTER-backend is and we provide general information. In :ref:`Backend installation`
we describe how to install a local instance of SMARTER-backend. Then in
:ref:`Accessing SMARTER-backend` we describe how to programmatically access to data
or how to inspect data using applications like `Postman <https://www.postman.com/>`_
or `Talend Api Tester <https://chrome.google.com/webstore/detail/talend-api-tester-free-ed/aejoelaoggembcahagimdiliamlcdmfm>`_
google-chrome extension.
:ref:`Accessing SMARTER-backend` we describe how to programmatically access to data.

.. toctree::
:maxdepth: 2
Expand Down
4 changes: 2 additions & 2 deletions flask-data/smarter/docs/source/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ official installation instructions for your operating system.
Create a .env file
------------------

Before running the application, you need to create a .env file in the root directory
Before running the application, you need to create a ``.env`` file in the root directory
of the project. This is required to set the environment variables needed by the
application, like the database connection string. Create a .env file in the root
application, like the database connection string. Create a ``.env`` file in the root
directory of the project with the following content:

.. code-block:: bash
Expand Down
5 changes: 4 additions & 1 deletion flask-data/smarter/docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ supported, ``GET`` and ``POST``:
More precisely, SMARTER data through the SMARTER-backend are read-only and
``GET`` and ``POST`` method are allowed in order to retrieve any type of SMARTER
data object from the API. ``POST`` method are required to submit complex queries
by providing a payload to certain endpoints.
by providing a payload to certain endpoints, for example to retrieve samples
relying on GPS data. For a detailed list of the available endpoints and the
HTTP methods they support, please refer to the
`swagger documentation <https://webserver.ibba.cnr.it/smarter-api/docs/>`_ available.

Status codes
------------
Expand Down

0 comments on commit 159033b

Please sign in to comment.