Skip to content

Commit e32d13e

Browse files
committed
v1.3.0 - Added async_sync, run_sync + More
**asyncx.py** - Added `async_sync` decorator for easily running async functions/methods from non-async functions/methods. Useful for unit tests. - Added `run_sync` function, mainly intended for running async functions from the REPL with ease **common.py** - Added `dec_round` for rounding `Decimal` objects to arbitrary DP - Added `env_cast`, `env_int`, and `env_decimal` - Added `chunked` function for slicing a list into multiple equal sized lists - Added `Dictable` abstract class - eases creating Python 3.7 `dataclass` objects from `dict`'s as well as converting them back into `dict`'s **tests.py** - Added new `TestGeneral` test case, for unit testing some of the new functions **Documentation** - Added docs for `asyncx` module - Updated `common` module to include new functions/classes - Fixed docs for `tests` - Various cleanup to reduce warnings from Sphinx
1 parent 342addb commit e32d13e

31 files changed

Lines changed: 635 additions & 422 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.asyncx.async\_sync
2+
=================================
3+
4+
.. currentmodule:: privex.helpers.asyncx
5+
6+
.. autofunction:: async_sync
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.asyncx.run\_sync
2+
===============================
3+
4+
.. currentmodule:: privex.helpers.asyncx
5+
6+
.. autofunction:: run_sync
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.common.chunked
2+
=============================
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: chunked
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.common.dec\_round
2+
================================
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: dec_round
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.common.env\_cast
2+
===============================
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: env_cast
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.common.env\_decimal
2+
==================================
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: env_decimal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.common.env\_int
2+
==============================
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: env_int
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
privex.helpers.decorators.async\_sync
2+
=====================================
3+
4+
.. currentmodule:: privex.helpers.decorators
5+
6+
.. autofunction:: async_sync

docs/source/helpers/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Code Docs for each helper module
44
.. autosummary::
55
:toctree:
66

7+
privex.helpers.asyncx
78
privex.helpers.common
89
privex.helpers.decorators
910
privex.helpers.django
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
privex.helpers.asyncx
2+
=====================
3+
4+
.. automodule:: privex.helpers.asyncx
5+
6+
7+
8+
.. rubric:: Functions
9+
10+
.. autosummary::
11+
:toctree: asyncx
12+
13+
async_sync
14+
run_sync
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+

0 commit comments

Comments
 (0)