memberjojo 2.1__py3-none-any.whl → 2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- memberjojo/__init__.py +2 -0
- memberjojo/_version.py +2 -2
- memberjojo/download.py +116 -0
- memberjojo/mojo_common.py +190 -71
- memberjojo/mojo_loader.py +283 -39
- memberjojo/mojo_member.py +109 -33
- memberjojo/mojo_transaction.py +9 -8
- memberjojo/sql_query.py +12 -0
- memberjojo/url.py +82 -0
- {memberjojo-2.1.dist-info → memberjojo-2.3.dist-info}/METADATA +20 -11
- memberjojo-2.3.dist-info/RECORD +13 -0
- memberjojo/config.py +0 -5
- memberjojo-2.1.dist-info/RECORD +0 -11
- {memberjojo-2.1.dist-info → memberjojo-2.3.dist-info}/WHEEL +0 -0
- {memberjojo-2.1.dist-info → memberjojo-2.3.dist-info}/licenses/LICENSE +0 -0
memberjojo/url.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""
|
|
2
|
+
A class for managing Membermojo URLs
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class URL:
|
|
7
|
+
"""A class for managing Membermojo URLs"""
|
|
8
|
+
|
|
9
|
+
def __init__(self, shortname: str):
|
|
10
|
+
"""
|
|
11
|
+
Ininitalise the class
|
|
12
|
+
|
|
13
|
+
:param shortname: the shortname setting on membermojo
|
|
14
|
+
"""
|
|
15
|
+
self.shortname = shortname
|
|
16
|
+
self.base_url = "https://membermojo.co.uk"
|
|
17
|
+
|
|
18
|
+
def make_url(self, endpoint: str) -> str:
|
|
19
|
+
"""
|
|
20
|
+
return a whole url for endpoint
|
|
21
|
+
|
|
22
|
+
:param endpoint: the endpoint to make url for
|
|
23
|
+
|
|
24
|
+
:return: a complete url
|
|
25
|
+
"""
|
|
26
|
+
return f"{self.base_url}/{self.shortname}/{endpoint}"
|
|
27
|
+
|
|
28
|
+
def members(self, state: str = "") -> str:
|
|
29
|
+
"""
|
|
30
|
+
return the active, expired, or archived urls
|
|
31
|
+
|
|
32
|
+
:param state: membership state to return
|
|
33
|
+
|
|
34
|
+
:return: url for the state
|
|
35
|
+
|
|
36
|
+
state:
|
|
37
|
+
"active" or "" -> active members
|
|
38
|
+
"expired" -> expired members
|
|
39
|
+
"archived" -> archived members
|
|
40
|
+
"""
|
|
41
|
+
if state not in {"", "expired", "archived"}:
|
|
42
|
+
raise ValueError(f"Invalid member state: {state}")
|
|
43
|
+
|
|
44
|
+
if state == "active":
|
|
45
|
+
state = ""
|
|
46
|
+
suffix = f"_{state}" if state else ""
|
|
47
|
+
return f"{self.membership}/download{suffix}_members"
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def login(self):
|
|
51
|
+
"""Returns the membermojo login URL"""
|
|
52
|
+
return self.make_url("signin_password")
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def membership(self):
|
|
56
|
+
"""Returns the URL for membership"""
|
|
57
|
+
return self.make_url("membership")
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def completed_payments(self):
|
|
61
|
+
"""Returns the completed payments download URL"""
|
|
62
|
+
return f"{self.membership}/download_completed_payments?state=CO"
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def pending_aproval(self):
|
|
66
|
+
"""Returns the members pending approval URL"""
|
|
67
|
+
return f"{self.membership}/download_pending_approval_members"
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def pending_completion(self):
|
|
71
|
+
"""Returns the members pending completion URL"""
|
|
72
|
+
return f"{self.membership}/download_pending_completion_members"
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def pending_payments(self):
|
|
76
|
+
"""Returns the members pending payments URL"""
|
|
77
|
+
return f"{self.membership}/download_pending_payments"
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def test(self):
|
|
81
|
+
"""Returns the test URL for login verification"""
|
|
82
|
+
return self.membership
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memberjojo
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
4
4
|
Summary: memberjojo - tools for working with members.
|
|
5
5
|
Author-email: Duncan Bellamy <dunk@denkimushi.com>
|
|
6
6
|
Requires-Python: >=3.8
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: sqlcipher3
|
|
11
10
|
Requires-Dist: coverage ; extra == "dev"
|
|
12
11
|
Requires-Dist: flit ; extra == "dev"
|
|
13
12
|
Requires-Dist: pytest ; extra == "dev"
|
|
@@ -17,44 +16,54 @@ Requires-Dist: sphinx>=7.0 ; extra == "docs"
|
|
|
17
16
|
Requires-Dist: sphinx-autodoc-typehints ; extra == "docs"
|
|
18
17
|
Requires-Dist: black ; extra == "lint"
|
|
19
18
|
Requires-Dist: pylint ; extra == "lint"
|
|
19
|
+
Requires-Dist: sqlcipher3 ; extra == "sqlcipher"
|
|
20
20
|
Project-URL: Home, https://github.com/a16bitsysop/memberjojo
|
|
21
21
|
Provides-Extra: dev
|
|
22
22
|
Provides-Extra: docs
|
|
23
23
|
Provides-Extra: lint
|
|
24
|
+
Provides-Extra: sqlcipher
|
|
24
25
|
|
|
25
26
|
# memberjojo
|
|
26
27
|
|
|
27
28
|
`memberjojo` is a Python library for using [Membermojo](http://membermojo.co.uk/)
|
|
28
29
|
data from CSV imports.\
|
|
29
30
|
It provides member database, and completed payments querying.\
|
|
30
|
-
This is done in a local SQLite database which is encrypted
|
|
31
|
-
anything on Membermojo.\
|
|
31
|
+
This is done in a local SQLite database which is optionally encrypted if sqlcipher3
|
|
32
|
+
is installed, and does not alter anything on Membermojo.\
|
|
32
33
|
It provides tools to load, and query membership and transaction data efficiently
|
|
33
34
|
without having to use SQLite directly.\
|
|
34
35
|
When importing CSV files existing entries are dropped before import, so you can
|
|
35
|
-
just import the latest download and the local database is updated
|
|
36
|
+
just import the latest download and the local database is updated with a summary
|
|
37
|
+
diff printed out.
|
|
38
|
+
|
|
39
|
+
Using the download_csv function the csv can be downloaded directly into the db,
|
|
40
|
+
which can also be in memory if :memory: is used as the db path.
|
|
36
41
|
|
|
37
42
|
---
|
|
38
43
|
|
|
39
44
|
## Installation
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(The sqlcipher bindings are compiled by pip so the `C_INCLUDE_PATH` is needed
|
|
45
|
-
for 'clang' to be able to find the header files)\
|
|
46
|
+
Installing via `pip` on macos with optional `sqlcipher` installed via homebrew:\
|
|
47
|
+
(The sqlcipher bindings are compiled by pip so the `C_INCLUDE_PATH` and
|
|
48
|
+
`LIBRARY_PATH` are needed for the `libsqlcipher` files to be found)
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
51
|
brew install sqlcipher
|
|
49
52
|
export C_INCLUDE_PATH="/opt/homebrew/opt/sqlcipher/include"
|
|
50
53
|
export LIBRARY_PATH="/opt/homebrew/opt/sqlcipher/lib"
|
|
51
|
-
pip install memberjojo
|
|
54
|
+
pip install memberjojo[sqlciper]
|
|
52
55
|
```
|
|
53
56
|
|
|
54
57
|
Installing via `pip` on ubuntu:
|
|
55
58
|
|
|
56
59
|
```bash
|
|
57
60
|
sudo apt-get --no-install-recommends --no-install-suggests install libsqlcipher-dev
|
|
61
|
+
pip install memberjojo[sqlcipher]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Installing via `pip` without sqlcipher:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
58
67
|
pip install memberjojo
|
|
59
68
|
```
|
|
60
69
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
memberjojo/__init__.py,sha256=kO0EB2VTfHQFyqERL0qKRlYzAkD_cTm-b3q3uT1r91g,343
|
|
2
|
+
memberjojo/_version.py,sha256=2i05UdhZ8zjlTikPn5gGyFdwY-FJwBWYSRHEBlHO5KU,699
|
|
3
|
+
memberjojo/download.py,sha256=N8s5kFm58gbOaPyWvXxRigbMk5J6vjOx4_GX--JtWFY,4387
|
|
4
|
+
memberjojo/mojo_common.py,sha256=lE9LVVMGI5mbw5n6ZItvqSdswb4sJfLdwfRsgEocGuA,11415
|
|
5
|
+
memberjojo/mojo_loader.py,sha256=QOEPqVrswI82xqkj9CbtGmjRX9sqpRWZBSyhEnm82Os,10758
|
|
6
|
+
memberjojo/mojo_member.py,sha256=mr-4C4W_swzxQ1PcNi0884k59eRGo8fABAEQ0WVjyRo,10472
|
|
7
|
+
memberjojo/mojo_transaction.py,sha256=KCbhrY1Wccs_GoXHtuXgohn5MdxnUiMpKdhcVE348KU,933
|
|
8
|
+
memberjojo/sql_query.py,sha256=4T6EVYZo7q0VQ2Ah6uuX20Ub_g0RsBoKs1qrZmqRK7w,185
|
|
9
|
+
memberjojo/url.py,sha256=vx-l1FlrohlpAExPICU5UYRl34z_tYXvWLzGAaprdXI,2320
|
|
10
|
+
memberjojo-2.3.dist-info/licenses/LICENSE,sha256=eaTLEca5OoRQ9r8GlC6Rwa1BormM3q-ppDWLFFxhQxI,1071
|
|
11
|
+
memberjojo-2.3.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
12
|
+
memberjojo-2.3.dist-info/METADATA,sha256=_1PYJvM6M4f82d4WB-f0tOy7TghxL86HbmURa8RWT3U,3964
|
|
13
|
+
memberjojo-2.3.dist-info/RECORD,,
|
memberjojo/config.py
DELETED
memberjojo-2.1.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
memberjojo/__init__.py,sha256=JGhIJ1HGbzrwzF4HsopOdP4eweLjUmFjbIDvMbk1MKI,291
|
|
2
|
-
memberjojo/_version.py,sha256=sdXMKvhafMmgXhpEPosw8Vx1-ID_v-Fo2LNHMrsKPJc,699
|
|
3
|
-
memberjojo/config.py,sha256=_R3uWh5bfMCfZatXLm49pDXet-tipoPbUO7FUeMu2OI,73
|
|
4
|
-
memberjojo/mojo_common.py,sha256=uisTDjc7SCcTIecF35issytUzD8cHn3Tx7YbDZkp64E,7402
|
|
5
|
-
memberjojo/mojo_loader.py,sha256=PZRrdjCCqatrGbqyqPoI5Pg6IWmeVduqyE8zV9GwKlg,3935
|
|
6
|
-
memberjojo/mojo_member.py,sha256=3UeBIVtSXBCUpvuGN9fIJ0zgXu6vXhs4wFDHeDnOG0o,8078
|
|
7
|
-
memberjojo/mojo_transaction.py,sha256=EuP_iu5R5HHCkr6PaJdWG0BP-XFMAjl-YPuCDVnKaRE,916
|
|
8
|
-
memberjojo-2.1.dist-info/licenses/LICENSE,sha256=eaTLEca5OoRQ9r8GlC6Rwa1BormM3q-ppDWLFFxhQxI,1071
|
|
9
|
-
memberjojo-2.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
10
|
-
memberjojo-2.1.dist-info/METADATA,sha256=3acNsTk91IdcxAHJ0-a5mjS74VjittHIcWD17gY3H7g,3602
|
|
11
|
-
memberjojo-2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|