po-lang-engine 1.0.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,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: po-lang-engine
3
+ Version: 1.0.0
4
+ Requires-Dist: requests
5
+ Dynamic: requires-dist
@@ -0,0 +1,3 @@
1
+ # Po-Lang
2
+ A cloud-based package manager. Install with `pip install po-lang`.
3
+ Usage: `pop get <package_name>`
@@ -0,0 +1,46 @@
1
+ import os
2
+ import sys
3
+ import urllib.request
4
+ import requests
5
+
6
+ SUPABASE_URL = "https://bnwpmwufxbdnlcgbuhwi.supabase.co"
7
+ SUPABASE_API_KEY = "sb_publishable_wD9PusMz74qxK2AWRc8Jug_2aMqUAuD"
8
+
9
+ def run_po_engine(file_path):
10
+ if not file_path.endswith('.po'): return
11
+ variables = {}
12
+ try:
13
+ with open(file_path, 'r') as file:
14
+ for line in file:
15
+ line = line.strip()
16
+ if not line or line.startswith('#'): continue
17
+ if line.startswith('keep'):
18
+ expr = line.replace('keep', '').strip()
19
+ if '=' in expr:
20
+ k, v = expr.split('=', 1)
21
+ variables[k.strip()] = v.strip().strip('"').strip("'")
22
+ elif line.startswith('show'):
23
+ target = line.replace('show', '').strip()
24
+ print(variables.get(target, target.strip('"').strip("'")))
25
+ except Exception: pass
26
+
27
+ def run_pop_manager(package_name):
28
+ headers = {"apikey": SUPABASE_API_KEY, "Authorization": f"Bearer {SUPABASE_API_KEY}"}
29
+ endpoint = f"{SUPABASE_URL}/rest/v1/packages?name=eq.{package_name}"
30
+ target = os.path.join(os.getcwd(), f"{package_name}.po")
31
+ try:
32
+ resp = requests.get(endpoint, headers=headers)
33
+ if resp.status_code == 200 and resp.json():
34
+ url = resp.json()[0].get('download_url')
35
+ urllib.request.urlretrieve(url, target)
36
+ print(f"Package '{package_name}' installed.")
37
+ run_po_engine(target)
38
+ except Exception: print("Connection Error")
39
+
40
+ def main():
41
+ args = sys.argv[1:]
42
+ if len(args) >= 2 and args[0] == "get": run_pop_manager(args[1])
43
+ else: print("Usage: pop get <package_name>")
44
+
45
+ if __name__ == "__main__":
46
+ main()
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: po-lang-engine
3
+ Version: 1.0.0
4
+ Requires-Dist: requests
5
+ Dynamic: requires-dist
@@ -0,0 +1,9 @@
1
+ README.md
2
+ po_engine.py
3
+ setup.py
4
+ po_lang_engine.egg-info/PKG-INFO
5
+ po_lang_engine.egg-info/SOURCES.txt
6
+ po_lang_engine.egg-info/dependency_links.txt
7
+ po_lang_engine.egg-info/entry_points.txt
8
+ po_lang_engine.egg-info/requires.txt
9
+ po_lang_engine.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pop = po_engine:main
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,13 @@
1
+ from setuptools import setup
2
+
3
+ setup(
4
+ name="po-lang-engine",
5
+ version="1.0.0",
6
+ py_modules=["po_engine"],
7
+ install_requires=["requests"],
8
+ entry_points={
9
+ 'console_scripts': [
10
+ 'pop=po_engine:main',
11
+ ],
12
+ },
13
+ )