Skip to content

Commit cdee841

Browse files
committed
update docs
1 parent 659f94a commit cdee841

File tree

6 files changed

+62
-43
lines changed

6 files changed

+62
-43
lines changed

AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
About the Author
44
------------------------------------------------------------------------------
5-
**Sanhe Hu** is a very active **Python Developer** Since 2010. Research area includes **Machine Learning, Big Data Infrastructure, Block Chain, Business Intelligent, AWS, Distributive System**. Love photography, outdoor, arts, game, and also the best `Python <https://www.python.org/>`_.
5+
**Sanhe Hu** is a very active **Python Developer and AWS veteran** Since 2010. Research area includes **Machine Learning, Big Data Infrastructure, Block Chain, Business Intelligent, AWS, Distributive System**. Love photography, outdoor, arts, game, and also the best `Python <https://www.python.org/>`_.
66

77
- My Github: https://github.com/MacHu-GWU

README.rst

+16-20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
:target: https://pypi.python.org/pypi/pynamodb_mate
1919

2020
.. image:: https://img.shields.io/pypi/dm/pynamodb-mate.svg
21+
:target: https://pypi.python.org/pypi/pynamodb_mate
22+
23+
.. image:: https://img.shields.io/badge/Release_History!--None.svg?style=social
24+
:target: https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/release-history.rst
2125

2226
.. image:: https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
2327
:target: https://github.com/MacHu-GWU/pynamodb_mate-project
@@ -53,15 +57,13 @@ Welcome to ``pynamodb_mate`` Documentation
5357
==============================================================================
5458
📙 `Full Documentation is Here <https://pynamodb-mate.readthedocs.io/>`_
5559

56-
.. contents::
57-
:class: this-will-duplicate-information-and-it-is-still-useful-here
58-
:depth: 1
59-
:local:
60+
.. image:: https://pynamodb-mate.readthedocs.io/en/latest/_static/pynamodb_mate-logo.png
61+
:target: https://pynamodb-mate.readthedocs.io/
6062

6163

6264
Overview
6365
------------------------------------------------------------------------------
64-
``pynamodb_mate`` provides advanced best practice using DynamoDB in python. Built on top of `pynamodb <https://pynamodb.readthedocs.io/en/latest/>`_ python library. It maintain the compatibility to major version of ``pynamodb`` library. For example ``pynamodb_mate>=5.0.0,<6.0.0`` is compatible to ``pynamodb>=5.0.0,<6.0.0``.
66+
``pynamodb_mate`` provides advanced best practice using DynamoDB in python. Built on top of `pynamodb <https://pynamodb.readthedocs.io/en/latest/>`_ python library. It maintain the compatibility to major version of ``pynamodb`` library. For example ``pynamodb_mate>=5.0.0,<6.0.0`` is compatible to ``pynamodb>=5.0.0,<6.0.0``, ``pynamodb_mate==5.5.1.X`` is compatible to ``pynamodb>=5.5.1,<6.0.0``, ``pynamodb_mate==6.0.0.X`` is compatible to ``pynamodb>=6.0.0,<7.0.0``.
6567

6668

6769
Disclaimer
@@ -71,21 +73,15 @@ Even though the author is a Dynamodb Subject Matter Expert from AWS, but this pr
7173

