baridimob 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BaridiMob SDK contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ prune tests
2
+ global-exclude __pycache__ *.py[cod]
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: baridimob
3
+ Version: 0.1.0
4
+ Summary: Open-source Python SDK for BaridiMob (Algérie Poste)
5
+ Author: BaridiMob SDK contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/baridimobsdk/baridimob
8
+ Project-URL: Repository, https://github.com/baridimobsdk/baridimob
9
+ Keywords: baridimob,algerie-poste,ccp,payment,sdk,algeria
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: httpx>=0.27
14
+ Dynamic: license-file
15
+
16
+ # baridimob — Python SDK
17
+
18
+ Open-source SDK for **BaridiMob** (Algérie Poste).
19
+
20
+ > Work in progress — the public API is not stable yet.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ pip install baridimob
26
+ ```
27
+
28
+ ## Quickstart
29
+
30
+ ```python
31
+ from baridimob import Config, FileStorage, create_client
32
+
33
+ bm = create_client(Config(storage=FileStorage("./.baridimob/session.json")))
34
+
35
+ result = bm.auth.login("your-login", "your-password")
36
+ if result.state == "otp_required":
37
+ bm.auth.request_device_otp()
38
+ bm.auth.confirm_device("123456")
39
+
40
+ accounts = bm.accounts.list()
41
+ history = bm.accounts.transactions(accounts[0].number, page=1)
42
+
43
+ pending = bm.transfers.send(1000, accounts[0].number, "00799999000000000000")
44
+ # SMS is sent here; show the OTP screen, then:
45
+ receipt = pending.confirm("123456")
46
+ ```
47
+
48
+ The device is confirmed once. Later logins on the same machine reuse the stored
49
+ device keys and need no OTP. Session expiry is handled automatically.
50
+
51
+ ## Status
52
+
53
+ | Module | Status |
54
+ |--------|--------|
55
+ | core — signer, device keys, transport (form/JSON/binary), typed errors, storage | done (unit-tested) |
56
+ | auth — login, device OTP, logout, automatic re-login | done |
57
+ | accounts — list, detail, balance, history, find, iterate | done |
58
+ | payments — verify, categories, providers, check + exec (card), dynamic FPE | done |
59
+ | transfers — strategies, arm, request_otp, exec, send | done |
60
+ | receipts — recent operations, PDF download | done |
61
+ | profile — client identity and flags | done |
62
+ | cards | planned |
63
+ | cardless | planned |
64
+
65
+ ## Security
66
+
67
+ - HTTPS is enforced. Plain `http://` is accepted only for `localhost` / `127.0.0.1`
68
+ or when `allow_insecure=True` is set explicitly.
69
+ - The stored session is a live credential. Encrypt it at rest and never commit it.
70
+ - Money movement always requires an OTP supplied by the caller.
71
+
72
+ ## Requirements
73
+
74
+ - Python >= 3.10
75
+ - `httpx`
76
+
77
+ ## License
78
+
79
+ MIT
@@ -0,0 +1,64 @@
1
+ # baridimob — Python SDK
2
+
3
+ Open-source SDK for **BaridiMob** (Algérie Poste).
4
+
5
+ > Work in progress — the public API is not stable yet.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install baridimob
11
+ ```
12
+
13
+ ## Quickstart
14
+
15
+ ```python
16
+ from baridimob import Config, FileStorage, create_client
17
+
18
+ bm = create_client(Config(storage=FileStorage("./.baridimob/session.json")))
19
+
20
+ result = bm.auth.login("your-login", "your-password")
21
+ if result.state == "otp_required":
22
+ bm.auth.request_device_otp()
23
+ bm.auth.confirm_device("123456")
24
+
25
+ accounts = bm.accounts.list()
26
+ history = bm.accounts.transactions(accounts[0].number, page=1)
27
+
28
+ pending = bm.transfers.send(1000, accounts[0].number, "00799999000000000000")
29
+ # SMS is sent here; show the OTP screen, then:
30
+ receipt = pending.confirm("123456")
31
+ ```
32
+
33
+ The device is confirmed once. Later logins on the same machine reuse the stored
34
+ device keys and need no OTP. Session expiry is handled automatically.
35
+
36
+ ## Status
37
+
38
+ | Module | Status |
39
+ |--------|--------|
40
+ | core — signer, device keys, transport (form/JSON/binary), typed errors, storage | done (unit-tested) |
41
+ | auth — login, device OTP, logout, automatic re-login | done |
42
+ | accounts — list, detail, balance, history, find, iterate | done |
43
+ | payments — verify, categories, providers, check + exec (card), dynamic FPE | done |
44
+ | transfers — strategies, arm, request_otp, exec, send | done |
45
+ | receipts — recent operations, PDF download | done |
46
+ | profile — client identity and flags | done |
47
+ | cards | planned |
48
+ | cardless | planned |
49
+
50
+ ## Security
51
+
52
+ - HTTPS is enforced. Plain `http://` is accepted only for `localhost` / `127.0.0.1`
53
+ or when `allow_insecure=True` is set explicitly.
54
+ - The stored session is a live credential. Encrypt it at rest and never commit it.
55
+ - Money movement always requires an OTP supplied by the caller.
56
+
57
+ ## Requirements
58
+
59
+ - Python >= 3.10
60
+ - `httpx`
61
+
62
+ ## License
63
+
64
+ MIT
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "baridimob"
7
+ version = "0.1.0"
8
+ description = "Open-source Python SDK for BaridiMob (Algérie Poste)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "BaridiMob SDK contributors" }]
13
+ keywords = ["baridimob", "algerie-poste", "ccp", "payment", "sdk", "algeria"]
14
+ dependencies = ["httpx>=0.27"]
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/baridimobsdk/baridimob"
18
+ Repository = "https://github.com/baridimobsdk/baridimob"
19
+
20
+ [tool.setuptools.packages.find]
21
+ where = ["src"]
22
+
23
+ [tool.pytest.ini_options]
24
+ pythonpath = ["src"]
25
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,148 @@
1
+ from .client import BaridiMob, Config, create_client
2
+ from .errors import (
3
+ AccountLockedError,
4
+ ApiResultError,
5
+ BaridiMobError,
6
+ DeviceConfirmationRequiredError,
7
+ DeviceFlowError,
8
+ ExpiredOtpError,
9
+ HashedRetryError,
10
+ InvalidCredentialsError,
11
+ InvalidOtpError,
12
+ InvalidSignatureError,
13
+ NetworkError,
14
+ PasswordExpiredError,
15
+ RegistrationRequiredError,
16
+ ServerError,
17
+ SessionExpiredError,
18
+ TermsRequiredError,
19
+ TimeoutError,
20
+ TooManyAttemptsError,
21
+ )
22
+ from .keys import (
23
+ DEVKEY_ALGORITHM,
24
+ DEVKEY_ALGORITHM_HASH,
25
+ DeviceKeys,
26
+ algorithm_hash,
27
+ derive_devkey,
28
+ generate_device_keys,
29
+ sha256_hex,
30
+ )
31
+ from .parse import (
32
+ day_bounds,
33
+ is_within_bounds,
34
+ parse_account,
35
+ parse_accounts,
36
+ parse_dynamic_groups,
37
+ parse_dynamic_operation,
38
+ parse_dynamic_step,
39
+ parse_history,
40
+ parse_payment_categories,
41
+ parse_payment_providers,
42
+ parse_profile,
43
+ parse_recent_operations,
44
+ parse_timestamp,
45
+ parse_transaction,
46
+ to_date_param,
47
+ )
48
+ from .sign import INITIAL_STAMP, sign_json_body, sign_params
49
+ from .storage import FileStorage, MemoryStorage
50
+ from .types import (
51
+ Account,
52
+ DynamicGroup,
53
+ DynamicOperationInfo,
54
+ DynamicOperationRef,
55
+ DynamicStep,
56
+ DynamicStepInput,
57
+ HistoryPage,
58
+ LoginResult,
59
+ PaymentCategory,
60
+ PaymentCheckResult,
61
+ PaymentExecResult,
62
+ PaymentProvider,
63
+ Profile,
64
+ ProviderParam,
65
+ RecentOperation,
66
+ SessionStorage,
67
+ StoredSession,
68
+ Transaction,
69
+ TransferArmResult,
70
+ TransferExecResult,
71
+ TransferPending,
72
+ VerifyPaymentResult,
73
+ )
74
+
75
+ __version__ = "0.1.0"
76
+
77
+ __all__ = [
78
+ "BaridiMob",
79
+ "Config",
80
+ "create_client",
81
+ "Account",
82
+ "AccountLockedError",
83
+ "ApiResultError",
84
+ "BaridiMobError",
85
+ "DeviceConfirmationRequiredError",
86
+ "DeviceFlowError",
87
+ "DEVKEY_ALGORITHM",
88
+ "DEVKEY_ALGORITHM_HASH",
89
+ "DeviceKeys",
90
+ "DynamicGroup",
91
+ "DynamicOperationInfo",
92
+ "DynamicOperationRef",
93
+ "DynamicStep",
94
+ "DynamicStepInput",
95
+ "ExpiredOtpError",
96
+ "FileStorage",
97
+ "HashedRetryError",
98
+ "HistoryPage",
99
+ "INITIAL_STAMP",
100
+ "InvalidCredentialsError",
101
+ "InvalidOtpError",
102
+ "InvalidSignatureError",
103
+ "LoginResult",
104
+ "MemoryStorage",
105
+ "NetworkError",
106
+ "PasswordExpiredError",
107
+ "PaymentCategory",
108
+ "PaymentCheckResult",
109
+ "PaymentExecResult",
110
+ "PaymentProvider",
111
+ "Profile",
112
+ "ProviderParam",
113
+ "RecentOperation",
114
+ "RegistrationRequiredError",
115
+ "ServerError",
116
+ "SessionExpiredError",
117
+ "SessionStorage",
118
+ "StoredSession",
119
+ "TermsRequiredError",
120
+ "TimeoutError",
121
+ "TooManyAttemptsError",
122
+ "Transaction",
123
+ "TransferArmResult",
124
+ "TransferExecResult",
125
+ "TransferPending",
126
+ "VerifyPaymentResult",
127
+ "algorithm_hash",
128
+ "day_bounds",
129
+ "derive_devkey",
130
+ "generate_device_keys",
131
+ "is_within_bounds",
132
+ "parse_account",
133
+ "parse_accounts",
134
+ "parse_dynamic_groups",
135
+ "parse_dynamic_operation",
136
+ "parse_dynamic_step",
137
+ "parse_history",
138
+ "parse_payment_categories",
139
+ "parse_payment_providers",
140
+ "parse_profile",
141
+ "parse_recent_operations",
142
+ "parse_timestamp",
143
+ "parse_transaction",
144
+ "sha256_hex",
145
+ "sign_json_body",
146
+ "sign_params",
147
+ "to_date_param",
148
+ ]