bracelet.py 1.0.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.
bracelet/__init__.py ADDED
File without changes
bracelet/bracelet.py ADDED
@@ -0,0 +1,37 @@
1
+ import requests
2
+ from dataclasses import dataclass
3
+ from dotenv import load_dotenv
4
+ load_dotenv() # Just incase.
5
+
6
+ global __version__
7
+ __version__ = "1.0.0"
8
+ global __endpoint__
9
+ __endpoint__ = "https://api.bracelet.oriaxen.com"
10
+
11
+ @dataclass
12
+ class BraceletData:
13
+ status: str
14
+ user: dict
15
+ kv: dict
16
+
17
+ class Bracelet():
18
+ """The Bracelet Object is created/registred from here to save your config."""
19
+ def __init__(self, endpoint: str | None = "https://api.bracelet.oriaxen.com", debug: bool = False):
20
+ self.endpoint = endpoint
21
+ __endpoint__ = endpoint
22
+ self.debug = debug
23
+
24
+ def fetch_data(self, UserID):
25
+ if not (UserID and self and self.debug and self.endpoint):
26
+ return None # I will eventually handle this properly.
27
+ if self.debug == True:
28
+ print(f"[Bracelet] Fetching BraceletData for {UserID} using {self.endpoint}")
29
+ sub = True if self.endpoint.Startswith("api") else False
30
+ _data = None # Again I will handle this properly eventually.
31
+ try:
32
+ _data = requests.get(f'{self.endpoint}/v1/users/{self.UserID}' if sub == True else '{self.endpoint}/api/v1/users/{UserID}')
33
+ except Exception as e:
34
+ _data = None # This will be handled properly eventually.
35
+ if self.debug == True:
36
+ print(f"[Bracelet] An Error Occurred While Fetching The Data For {UserID}: {e}")
37
+ return _data
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: bracelet.py
3
+ Version: 1.0.0
4
+ Summary: A Python Wrapper For The Bracelet API
5
+ Author-email: "LeAndre C." <leandre@lecanact.me>
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/lecanact/bracelet.py
8
+ Project-URL: Issues, https://github.com/lecanact/bracelet.py/issues
9
+ Project-URL: Documentation, https://bracelet.oriaxen.com/sdk/python
10
+ Keywords: lanyard.py,lanyard,bracelet,yapper,yapin
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: python-dotenv>=1.2.4
17
+ Provides-Extra: test
18
+ Requires-Dist: coverage>=7.0; extra == "test"
19
+ Dynamic: license-file
20
+
21
+ # bracelet.py
@@ -0,0 +1,7 @@
1
+ bracelet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ bracelet/bracelet.py,sha256=yeDAijtY0TNRexLpp-YKxFxFlTJCc6W2N4MfnUIVolY,1420
3
+ bracelet_py-1.0.0.dist-info/licenses/LICENSE,sha256=FYUVpTQZZBQQCYbRjJyjBYCmsLJexjzVzXOOEruQPCU,1067
4
+ bracelet_py-1.0.0.dist-info/METADATA,sha256=Vu55C0AccsqS-MKNCriNiHkR1ugqqtTacjv2gaAo6Ls,748
5
+ bracelet_py-1.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
6
+ bracelet_py-1.0.0.dist-info/top_level.txt,sha256=UNrjcvcxMP8WJkDM0761yfgBR6FEeX-1eQFiML2ir4k,9
7
+ bracelet_py-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LeAndre C.
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 @@
1
+ bracelet