7274
Features
7375
------------------------------------------------------------------------------
74-
Click on the link below to see detailed tutorial and examples.
75-
76-
- ⭐ `Store Large Object in DynamoDB <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/Store-Large-Object-in-DynamoDB.ipynb>`_: This feature allows you to store any Python object and arbitrary big data in DynamoDB that can exceed the 400KB limit.
77-
- ⭐ `Client Side Encryption <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/Client-Side-Encryption.ipynb>`_: This feature allows you to use your own encryption key to encrypt your data before it is sent to the DynamoDB.
78-
- ⭐ `Compressed Attribute <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/Compressed-Attribute.ipynb>`_: This feature can automatically compress the data before it is sent to the DynamoDB.
79-
- ⭐ `AWS DynamoDB Console Url <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/AWS-DynamoDB-Console-Url.ipynb>`_: This feature can print the AWS DynamoDB console url for the table, items. You can use this in you log to quickly jump to the console to debug.
80-
81-
82-
DynamoDB Patterns
83-
------------------------------------------------------------------------------
84-
``pynamodb_mate`` also provides some commonly used patterns. It is based on the author's experience providing solutions to many customers from different industries. Click on the link below to see detailed tutorial and examples.
85-
86-
- 🎉 `Cache <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/patterns/cache.ipynb>`_: This feature gives you a "Redis" liked, serverless, Zero-ops, auto-scaling, high performance, pay-as-you-go cache layer based on DynamoDB.
87-
- 🎉 `Status Tracker <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/patterns/status-tracker.ipynb>`_: This feature gives you the ability to track status of each task, and error-handling, retry, concurrency control out-of-the-box.
88-
- 🎉 `Relationship <https://github.com/MacHu-GWU/pynamodb_mate-project/blob/master/examples/patterns/relationship.ipynb>`_: This feature allow you to manage mass amount entity and one-to-many, many-to-many relationship in DynamoDB using the ultimate data modeling strategy.
76+
``pynamodb_mate`` provides some commonly used patterns. It is based on the author's experience providing solutions to many customers from different industries. Click on the link below to see detailed tutorial and examples.
77+
78+
- ⭐ `Store Large Object in DynamoDB <https://pynamodb-mate.readthedocs.io/en/latest/01-Store-Large-Object-in-DynamoDB/index.html>`_: This feature allows you to store any Python object and arbitrary big data in DynamoDB that can exceed the 400KB limit. It also handles data consistency and data integrity between DynamoDB and S3.
79+
- ⭐ `Client Side Encryption <https://pynamodb-mate.readthedocs.io/en/latest/02-Client-Side-Encryption/index.html>`_: This feature allows you to use your own encryption key to encrypt your data before it is sent to the DynamoDB.
80+
- ⭐ `Compressed Attribute <https://pynamodb-mate.readthedocs.io/en/latest/03-Compressed-Attribute/index.html>`_: This feature can automatically compress the data before it is sent to the DynamoDB, it would save you a lot of money if you use JSON attribute in DynamoDB.
81+
- ⭐ `AWS DynamoDB Console Url <https://pynamodb-mate.readthedocs.io/en/latest/04-DynamoDB-Consule-Url/index.html>`_: This feature can print the AWS DynamoDB console url for the table, items. You can use this in you log to quickly jump to the console to debug.
82+
- ⭐ `Use DynamoDB as a Cache Backend <https://pynamodb-mate.readthedocs.io/en/latest/05-Use-DynamoDB-as-Cache-Backend/index.html>`_: This feature gives you a "Redis" liked, serverless, Zero-ops, auto-scaling, high performance, pay-as-you-go cache layer based on DynamoDB.
83+
- ⭐ `Enable status tracking for business critical application using Amazon DynamoDB <https://pynamodb-mate.readthedocs.io/en/latest/06-Status-Tracker/index.html>`_: This feature gives you the ability to track status of each task, and error-handling, retry, concurrency control out-of-the-box.
84+
- ⭐ `Modeling Relational Data in DynamoDB <https://pynamodb-mate.readthedocs.io/en/latest/07-Modeling-Relational-Data-in-DynamoDB/index.html>`_: This feature allow you to manage mass amount entity and one-to-many, many-to-many relationship in DynamoDB using the ultimate data modeling strategy that has high performance and scales well. Made data modeling in DynamoDB deadly simple.
8985

9086

9187
.. _install:

docs/source/03-Compressed-Attribute/index.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": [
1515
"# Compressed Attribute\n",
1616
"\n",
17-
"## Summary\n",
17+
"## Overview\n",
1818
"\n",
1919
"Sometimes you want to compress the data before store to save DB space. For example, in an E-commerce data model, an order has many items like this: ``[{\"item_name\": \"apple\", \"item_count\": 12}, {\"item_name\": \"banana\", \"item_count\": 5}]``. There are lots of repeated information such as the keys ``\"item_name\"`` and ``\"item_count\"``.\n",
2020
"\n",

