From 858f93a53e7e9b91d9456b8f6b85866cbd216140 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 19 Jun 2017 13:22:22 +0200 Subject: [PATCH] Docs --- docs/examples.rst | 20 ++++++++++++++ docs/index.rst | 1 + docs/libref.rst | 68 +++++++++++++++++++++-------------------------- 3 files changed, 51 insertions(+), 38 deletions(-) create mode 100644 docs/examples.rst diff --git a/docs/examples.rst b/docs/examples.rst new file mode 100644 index 0000000..5a9934f --- /dev/null +++ b/docs/examples.rst @@ -0,0 +1,20 @@ +Examples +======== + +Preimage Sha 256 +---------------- + +.. code-block:: python + + >>> from cryptoconditions import PreimageSha256 + + >>> secret = b'Beware! Trying to understand crypto can lead to knowledge intoxications.' + + >>> fulfillment = PreimageSha256(preimage=secret) + + >>> fulfillment.condition_uri + 'ni:///sha-256;xumt48hVcQEXuUx2p2GqVgO4mpq9O_FIYmjb258CkZM?fpt=preimage-sha-256&cost=72' + + >>> fulfillment.condition_binary + b'\xa0%\x80 \xc6\xe9\xad\xe3\xc8Uq\x01\x17\xb9Lv\xa7a\xaaV\x03\xb8\x9a\x9a\xbd;\xf1Hbh\xdb\xdb\x9f\x02\x91\x93\x81\x01H' + diff --git a/docs/index.rst b/docs/index.rst index 18a4330..d31cac7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,6 +12,7 @@ Contents: :maxdepth: 1 installation + examples libref diff --git a/docs/libref.rst b/docs/libref.rst index 2f9dd1d..3fd842f 100644 --- a/docs/libref.rst +++ b/docs/libref.rst @@ -34,59 +34,51 @@ Base Modules .. automodule:: cryptoconditions.exceptions -Types Modules -============= +Schemas Modules +=============== -``base_sha256`` ---------------- -.. automodule:: cryptoconditions.types.base_sha256 +``condition`` +------------- +.. automodule:: cryptoconditions.schemas.condition +``fulfillment`` +--------------- +.. automodule:: cryptoconditions.schemas.fulfillment -``ed25519`` ------------ -.. automodule:: cryptoconditions.types.ed25519 - :special-members: __init__ +``fingerprint`` +--------------- +.. automodule:: cryptoconditions.schemas.fingerprint -``inverted_threshold_sha256`` ------------------------------ -.. automodule:: cryptoconditions.types.inverted_threshold_sha256 - :special-members: __init__ +Types Modules +============= -``sha256`` ----------- -.. automodule:: cryptoconditions.types.sha256 +``base_sha256`` +--------------- +.. automodule:: cryptoconditions.types.base_sha256 -``threshold_sha256`` --------------------- -.. automodule:: cryptoconditions.types.threshold_sha256 +``preimage`` +------------ +.. automodule:: cryptoconditions.types.preimage -``timeout`` ------------ -.. automodule:: cryptoconditions.types.timeout +``prefix`` +------------ +.. automodule:: cryptoconditions.types.prefix -Lib Modules -=========== +``threshold`` +------------- +.. automodule:: cryptoconditions.types.threshold -``hasher`` ----------- -.. automodule:: cryptoconditions.lib.hasher - :special-members: __init__ -``predictor`` +``rsa`` ------------- -.. automodule:: cryptoconditions.lib.predictor - :special-members: __init__ +.. automodule:: cryptoconditions.types.rsa -``reader`` ----------- -.. automodule:: cryptoconditions.lib.reader - :special-members: __init__ -``writer`` ----------- -.. automodule:: cryptoconditions.lib.writer +``ed25519`` +----------- +.. automodule:: cryptoconditions.types.ed25519 :special-members: __init__