memberjojo 2.2__py3-none-any.whl → 3.0__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/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.2
3
+ Version: 3.0
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,28 +16,34 @@ 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, and does not alter
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
- Installing via `pip` on macos with `sqlcipher` installed via homebrew:\
46
+ Installing via `pip` on macos with optional `sqlcipher` installed via homebrew:\
42
47
  (The sqlcipher bindings are compiled by pip so the `C_INCLUDE_PATH` and
43
48
  `LIBRARY_PATH` are needed for the `libsqlcipher` files to be found)
44
49
 
@@ -46,13 +51,19 @@ Installing via `pip` on macos with `sqlcipher` installed via homebrew:\
46
51
  brew install sqlcipher
47
52
  export C_INCLUDE_PATH="/opt/homebrew/opt/sqlcipher/include"
48
53
  export LIBRARY_PATH="/opt/homebrew/opt/sqlcipher/lib"
49
- pip install memberjojo
54
+ pip install memberjojo[sqlciper]
50
55
  ```
51
56
 
52
57
  Installing via `pip` on ubuntu:
53
58
 
54
59
  ```bash
55
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
56
67
  pip install memberjojo
57
68
  ```
58
69
 
@@ -0,0 +1,13 @@
1
+ memberjojo/__init__.py,sha256=kO0EB2VTfHQFyqERL0qKRlYzAkD_cTm-b3q3uT1r91g,343
2
+ memberjojo/_version.py,sha256=5dvh8NEGPynimE4L7R3rRJScHS-KLrDLsbEL9spnkgw,699
3
+ memberjojo/download.py,sha256=N8s5kFm58gbOaPyWvXxRigbMk5J6vjOx4_GX--JtWFY,4387
4
+ memberjojo/mojo_common.py,sha256=n63QPXXruOHZWIdTLFJvOBZb484KuAsHApZfg7VBDOE,12320
5
+ memberjojo/mojo_loader.py,sha256=D8-jnNaFQ57O16drcLcAYHlLIe9-r6FKVKoTaK4Oaj4,11619
6
+ memberjojo/mojo_member.py,sha256=UWQKJh_aEn5J1-Yb_7StijHf6JRiq2RnhMJzRos0prc,10981
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-3.0.dist-info/licenses/LICENSE,sha256=eaTLEca5OoRQ9r8GlC6Rwa1BormM3q-ppDWLFFxhQxI,1071
11
+ memberjojo-3.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
12
+ memberjojo-3.0.dist-info/METADATA,sha256=bFOpMMpcy4A_0PwrmzousoBu9tOQzR1YRUTxycqNmMg,3964
13
+ memberjojo-3.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- memberjojo/__init__.py,sha256=JGhIJ1HGbzrwzF4HsopOdP4eweLjUmFjbIDvMbk1MKI,291
2
- memberjojo/_version.py,sha256=_Nk5-Ctb0Jdj1fjUXI6x5dxb-FwdE56jfaBDPomGv_A,699
3
- memberjojo/mojo_common.py,sha256=DqJ3NKq1Lrcv8NejJFR3ZHlwZifTjqIZv6Vp0R8yOQQ,8340
4
- memberjojo/mojo_loader.py,sha256=pKqp7QiirThYd6gIy1LQ48GbV2DVFL0yZSLUWxuTLa0,9232
5
- memberjojo/mojo_member.py,sha256=3UeBIVtSXBCUpvuGN9fIJ0zgXu6vXhs4wFDHeDnOG0o,8078
6
- memberjojo/mojo_transaction.py,sha256=EuP_iu5R5HHCkr6PaJdWG0BP-XFMAjl-YPuCDVnKaRE,916
7
- memberjojo-2.2.dist-info/licenses/LICENSE,sha256=eaTLEca5OoRQ9r8GlC6Rwa1BormM3q-ppDWLFFxhQxI,1071
8
- memberjojo-2.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
9
- memberjojo-2.2.dist-info/METADATA,sha256=p8d0fTLtfNk5Hir3CRwjBl5WhSYrZL4UpiokpsE0Wsk,3593
10
- memberjojo-2.2.dist-info/RECORD,,