docs/source/06-Status-Tracker/index.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444
},
4545
"source": [
46-
"# Declare Your DynamoDB Status Tracking Table\n",
46+
"## Declare Your DynamoDB Status Tracking Table\n",
4747
"\n",
4848
"1. First, We define some status code using the enum Python standard library. It improves the code readability and avoids hard coding meaningless integers everywhere in the code base.\n",
4949
"2. We declare a DynamoDB table data model and the status GSI index schema.\n",
@@ -193,7 +193,7 @@
193193
}
194194
},
195195
"source": [
196-
"# Initialize a Task\n",
196+
"## Initialize a Task\n",
197197
"\n",
198198
"The ``Tracker.new(task_id, data)`` method can be used to initialize a task and save to DynamoDB using the ``DEFAULT_STATUS``."
199199
]
@@ -402,7 +402,7 @@
402402
}
403403
},
404404
"source": [
405-
"# Error Handling\n",
405+
"## Error Handling\n",
406406
"\n",
407407
"Let's reset the task and do it one more time, this time the job logic will fail.\n",
408408
"\n",
@@ -592,7 +592,7 @@
592592
}
593593
},
594594
"source": [
595-
"# Ignore Task if Failed Too Many Times\n",
595+
"## Ignore Task if Failed Too Many Times\n",
596596
"\n",
597597
"You don't want a task that logically can never succeed to fail into a endless loop. In this example, we defined the max retry times is 3. If it failed 3 times in a row, it will be ignored. And if you want to start a task that is ignored, you will see an ``TaskIgnoredError``"
598598
]
@@ -1079,7 +1079,7 @@
10791079
}
10801080
},
10811081
"source": [
1082-
"# Save Custom Metadata to the Tracker\n",
1082+
"## Save Custom Metadata to the Tracker\n",
10831083
"\n",
10841084
"You may want to store custom metadata to DynamoDB. Since DynamoDB is schemaless, you can store arbitrary data in DynamoDB."
10851085
]
@@ -1173,7 +1173,7 @@
11731173
}
11741174
},
11751175
"source": [
1176-
"# Query Tasks by Status\n",
1176+
"## Query Tasks by Status\n",
11771177
"\n",
11781178
"To restart some tasks from the last failed, you need to be able to query the tasks by status. The ``Tracker.query_by_status()`` method allow you to get tasks by one or many status codes. By default, it returns tasks ordered by ``update_time``."
11791179
]
@@ -1480,7 +1480,7 @@
14801480
}
14811481
},
14821482
"source": [
1483-
"# Conclusion\n",
1483+
"## Conclusion\n",
14841484
"\n",
14851485
"In general, this solution can improve the visibility, resilience and reliability of a business critical application. There’s no upfront effort to use this solution, because DynamoDB is a fully managed service. Naturally, it is scalable to adapt to very high workload or unpredictable workload.\n",
14861486
"\n",

docs/source/07-Modeling-Relational-Data-in-DynamoDB/index.ipynb

+14-14
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262
},
6363
"source": [
64-
"# Declare Entity Table and Lookup Index"
64+
"## Declare Entity Table and Lookup Index"
6565
]
6666
},
6767
{
@@ -113,7 +113,7 @@
113113
}
114114
},
115115
"source": [
116-
"# Declare Data Model for Each Entity\n",
116+
"## Declare Data Model for Each Entity\n",
117117
"\n",
118118
"In this ultimate data modeling strategy, all entities are stored within a single table. To enhance code organization, readability, and maintainability, it is highly recommended to define subclasses for each entity type. By creating separate subclasses, you can encapsulate entity-specific logic, attributes, and behavior within their respective classes.\n",
119119
"\n",
@@ -186,7 +186,7 @@
186186
}
187187
},
188188
"source": [
189-
"# Declare Data Model for Each Relationship\n",
189+
"## Declare Data Model for Each Relationship\n",
190190
"\n",
191191
"Similarly, a relationship is just a DynamoDB item. You also need a class for each relationship."
192192
]
@@ -299,7 +299,7 @@
299299
}
300300
},
301301
"source": [
302-
"# Declare Type Hint and Iterator Proxy Object\n",
302+
"## Declare Type Hint and Iterator Proxy Object\n",
303303
"\n",
304304
"This is recommended but optional."
305305
]
@@ -403,7 +403,7 @@
403403
}
404404
},
405405
"source": [
406-
"# Declare Relationship Settings\n",
406+
"## Declare Relationship Settings\n",
407407
"\n",
408408
"The ``RelationshipSetting`` object is a central component of the library that stores all the metadata related to entity relationships. It serves as a configuration object that defines the characteristics and behavior of entities and their relationships.\n",
409409
"\n",
@@ -837,7 +837,7 @@
837837
}
838838
},
839839
"source": [
840-
"# Setup Local DynamoDB Mock "
840+
"## Setup Local DynamoDB Mock "
841841
]
842842
},
843843
{
@@ -874,7 +874,7 @@
874874
}
875875
},
876876
"source": [
877-
"# Create Some Test Data"
877+
"## Create Some Test Data"
878878
]
879879
},
880880
{
@@ -982,7 +982,7 @@
982982
}
983983
},
984984
"source": [
985-
"# Declare Some Helper Functions For Testing"
985+
"## Declare Some Helper Functions For Testing"
986986
]
987987
},
988988
{
@@ -1108,7 +1108,7 @@
11081108
}
11091109
},
11101110
"source": [
1111-
"# Test Video Ownership Relationship (One to Many)"
1111+
"## Test Video Ownership Relationship (One to Many)"
11121112
]
11131113
},
11141114
{
@@ -1181,7 +1181,7 @@
11811181
}
11821182
},
11831183
"source": [
1184-
"# Test Channel Ownership Relationship (One to Many)"
1184+
"## Test Channel Ownership Relationship (One to Many)"
11851185
]
11861186
},
11871187
{
@@ -1285,7 +1285,7 @@
12851285
}
12861286
},
12871287
"source": [
1288-
"# Test Channel and Video Relationship (Many to Many)"
1288+
"## Test Channel and Video Relationship (Many to Many)"
12891289
]
12901290
},
12911291
{
@@ -1483,7 +1483,7 @@
14831483
}
14841484
},
14851485
"source": [
1486-
"# Test Playlist and Video Relationship (Many to Many)"
1486+
"## Test Playlist and Video Relationship (Many to Many)"
14871487
]
14881488
},
14891489
{
@@ -1681,7 +1681,7 @@
16811681
}
16821682
},
16831683
"source": [
1684-
"# Test Youtuber Subscription Relationship (Many to Many)"
1684+
"## Test Youtuber Subscription Relationship (Many to Many)"
16851685
]
16861686
},
16871687
{
@@ -1937,7 +1937,7 @@
19371937
}
19381938
},
19391939
"source": [
1940-
"# Test Channel Subscription Relationship (Many to Many)"
1940+
"## Test Channel Subscription Relationship (Many to Many)"
19411941
]
19421942
},
19431943
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
Manually run unit test on different combination of pynamodb versions.
5+
"""
6+
7+
import subprocess
8+
from pynamodb_mate.paths import dir_project_root, dir_venv_bin
9+
10+
pynamodb_versions = [
11+
"5.5.1",
12+
]
13+
path_venv_pip = dir_venv_bin / "pip"
14+
with dir_project_root.cwd():
15+
for version in pynamodb_versions:
16+
subprocess.run(
17+
[
18+
f"{path_venv_pip}",
19+
"install",
20+
f"pynamodb=={version}",
21+
]
22+
)
23+
subprocess.run(["pyops", "cov-only"])

0 commit comments

Comments
 (0)