-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ZihengSun/pygeoweaver
- Loading branch information
Showing
12 changed files
with
209 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import requests | ||
from . import constants | ||
import pandas as pd | ||
|
||
|
||
def get_process_by_name(process_name): | ||
response = requests.post( | ||
f"{constants.GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/list", data={"type": "process"} | ||
) | ||
process_list = response.json() | ||
|
||
matching_processes = [] | ||
|
||
for process in process_list: | ||
if process["name"] == process_name: | ||
matching_processes.append(process) | ||
pd.set_option("display.max_columns", None) # Display all columns | ||
pd.set_option("display.max_rows", None) # Display all rows | ||
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns | ||
pd.DataFrame(matching_processes) | ||
|
||
|
||
def get_process_by_id(process_id): | ||
response = requests.post( | ||
f"{constants.GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/list", data={"type": "process"} | ||
) | ||
process_list = response.json() | ||
|
||
matching_processes = [] | ||
|
||
for process in process_list: | ||
if process["id"] == process_id: | ||
matching_processes.append(process) | ||
pd.set_option("display.max_columns", None) # Display all columns | ||
pd.set_option("display.max_rows", None) # Display all rows | ||
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns | ||
pd.DataFrame(matching_processes) | ||
|
||
|
||
def get_process_by_language(language): | ||
response = requests.post( | ||
f"{constants.GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/list", data={"type": "process"} | ||
) | ||
process_list = response.json() | ||
|
||
matching_processes = [] | ||
|
||
for process in process_list: | ||
if process["lang"] == language: | ||
matching_processes.append(process) | ||
pd.set_option("display.max_columns", None) # Display all columns | ||
pd.set_option("display.max_rows", None) # Display all rows | ||
pd.set_option("display.expand_frame_repr", False) # Prevent truncation of columns | ||
pd.DataFrame(matching_processes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.