locketnoni 1.0.2__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.
- locketlam/__init__.py +29 -0
- locketlam/__main__.py +41 -0
- locketlam/caption_presets.json +2021 -0
- locketlam/client.py +137 -0
- locketlam/device.py +189 -0
- locketlam/exceptions.py +18 -0
- locketlam/modules/chat.py +484 -0
- locketlam/modules/friends.py +189 -0
- locketlam/modules/moments.py +1420 -0
- locketlam/modules/user.py +187 -0
- locketlam/session.py +125 -0
- locketnoni-1.0.2.dist-info/METADATA +497 -0
- locketnoni-1.0.2.dist-info/RECORD +16 -0
- locketnoni-1.0.2.dist-info/WHEEL +5 -0
- locketnoni-1.0.2.dist-info/licenses/LICENSE +21 -0
- locketnoni-1.0.2.dist-info/top_level.txt +1 -0
locketlam/__init__.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
locketlam - Unofficial Python API SDK for Locket Camera.
|
|
3
|
+
Author: LAMDev x DaLyMMO.com
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .client import LocketClient
|
|
7
|
+
from .device import DeviceProfile
|
|
8
|
+
from .session import SessionManager
|
|
9
|
+
from .modules.moments import NoteType
|
|
10
|
+
from .modules.chat import ReactionEmoji
|
|
11
|
+
from .exceptions import (
|
|
12
|
+
LocketError,
|
|
13
|
+
AuthenticationError,
|
|
14
|
+
LocketAPIError,
|
|
15
|
+
StorageUploadError
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__version__ = "1.0.2"
|
|
19
|
+
__all__ = [
|
|
20
|
+
"LocketClient",
|
|
21
|
+
"DeviceProfile",
|
|
22
|
+
"SessionManager",
|
|
23
|
+
"NoteType",
|
|
24
|
+
"ReactionEmoji",
|
|
25
|
+
"LocketError",
|
|
26
|
+
"AuthenticationError",
|
|
27
|
+
"LocketAPIError",
|
|
28
|
+
"StorageUploadError"
|
|
29
|
+
]
|
locketlam/__main__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import sys
|
|
3
|
+
import argparse
|
|
4
|
+
from locketlam.client import LocketClient
|
|
5
|
+
|
|
6
|
+
# ponytail: minimal stdlib CLI; upgrade to click/typer when nested subcommands exceed 10
|
|
7
|
+
def main():
|
|
8
|
+
parser = argparse.ArgumentParser(prog="locketlam", description="Locket CLI")
|
|
9
|
+
sub = parser.add_subparsers(dest="command", required=True)
|
|
10
|
+
|
|
11
|
+
p_login = sub.add_parser("login", help="Login to Locket")
|
|
12
|
+
p_login.add_argument("-e", "--email", required=True)
|
|
13
|
+
p_login.add_argument("-p", "--password", required=True)
|
|
14
|
+
|
|
15
|
+
sub.add_parser("status", help="Check auth status")
|
|
16
|
+
|
|
17
|
+
p_post = sub.add_parser("post", help="Post image moment")
|
|
18
|
+
p_post.add_argument("-i", "--image", required=True)
|
|
19
|
+
p_post.add_argument("-c", "--caption", default="")
|
|
20
|
+
|
|
21
|
+
p_sync = sub.add_parser("sync", help="Auto backup latest feed moments locally")
|
|
22
|
+
p_sync.add_argument("-o", "--out", default="memories")
|
|
23
|
+
p_sync.add_argument("-n", "--limit", type=int, default=20)
|
|
24
|
+
|
|
25
|
+
args = parser.parse_args()
|
|
26
|
+
client = LocketClient()
|
|
27
|
+
|
|
28
|
+
if args.command == "login":
|
|
29
|
+
res = client.login(args.email, args.password)
|
|
30
|
+
print(f"Logged in: {res.get('email', 'OK')}")
|
|
31
|
+
elif args.command == "status":
|
|
32
|
+
print("Authenticated" if client.is_authenticated() else "Unauthenticated")
|
|
33
|
+
elif args.command == "post":
|
|
34
|
+
res = client.moments.post_moment(args.image, caption=args.caption)
|
|
35
|
+
print("Posted:", res)
|
|
36
|
+
elif args.command == "sync":
|
|
37
|
+
files = client.moments.sync_feed(output_dir=args.out, limit=args.limit)
|
|
38
|
+
print(f"Synced {len(files)} files to {args.out}")
|
|
39
|
+
|
|
40
|
+
if __name__ == "__main__":
|
|
41
|
+
main()
|