cnhkmcp 1.4.3__py3-none-any.whl → 1.4.5__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.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/forum_functions.py +407 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +2415 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/user_config.json +31 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/210/320/276/320/271AI/321/210/320/277/342/225/227/321/210/342/224/220/320/251/321/204/342/225/225/320/272/321/206/320/246/320/227/321/206/320/261/320/263/321/206/320/255/320/265/321/205/320/275/320/266/321/204/342/225/235/320/252/321/204/342/225/225/320/233/321/210/342/225/234/342/225/234/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270.md +93 -0
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/METADATA +1 -1
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/RECORD +11 -7
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/WHEEL +0 -0
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-1.4.3.dist-info → cnhkmcp-1.4.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"credentials": {
|
|
3
|
+
"email": "youremail@mai.com",
|
|
4
|
+
"password": "yourpassword"
|
|
5
|
+
},
|
|
6
|
+
"api_settings": {
|
|
7
|
+
"base_url": "https://api.worldquantbrain.com",
|
|
8
|
+
"timeout": 30,
|
|
9
|
+
"retry_attempts": 3
|
|
10
|
+
},
|
|
11
|
+
"forum_settings": {
|
|
12
|
+
"base_url": "https://support.worldquantbrain.com",
|
|
13
|
+
"headless": true,
|
|
14
|
+
"timeout": 30
|
|
15
|
+
},
|
|
16
|
+
"simulation_defaults": {
|
|
17
|
+
"type": "REGULAR",
|
|
18
|
+
"instrument_type": "EQUITY",
|
|
19
|
+
"region": "USA",
|
|
20
|
+
"universe": "TOP3000",
|
|
21
|
+
"delay": 1,
|
|
22
|
+
"decay": 0,
|
|
23
|
+
"neutralization": "NONE",
|
|
24
|
+
"truncation": 0,
|
|
25
|
+
"test_period": "P0Y0M",
|
|
26
|
+
"unit_handling": "NONE",
|
|
27
|
+
"nan_handling": "NONE",
|
|
28
|
+
"language": "FASTEXPR",
|
|
29
|
+
"visualization": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Guide: Setting Up Playwright with a Local Chrome Executable
|
|
2
|
+
|
|
3
|
+
This guide explains how to configure Playwright to use a locally extracted Google Chrome browser. This is useful in environments where you don't have `sudo` permissions to install Chrome or its dependencies system-wide.
|
|
4
|
+
|
|
5
|
+
## The Problem
|
|
6
|
+
|
|
7
|
+
When running a Playwright script, you might encounter an error like this:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
playwright._impl._errors.Error: BrowserType.launch: Executable doesn't exist at ...
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This means Playwright cannot find the Chrome browser executable in its default search paths.
|
|
14
|
+
|
|
15
|
+
## The Solution: Local Extraction
|
|
16
|
+
|
|
17
|
+
The solution is to download the Chrome `.deb` package, extract the executable, and then point your Playwright script to it.
|
|
18
|
+
|
|
19
|
+
### Step 1: Download the Chrome `.deb` Package
|
|
20
|
+
|
|
21
|
+
You can download the latest stable version of Google Chrome for Debian/Ubuntu-based systems using `wget`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Step 2: Extract the Executable
|
|
28
|
+
|
|
29
|
+
Once you have the `.deb` file, you can extract its contents without installing it.
|
|
30
|
+
|
|
31
|
+
1. **Extract the `.deb` archive:** The `ar` command extracts the contents of the `.deb` file.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ar x google-chrome-stable_current_amd64.deb
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will create several files, including `data.tar.xz`.
|
|
38
|
+
|
|
39
|
+
2. **Extract the data archive:** The `data.tar.xz` file contains the actual program files.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
tar -xf data.tar.xz
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This will create an `opt` directory in your current location.
|
|
46
|
+
|
|
47
|
+
### Step 3: Locate the Chrome Executable
|
|
48
|
+
|
|
49
|
+
The Chrome executable is now located at `./opt/google/chrome/chrome`.
|
|
50
|
+
|
|
51
|
+
### Step 4: Configure Your Playwright Script
|
|
52
|
+
|
|
53
|
+
In your Python script forum_functions.py, you need to tell Playwright where to find the Chrome executable by using the `executable_path` argument when launching the browser.
|
|
54
|
+
|
|
55
|
+
It is best practice to use an **absolute path** to avoid issues with the script's working directory. You can construct the absolute path by combining your project's root directory with the relative path to the executable.
|
|
56
|
+
|
|
57
|
+
Here is an example:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import os
|
|
61
|
+
from playwright.async_api import async_playwright
|
|
62
|
+
import asyncio
|
|
63
|
+
|
|
64
|
+
async def main():
|
|
65
|
+
# Get the absolute path to the executable
|
|
66
|
+
project_dir = os.getcwd() # Or specify your project's absolute path
|
|
67
|
+
executable_path = os.path.join(project_dir, 'opt/google/chrome/chrome')
|
|
68
|
+
|
|
69
|
+
async with async_playwright() as p:
|
|
70
|
+
browser = await p.chromium.launch(
|
|
71
|
+
executable_path=executable_path,
|
|
72
|
+
args=['--headless=new', '--no-sandbox']
|
|
73
|
+
)
|
|
74
|
+
page = await browser.new_page()
|
|
75
|
+
await page.goto('http://playwright.dev')
|
|
76
|
+
print(await page.title())
|
|
77
|
+
await browser.close()
|
|
78
|
+
|
|
79
|
+
if __name__ == '__main__':
|
|
80
|
+
asyncio.run(main())
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
By providing the absolute `executable_path`, you are explicitly telling Playwright where to find the browser, making your script more robust.
|
|
84
|
+
|
|
85
|
+
## Alternative: `playwright install`
|
|
86
|
+
|
|
87
|
+
If you have `sudo` permissions, the recommended way to install the browsers for Playwright is to use the following command:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
playwright install --with-deps
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This will download the browser and also install all the necessary system dependencies.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
cnhkmcp/__init__.py,sha256=
|
|
1
|
+
cnhkmcp/__init__.py,sha256=wNGzv13TrAG6QlTCdS5GjNJFVq8a_KtprXsjJGzMelQ,2758
|
|
2
2
|
cnhkmcp/untracked/arXiv_API_Tool_Manual.md,sha256=I3hvI5mpmIjBuWptufoVSWFnuhyUc67oCGHEuR0p_xs,13552
|
|
3
3
|
cnhkmcp/untracked/arxiv_api.py,sha256=-E-Ub9K-DXAYaCjrbobyfQ9H97gaZBc7pL6xPEyVHec,9020
|
|
4
4
|
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
@@ -60,9 +60,13 @@ cnhkmcp/untracked/APP/templates/inspiration_house.html,sha256=CZMHj_ild-mUDRvNc5
|
|
|
60
60
|
cnhkmcp/untracked/APP/templates/paper_analysis.html,sha256=7HgltBpZtmZCYCF7JU4wU9F5NMxUKyCXg7bCYCRfQDs,4139
|
|
61
61
|
cnhkmcp/untracked/APP/templates/simulator.html,sha256=Y3-w-mZyvRiOdBiFe705CqBPAUI07KNY2WJ5meNzHM8,12508
|
|
62
62
|
cnhkmcp/untracked/__pycache__/forum_functions.cpython-313.pyc,sha256=agARlP2x36scUU0TIYnrHB3EpEx4OOuHrB42_B1XR3k,45049
|
|
63
|
-
cnhkmcp
|
|
64
|
-
cnhkmcp
|
|
65
|
-
cnhkmcp
|
|
66
|
-
cnhkmcp
|
|
67
|
-
cnhkmcp-1.4.
|
|
68
|
-
cnhkmcp-1.4.
|
|
63
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/forum_functions.py,sha256=sm2Vqi7Dq0plbXNvMC2_Y0qOFAR3jBhQ4KDLJfMDH6s,19026
|
|
64
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/platform_functions.py,sha256=aa5jCRjCORFars8CVahqwbk5ni0mLYWu9yND7Z4TGUM,99159
|
|
65
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
66
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/让AI读这个文档来学会下载浏览器.md,sha256=AQsW5HNmuQ2XCl7bY1lVp1mCXuKOjoNtmLuXJyoS_oQ,3234
|
|
67
|
+
cnhkmcp-1.4.5.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
68
|
+
cnhkmcp-1.4.5.dist-info/METADATA,sha256=Wl69HrG15TqjZuDvuygpwAY0-7L_CanfcYhn6OPk6GA,5171
|
|
69
|
+
cnhkmcp-1.4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
70
|
+
cnhkmcp-1.4.5.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
71
|
+
cnhkmcp-1.4.5.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
72
|
+
cnhkmcp-1.4.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|