anvpy 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.
anvpy-0.1.0/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ajay, Amar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
anvpy-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: anvpy
3
+ Version: 0.1.0
4
+ Summary: Official CLI for AnvPy to sync and run Python projects on Android.
5
+ Author-email: Amar <techanvpy@gmail.com>, Ajay <ajay@vissora.cloud>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/anvlabs/anvpy-cli
8
+ Project-URL: Repository, https://github.com/anvlabs/anvpy-cli
9
+ Project-URL: Issues, https://github.com/anvlabs/anvpy-cli/issues
10
+ Keywords: python,android,cli,development,sync
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: Software Development :: Build Tools
25
+ Classifier: Topic :: Utilities
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: requests
30
+ Dynamic: license-file
31
+
32
+ # AnvPy CLI
33
+
34
+ **AnvPy CLI** is the official command-line interface for **AnvPy (Android Versatile Python)**, a platform that enables developers to build and run Python applications on Android.
35
+
36
+ The CLI provides a seamless desktop development workflow by synchronizing your project from your computer to your Android device and launching it directly in the AnvPy application with a single command.
37
+
38
+ ---
39
+
40
+ ## Features
41
+
42
+ * One command project synchronization and execution
43
+ * Automatic device discovery on the local network
44
+ * Incremental synchronization using file hashing
45
+ * Simple setup with automatic connection management
46
+
47
+ ---
48
+
49
+ ## Requirements
50
+
51
+ * Python 3.8 or later
52
+ * AnvPy installed on an Android device
53
+ * Computer and Android device connected to the same local network (same Wi-Fi network or mobile hotspot)
54
+
55
+ ---
56
+
57
+ # Installation
58
+
59
+ Install directly from PyPI:
60
+
61
+ ```bash
62
+ pip install anvpy
63
+ ```
64
+
65
+ ---
66
+
67
+ # Quick Start
68
+
69
+ Navigate to your project directory containing `main.py`:
70
+
71
+ ```bash
72
+ cd MyProject
73
+ ```
74
+
75
+ Run the project:
76
+
77
+ ```bash
78
+ anvpy run
79
+ ```
80
+
81
+ Or specify a project path:
82
+
83
+ ```bash
84
+ anvpy run --path="C:\Projects\MyProject"
85
+ ```
86
+
87
+ ---
88
+
89
+ # Project Structure
90
+
91
+ AnvPy expects your project to contain a `main.py` entry point.
92
+
93
+ Example:
94
+
95
+ ```text
96
+ MyProject/
97
+ ├── main.py
98
+ ├── assets/
99
+ ├── images/
100
+ ├── data/
101
+ └── ...
102
+ ```
103
+
104
+ ---
105
+
106
+ # How It Works
107
+
108
+ When you execute:
109
+
110
+ ```bash
111
+ anvpy run
112
+ ```
113
+
114
+ the CLI automatically:
115
+
116
+ 1. Detects the project directory.
117
+ 2. Verifies that `main.py` exists.
118
+ 3. Connects to the AnvPy application running on your Android device.
119
+ 4. Synchronizes only the files that have changed.
120
+ 5. Removes files deleted from the Android project.
121
+ 6. Launches the synchronized project automatically on the device.
122
+
123
+ ---
124
+
125
+ # Example Output
126
+
127
+ ```text
128
+ [ACTION] Connecting to device...
129
+ [OK] Connected to 192.168.1.5
130
+
131
+ [ACTION] Syncing project: MyProject
132
+ [OK] Uploaded: main.py
133
+ [OK] Uploaded: assets/logo.png
134
+ [OK] Deleted: assets/old_logo.png
135
+
136
+ [OK] Sync complete (Uploaded: 2, Deleted: 1)
137
+
138
+ [ACTION] Running project: MyProject
139
+ [OK] Project started
140
+ ```
141
+
142
+ ---
143
+
144
+ # Why AnvPy CLI?
145
+
146
+ Developing for Android often involves repetitive deployment steps such as manually copying project files, connecting a USB cable, configuring ADB, or setting up custom synchronization workflows before every test.
147
+
148
+ AnvPy CLI eliminates these repetitive tasks by automatically discovering your Android device, synchronizing only modified files, and launching your project with a single command over your local network. This significantly reduces iteration time, allowing you to focus on building your application instead of managing deployment.
149
+
150
+ ---
151
+
152
+ # License
153
+
154
+ This project is licensed under the MIT License.
anvpy-0.1.0/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # AnvPy CLI
2
+
3
+ **AnvPy CLI** is the official command-line interface for **AnvPy (Android Versatile Python)**, a platform that enables developers to build and run Python applications on Android.
4
+
5
+ The CLI provides a seamless desktop development workflow by synchronizing your project from your computer to your Android device and launching it directly in the AnvPy application with a single command.
6
+
7
+ ---
8
+
9
+ ## Features
10
+
11
+ * One command project synchronization and execution
12
+ * Automatic device discovery on the local network
13
+ * Incremental synchronization using file hashing
14
+ * Simple setup with automatic connection management
15
+
16
+ ---
17
+
18
+ ## Requirements
19
+
20
+ * Python 3.8 or later
21
+ * AnvPy installed on an Android device
22
+ * Computer and Android device connected to the same local network (same Wi-Fi network or mobile hotspot)
23
+
24
+ ---
25
+
26
+ # Installation
27
+
28
+ Install directly from PyPI:
29
+
30
+ ```bash
31
+ pip install anvpy
32
+ ```
33
+
34
+ ---
35
+
36
+ # Quick Start
37
+
38
+ Navigate to your project directory containing `main.py`:
39
+
40
+ ```bash
41
+ cd MyProject
42
+ ```
43
+
44
+ Run the project:
45
+
46
+ ```bash
47
+ anvpy run
48
+ ```
49
+
50
+ Or specify a project path:
51
+
52
+ ```bash
53
+ anvpy run --path="C:\Projects\MyProject"
54
+ ```
55
+
56
+ ---
57
+
58
+ # Project Structure
59
+
60
+ AnvPy expects your project to contain a `main.py` entry point.
61
+
62
+ Example:
63
+
64
+ ```text
65
+ MyProject/
66
+ ├── main.py
67
+ ├── assets/
68
+ ├── images/
69
+ ├── data/
70
+ └── ...
71
+ ```
72
+
73
+ ---
74
+
75
+ # How It Works
76
+
77
+ When you execute:
78
+
79
+ ```bash
80
+ anvpy run
81
+ ```
82
+
83
+ the CLI automatically:
84
+
85
+ 1. Detects the project directory.
86
+ 2. Verifies that `main.py` exists.
87
+ 3. Connects to the AnvPy application running on your Android device.
88
+ 4. Synchronizes only the files that have changed.
89
+ 5. Removes files deleted from the Android project.
90
+ 6. Launches the synchronized project automatically on the device.
91
+
92
+ ---
93
+
94
+ # Example Output
95
+
96
+ ```text
97
+ [ACTION] Connecting to device...
98
+ [OK] Connected to 192.168.1.5
99
+
100
+ [ACTION] Syncing project: MyProject
101
+ [OK] Uploaded: main.py
102
+ [OK] Uploaded: assets/logo.png
103
+ [OK] Deleted: assets/old_logo.png
104
+
105
+ [OK] Sync complete (Uploaded: 2, Deleted: 1)
106
+
107
+ [ACTION] Running project: MyProject
108
+ [OK] Project started
109
+ ```
110
+
111
+ ---
112
+
113
+ # Why AnvPy CLI?
114
+
115
+ Developing for Android often involves repetitive deployment steps such as manually copying project files, connecting a USB cable, configuring ADB, or setting up custom synchronization workflows before every test.
116
+
117
+ AnvPy CLI eliminates these repetitive tasks by automatically discovering your Android device, synchronizing only modified files, and launching your project with a single command over your local network. This significantly reduces iteration time, allowing you to focus on building your application instead of managing deployment.
118
+
119
+ ---
120
+
121
+ # License
122
+
123
+ This project is licensed under the MIT License.
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,135 @@
1
+ import requests
2
+ import json
3
+ import socket
4
+ import threading
5
+ import os
6
+
7
+ from anvpy.logger import *
8
+
9
+
10
+ CONFIG_DIR = os.path.join(
11
+ os.path.expanduser("~"),
12
+ ".anvpy"
13
+ )
14
+
15
+ CONFIG_FILE = os.path.join(
16
+ CONFIG_DIR,
17
+ "connection.json"
18
+ )
19
+
20
+ def get_ip():
21
+
22
+ try:
23
+ with open(CONFIG_FILE) as f:
24
+ data = json.load(f)
25
+
26
+ return data.get("ip")
27
+
28
+ except:
29
+ return None
30
+
31
+ def save_ip(ip):
32
+
33
+ os.makedirs(
34
+ CONFIG_DIR,
35
+ exist_ok=True
36
+ )
37
+
38
+ with open(CONFIG_FILE, "w") as f:
39
+ json.dump({
40
+ "ip": ip
41
+ }, f)
42
+
43
+ def is_phone(ip):
44
+
45
+ try:
46
+ r = requests.get(
47
+ f"http://{ip}:5000/ping",
48
+ timeout=1
49
+ )
50
+
51
+ data = r.json()
52
+
53
+ return (
54
+ data.get("status") == "ok" and
55
+ data.get("service") == "anvpy"
56
+ )
57
+
58
+ except:
59
+ return False
60
+
61
+ def scan_network():
62
+
63
+ local_ip = socket.gethostbyname(
64
+ socket.gethostname()
65
+ )
66
+
67
+ subnet = ".".join(
68
+ local_ip.split(".")[:-1]
69
+ )
70
+
71
+ found_ip = None
72
+
73
+ def check(ip):
74
+ nonlocal found_ip
75
+
76
+ if found_ip:
77
+ return
78
+
79
+ if is_phone(ip):
80
+ found_ip = ip
81
+
82
+ threads = []
83
+
84
+ for i in range(1, 255):
85
+
86
+ ip = f"{subnet}.{i}"
87
+
88
+ t = threading.Thread(
89
+ target=check,
90
+ args=(ip,)
91
+ )
92
+
93
+ t.start()
94
+ threads.append(t)
95
+
96
+ for t in threads:
97
+ t.join()
98
+
99
+ return found_ip
100
+
101
+ def connect(ip=None, verbose=True):
102
+
103
+ if ip is None:
104
+ ip = get_ip()
105
+
106
+ if ip and is_phone(ip):
107
+
108
+ save_ip(ip)
109
+
110
+ if verbose:
111
+ log_ok(f"Connected to {ip}")
112
+
113
+ return ip
114
+
115
+
116
+ if ip:
117
+ log_warn(
118
+ f"Saved IP {ip} unavailable"
119
+ )
120
+
121
+ log_action("Searching for device...")
122
+
123
+ found_ip = scan_network()
124
+
125
+ if found_ip:
126
+
127
+ save_ip(found_ip)
128
+
129
+ log_ok(f"Connected to {found_ip}")
130
+
131
+ return found_ip
132
+
133
+ log_error("No device found")
134
+
135
+ return None
@@ -0,0 +1,27 @@
1
+ class Color:
2
+ RESET = "\033[0m"
3
+ BLUE = "\033[94m"
4
+ GREEN = "\033[38;5;46m"
5
+ YELLOW = "\033[93m"
6
+ RED = "\033[91m"
7
+ CYAN = "\033[96m"
8
+
9
+
10
+ def log_info(msg):
11
+ print(f"{Color.BLUE}[INFO]{Color.RESET} {msg}")
12
+
13
+
14
+ def log_ok(msg):
15
+ print(f"{Color.GREEN}[OK]{Color.RESET} {msg}")
16
+
17
+
18
+ def log_warn(msg):
19
+ print(f"{Color.YELLOW}[WARN]{Color.RESET} {msg}")
20
+
21
+
22
+ def log_error(msg):
23
+ print(f"{Color.RED}[ERROR]{Color.RESET} {msg}")
24
+
25
+
26
+ def log_action(msg):
27
+ print(f"{Color.CYAN}[ACTION]{Color.RESET} {msg}")
@@ -0,0 +1,47 @@
1
+ import argparse
2
+ import os
3
+ from anvpy.sync import sync
4
+ from anvpy.logger import *
5
+
6
+
7
+ def main():
8
+
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument(
11
+ "command",
12
+ choices=["run"]
13
+ )
14
+ parser.add_argument("--path")
15
+
16
+ args = parser.parse_args()
17
+
18
+ if args.path:
19
+ project_path = args.path
20
+ else:
21
+ project_path = os.getcwd()
22
+
23
+
24
+ if args.command == "run":
25
+
26
+ if not os.path.isdir(project_path):
27
+
28
+ log_error(
29
+ f'Project folder not found: "{project_path}"'
30
+ )
31
+
32
+ return
33
+
34
+ main_file = os.path.join(
35
+ project_path,
36
+ "main.py"
37
+ )
38
+
39
+ if not os.path.isfile(main_file):
40
+
41
+ log_error(
42
+ "main.py not found"
43
+ )
44
+
45
+ return
46
+
47
+ sync(project_path)
@@ -0,0 +1,42 @@
1
+ import requests
2
+ from anvpy.logger import *
3
+
4
+ def run_project(ip, project):
5
+
6
+ try:
7
+
8
+ log_action(
9
+ f"Running project: {project}"
10
+ )
11
+
12
+ response = requests.post(
13
+ f"http://{ip}:5000/run",
14
+ json={
15
+ "project": project
16
+ },
17
+ timeout=10
18
+ )
19
+
20
+ data = response.json()
21
+
22
+ if response.status_code != 200:
23
+
24
+ log_error(
25
+ f"Failed to run project: {project}"
26
+ )
27
+
28
+ return None
29
+
30
+ log_ok(
31
+ f"Project started: {project}"
32
+ )
33
+
34
+ return data
35
+
36
+ except Exception:
37
+
38
+ log_error(
39
+ f"Failed to contact device"
40
+ )
41
+
42
+ return None
@@ -0,0 +1,228 @@
1
+ import requests
2
+ import os
3
+
4
+ from anvpy.logger import *
5
+ from anvpy.utils import *
6
+ from anvpy.connection import *
7
+ from anvpy.run import *
8
+
9
+ def compute_diff(local_state, phone_state):
10
+
11
+ to_upload = []
12
+ to_delete = []
13
+
14
+ for path, hash_value in local_state.items():
15
+
16
+ if path not in phone_state:
17
+ to_upload.append(path)
18
+
19
+ elif phone_state[path] != hash_value:
20
+ to_upload.append(path)
21
+
22
+ for path in phone_state:
23
+
24
+ if path not in local_state:
25
+ to_delete.append(path)
26
+
27
+ return to_upload, to_delete
28
+
29
+ def delete_files(ip, project, files):
30
+
31
+ try:
32
+
33
+ response = requests.post(
34
+ f"http://{ip}:5000/delete",
35
+ json={
36
+ "project": project,
37
+ "files": files
38
+ },
39
+ timeout=10
40
+ )
41
+
42
+ if response.status_code != 200:
43
+ return False
44
+
45
+ return True
46
+
47
+ except Exception:
48
+
49
+ return False
50
+
51
+ def get_phone_state(ip, project):
52
+
53
+ try:
54
+ response = requests.get(
55
+ f"http://{ip}:5000/file_state",
56
+ params={
57
+ "project": project
58
+ },
59
+ timeout=5
60
+ )
61
+
62
+ if response.status_code != 200:
63
+
64
+ log_error("Failed to get phone state")
65
+
66
+ return None
67
+
68
+ return response.json()
69
+
70
+ except Exception as e:
71
+
72
+ log_error("Failed to get phone state")
73
+
74
+ return None
75
+
76
+ def upload_file(ip, project, folder, rel_path):
77
+
78
+ full_path = os.path.join(
79
+ folder,
80
+ rel_path
81
+ )
82
+
83
+ try:
84
+
85
+ with open(full_path, "rb") as f:
86
+
87
+ files = {
88
+ "file": f
89
+ }
90
+
91
+ data = {
92
+ "project": project,
93
+ "path": rel_path
94
+ }
95
+
96
+ response = requests.post(
97
+ f"http://{ip}:5000/upload",
98
+ files=files,
99
+ data=data,
100
+ timeout=30
101
+ )
102
+
103
+ data = response.json()
104
+
105
+ if response.status_code != 200:
106
+
107
+ log_error(
108
+ f"Upload failed: {rel_path}"
109
+ )
110
+
111
+ return None
112
+
113
+ return data
114
+
115
+ except Exception:
116
+
117
+ log_error(
118
+ f"Failed: {rel_path}"
119
+ )
120
+
121
+ return None
122
+
123
+ def scan_files(folder):
124
+
125
+ files = {}
126
+
127
+ for root, dirs, filenames in os.walk(folder):
128
+
129
+ for filename in filenames:
130
+
131
+ full_path = os.path.join(root, filename)
132
+
133
+ rel_path = os.path.relpath(
134
+ full_path,
135
+ folder
136
+ ).replace("\\", "/")
137
+
138
+ files[rel_path] = get_file_hash(
139
+ full_path
140
+ )
141
+
142
+ return files
143
+
144
+ def sync(folder, run_after=True):
145
+
146
+ ip = connect(verbose=False)
147
+
148
+ if not ip:
149
+ log_error("Phone not found")
150
+ return
151
+
152
+ project = os.path.basename(
153
+ os.path.abspath(folder)
154
+ )
155
+
156
+ log_action(
157
+ f"Syncing project: {project}"
158
+ )
159
+
160
+ local_state = scan_files(folder)
161
+
162
+ phone_state = get_phone_state(
163
+ ip,
164
+ project
165
+ )
166
+
167
+ if phone_state is None:
168
+ log_error("Connection lost")
169
+ return
170
+
171
+ to_upload, to_delete = compute_diff(
172
+ local_state,
173
+ phone_state
174
+ )
175
+
176
+ if to_upload:
177
+
178
+ log_action(
179
+ f"Uploading {len(to_upload)} files"
180
+ )
181
+
182
+ if to_delete:
183
+
184
+ log_action(
185
+ f"Deleting {len(to_delete)} files"
186
+ )
187
+
188
+ for file in to_upload:
189
+
190
+ result = upload_file(
191
+ ip,
192
+ project,
193
+ folder,
194
+ file
195
+ )
196
+
197
+ if result:
198
+ log_ok(f"Uploaded: {file}")
199
+
200
+ if to_delete:
201
+
202
+ result = delete_files(
203
+ ip,
204
+ project,
205
+ to_delete
206
+ )
207
+
208
+ if result:
209
+
210
+ for file in to_delete:
211
+ log_ok(f"Deleted: {file}")
212
+
213
+ else:
214
+
215
+ log_error("Delete failed")
216
+
217
+ log_ok(
218
+ f"Sync complete "
219
+ f"(Uploaded: {len(to_upload)}, "
220
+ f"Deleted: {len(to_delete)})"
221
+ )
222
+
223
+ if run_after:
224
+
225
+ run_project(
226
+ ip,
227
+ project
228
+ )
@@ -0,0 +1,15 @@
1
+ import hashlib
2
+
3
+ def get_file_hash(path):
4
+
5
+ md5 = hashlib.md5()
6
+
7
+ with open(path, "rb") as f:
8
+
9
+ for chunk in iter(
10
+ lambda: f.read(4096),
11
+ b""
12
+ ):
13
+ md5.update(chunk)
14
+
15
+ return md5.hexdigest()
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: anvpy
3
+ Version: 0.1.0
4
+ Summary: Official CLI for AnvPy to sync and run Python projects on Android.
5
+ Author-email: Amar <techanvpy@gmail.com>, Ajay <ajay@vissora.cloud>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/anvlabs/anvpy-cli
8
+ Project-URL: Repository, https://github.com/anvlabs/anvpy-cli
9
+ Project-URL: Issues, https://github.com/anvlabs/anvpy-cli/issues
10
+ Keywords: python,android,cli,development,sync
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: Software Development :: Build Tools
25
+ Classifier: Topic :: Utilities
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: requests
30
+ Dynamic: license-file
31
+
32
+ # AnvPy CLI
33
+
34
+ **AnvPy CLI** is the official command-line interface for **AnvPy (Android Versatile Python)**, a platform that enables developers to build and run Python applications on Android.
35
+
36
+ The CLI provides a seamless desktop development workflow by synchronizing your project from your computer to your Android device and launching it directly in the AnvPy application with a single command.
37
+
38
+ ---
39
+
40
+ ## Features
41
+
42
+ * One command project synchronization and execution
43
+ * Automatic device discovery on the local network
44
+ * Incremental synchronization using file hashing
45
+ * Simple setup with automatic connection management
46
+
47
+ ---
48
+
49
+ ## Requirements
50
+
51
+ * Python 3.8 or later
52
+ * AnvPy installed on an Android device
53
+ * Computer and Android device connected to the same local network (same Wi-Fi network or mobile hotspot)
54
+
55
+ ---
56
+
57
+ # Installation
58
+
59
+ Install directly from PyPI:
60
+
61
+ ```bash
62
+ pip install anvpy
63
+ ```
64
+
65
+ ---
66
+
67
+ # Quick Start
68
+
69
+ Navigate to your project directory containing `main.py`:
70
+
71
+ ```bash
72
+ cd MyProject
73
+ ```
74
+
75
+ Run the project:
76
+
77
+ ```bash
78
+ anvpy run
79
+ ```
80
+
81
+ Or specify a project path:
82
+
83
+ ```bash
84
+ anvpy run --path="C:\Projects\MyProject"
85
+ ```
86
+
87
+ ---
88
+
89
+ # Project Structure
90
+
91
+ AnvPy expects your project to contain a `main.py` entry point.
92
+
93
+ Example:
94
+
95
+ ```text
96
+ MyProject/
97
+ ├── main.py
98
+ ├── assets/
99
+ ├── images/
100
+ ├── data/
101
+ └── ...
102
+ ```
103
+
104
+ ---
105
+
106
+ # How It Works
107
+
108
+ When you execute:
109
+
110
+ ```bash
111
+ anvpy run
112
+ ```
113
+
114
+ the CLI automatically:
115
+
116
+ 1. Detects the project directory.
117
+ 2. Verifies that `main.py` exists.
118
+ 3. Connects to the AnvPy application running on your Android device.
119
+ 4. Synchronizes only the files that have changed.
120
+ 5. Removes files deleted from the Android project.
121
+ 6. Launches the synchronized project automatically on the device.
122
+
123
+ ---
124
+
125
+ # Example Output
126
+
127
+ ```text
128
+ [ACTION] Connecting to device...
129
+ [OK] Connected to 192.168.1.5
130
+
131
+ [ACTION] Syncing project: MyProject
132
+ [OK] Uploaded: main.py
133
+ [OK] Uploaded: assets/logo.png
134
+ [OK] Deleted: assets/old_logo.png
135
+
136
+ [OK] Sync complete (Uploaded: 2, Deleted: 1)
137
+
138
+ [ACTION] Running project: MyProject
139
+ [OK] Project started
140
+ ```
141
+
142
+ ---
143
+
144
+ # Why AnvPy CLI?
145
+
146
+ Developing for Android often involves repetitive deployment steps such as manually copying project files, connecting a USB cable, configuring ADB, or setting up custom synchronization workflows before every test.
147
+
148
+ AnvPy CLI eliminates these repetitive tasks by automatically discovering your Android device, synchronizing only modified files, and launching your project with a single command over your local network. This significantly reduces iteration time, allowing you to focus on building your application instead of managing deployment.
149
+
150
+ ---
151
+
152
+ # License
153
+
154
+ This project is licensed under the MIT License.
@@ -0,0 +1,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ anvpy/__init__.py
5
+ anvpy/connection.py
6
+ anvpy/logger.py
7
+ anvpy/main.py
8
+ anvpy/run.py
9
+ anvpy/sync.py
10
+ anvpy/utils.py
11
+ anvpy.egg-info/PKG-INFO
12
+ anvpy.egg-info/SOURCES.txt
13
+ anvpy.egg-info/dependency_links.txt
14
+ anvpy.egg-info/entry_points.txt
15
+ anvpy.egg-info/requires.txt
16
+ anvpy.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ anvpy = anvpy.main:main
@@ -0,0 +1 @@
1
+ requests
@@ -0,0 +1 @@
1
+ anvpy
@@ -0,0 +1,54 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "anvpy"
7
+ version = "0.1.0"
8
+ description = "Official CLI for AnvPy to sync and run Python projects on Android."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = "MIT"
12
+
13
+ authors = [
14
+ { name = "Amar", email = "techanvpy@gmail.com" },
15
+ { name = "Ajay", email = "ajay@vissora.cloud" }
16
+ ]
17
+
18
+ keywords = [
19
+ "python",
20
+ "android",
21
+ "cli",
22
+ "development",
23
+ "sync"
24
+ ]
25
+
26
+ dependencies = [
27
+ "requests"
28
+ ]
29
+
30
+ classifiers = [
31
+ "Development Status :: 3 - Alpha",
32
+ "Environment :: Console",
33
+ "Intended Audience :: Developers",
34
+ "Operating System :: OS Independent",
35
+ "Programming Language :: Python :: 3",
36
+ "Programming Language :: Python :: 3.8",
37
+ "Programming Language :: Python :: 3.9",
38
+ "Programming Language :: Python :: 3.10",
39
+ "Programming Language :: Python :: 3.11",
40
+ "Programming Language :: Python :: 3.12",
41
+ "Programming Language :: Python :: 3.13",
42
+ "Programming Language :: Python :: 3.14",
43
+ "Topic :: Software Development",
44
+ "Topic :: Software Development :: Build Tools",
45
+ "Topic :: Utilities"
46
+ ]
47
+
48
+ [project.scripts]
49
+ anvpy = "anvpy.main:main"
50
+
51
+ [project.urls]
52
+ Homepage = "https://github.com/anvlabs/anvpy-cli"
53
+ Repository = "https://github.com/anvlabs/anvpy-cli"
54
+ Issues = "https://github.com/anvlabs/anvpy-cli/issues"
anvpy-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+