Skip to content

Commit

Permalink
268 quickstart (#276)
Browse files Browse the repository at this point in the history
* base quickstart off getting started (simplify a bit) #268

* prevent TypeError: make_identity() got an unexpected keyword argument 'T' #268

Co-authored-by: Andrew Vyrros <6577271+andrewvyrros@users.noreply.github.com>
  • Loading branch information
pdurbin and andrewvyrros committed Sep 10, 2021
1 parent 4ee3224 commit af7b2d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions docs/source/quickstart/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Quickstart
==========

(In the future, this section will describe how to use the `OpenDP Library`_.)
.. contents:: |toctitle|
:local:

.. _OpenDP Library: https://github.com/opendp/opendp
Installation
------------

The easiest way to get started with OpenDP is from Python. Use ``pip`` to install the `opendp <https://pypi.org/project/opendp/>`_ package from PyPI.

.. code-block:: bash
% pip install opendp
This will make the OpenDP modules available to your local environment.

Hello, OpenDP!
--------------

Once you've installed OpenDP, you can write your first program. In the example below, we'll construct an identity ``Transformation``, then invoke it on a string.

.. doctest::

>>> from opendp.trans import make_identity
>>> from opendp.typing import SubstituteDistance

>>> identity = make_identity(M=SubstituteDistance, TA=str)
>>> identity("Hello, world!")
'Hello, world!'
2 changes: 1 addition & 1 deletion docs/source/user/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ Once you've installed OpenDP, you can write your first program. In the example b
>>> from opendp.trans import make_identity
>>> from opendp.typing import SubstituteDistance

>>> identity = make_identity(M=SubstituteDistance, T=str)
>>> identity = make_identity(M=SubstituteDistance, TA=str)
>>> identity("Hello, world!")
'Hello, world!'

0 comments on commit af7b2d9

Please sign in to comment.