Skip to content

Commit

Permalink
Merge pull request #14 from open-contracting/docs
Browse files Browse the repository at this point in the history
Start Docs with a basic functions page that can be expanded later.
  • Loading branch information
odscjames committed Nov 12, 2019
2 parents 85e4811 + 7338ab6 commit e9f34b8
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md

This file was deleted.

2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

If you are viewing this on GitHub, open the `full documentation <https://kingfisher-colab.readthedocs.io/>`__ for additional details.
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
master_doc = 'index'

project = 'OCDS Kingfisher Colab Tool'
copyright = '2019, Open Contracting Data Standard'
85 changes: 85 additions & 0 deletions docs/functions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Functions
=========

All functions are in the package; to import them use something like:

.. code-block:: python
from kingfishercolab import create_connection, authenticate_gspread, getResults, saveToCSV, saveToSheets, saveStraightToSheets, downloadReleases, output_notebook, set_spreadsheet_name, authenticate_pydrive, downloadReleases
create_connection
-----------------

Creates a connection to the database.

reset_connection
----------------

Closes and resets connection to database.

This does not re-open the connection again.

authenticate_gspread
--------------------

Authenticates the current user and gives the notebook permission to connect to Google Spreadsheets.

authenticate_pydrive
--------------------

Authenticates the current user and gives the notebook permission to connect to Google Drive.

getResults
----------

Takes in a database cursor and returns a Pandas DataFrame.

saveToCSV
---------

Takes in a Pandas DataFrame and save the data to a file in the notebook.

set_spreadsheet_name
--------------------

Sets the name of the spreadsheet to save. Used by saveStraightToSheets.

saveStraightToSheets
--------------------

Saves a DataFrame straight to a Google Spreadsheet.

saveToSheets
------------

The same as saveStraightToSheets, except the user is prompted if they are sure first.

downloadReleases
----------------

Downloads some releases into a file in the notebook.

output_gsheet
-------------

This has not been coded yet.

output_flattened_gsheet
-----------------------

This has not been coded yet.

output_notebook
---------------

Runs a SQL query and returns results to the notebook.

download_json
-------------

This has not been coded yet.





8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
OCDS Kingfisher Colab
=====================

OCDS Kingfisher Colab is a library of handy functions for use in Colab notebooks.

.. toctree::

functions.rst

0 comments on commit e9f34b8

Please sign in to comment.