python-sdk-remote 0.0.94__tar.gz → 0.0.95__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.
Potentially problematic release.
This version of python-sdk-remote might be problematic. Click here for more details.
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/PKG-INFO +1 -1
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/http_response.py +1 -1
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/PKG-INFO +1 -1
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/SOURCES.txt +0 -1
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/setup.py +1 -1
- python_sdk_remote-0.0.94/python_sdk_remote/src/get_dependencies.py +0 -199
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/README.md +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/pyproject.toml +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/__init__.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/constants.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/item.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/mini_logger.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/our_object.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/unified_json.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/utilities.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/valid_json_versions.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/validate_environment.py +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/requires.txt +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/top_level.txt +0 -0
- {python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/setup.cfg +0 -0
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/http_response.py
RENAMED
|
@@ -55,7 +55,7 @@ def create_return_http_headers() -> dict:
|
|
|
55
55
|
logger.end(object={"return_http_headers": return_http_headers})
|
|
56
56
|
return return_http_headers
|
|
57
57
|
|
|
58
|
-
def create_error_http_response(exception: Exception, status_code: HTTPStatus) -> dict:
|
|
58
|
+
def create_error_http_response(exception: Exception, status_code: HTTPStatus = HTTPStatus.BAD_REQUEST) -> dict:
|
|
59
59
|
logger.start(object={"exception": exception})
|
|
60
60
|
error_http_response = {
|
|
61
61
|
"statusCode": HTTPStatus.value,
|
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/SOURCES.txt
RENAMED
|
@@ -8,7 +8,6 @@ python_sdk_remote.egg-info/requires.txt
|
|
|
8
8
|
python_sdk_remote.egg-info/top_level.txt
|
|
9
9
|
python_sdk_remote/src/__init__.py
|
|
10
10
|
python_sdk_remote/src/constants.py
|
|
11
|
-
python_sdk_remote/src/get_dependencies.py
|
|
12
11
|
python_sdk_remote/src/http_response.py
|
|
13
12
|
python_sdk_remote/src/item.py
|
|
14
13
|
python_sdk_remote/src/mini_logger.py
|
|
@@ -7,7 +7,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
7
7
|
# python -m build needs pyproject.toml or setup.py
|
|
8
8
|
setuptools.setup(
|
|
9
9
|
name=PACKAGE_NAME,
|
|
10
|
-
version='0.0.
|
|
10
|
+
version='0.0.95', # https://pypi.org/project/python-sdk-remote/
|
|
11
11
|
author="Circles",
|
|
12
12
|
author_email="info@circles.life",
|
|
13
13
|
description="PyPI Package for Circles Python SDK Local Python",
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
# pip install BeautifulSoup4 requests importlib-metadata
|
|
2
|
-
import subprocess
|
|
3
|
-
import sys
|
|
4
|
-
import json
|
|
5
|
-
from collections import defaultdict
|
|
6
|
-
|
|
7
|
-
import importlib_metadata
|
|
8
|
-
import requests
|
|
9
|
-
from bs4 import BeautifulSoup
|
|
10
|
-
from typing import Dict, List, Union
|
|
11
|
-
import os
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def install(packages):
|
|
15
|
-
print("Installing...", packages)
|
|
16
|
-
if isinstance(packages, str):
|
|
17
|
-
packages = [packages]
|
|
18
|
-
# for package in packages:
|
|
19
|
-
# # We can't install multiple packages in a single command, because pip will stop at the first error
|
|
20
|
-
# subprocess.run([sys.executable, "-m", "pip", "install", "-U", "--no-deps", package], check=False)
|
|
21
|
-
subprocess.run([sys.executable, "-m", "pip", "install", "-U", "--no-deps"] + packages, check=False)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def get_dependencies_per_package(include_packages):
|
|
26
|
-
dependencies_per_package = defaultdict(list)
|
|
27
|
-
for dist in importlib_metadata.distributions():
|
|
28
|
-
package_name = dist.metadata['Name']
|
|
29
|
-
if package_name not in include_packages:
|
|
30
|
-
continue
|
|
31
|
-
|
|
32
|
-
dependencies = dist.metadata.get_all('Requires-Dist', [])
|
|
33
|
-
for dependency in dependencies:
|
|
34
|
-
depend_on = dependency.split()[0]
|
|
35
|
-
if depend_on in include_packages and depend_on not in dependencies_per_package[package_name]:
|
|
36
|
-
dependencies_per_package[depend_on].append(package_name)
|
|
37
|
-
|
|
38
|
-
for package in include_packages:
|
|
39
|
-
if package not in dependencies_per_package:
|
|
40
|
-
dependencies_per_package[package] = []
|
|
41
|
-
return dependencies_per_package
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def get_included_packages():
|
|
45
|
-
url = "https://pypi.org/user/circles/"
|
|
46
|
-
class_name = "package-snippet__title"
|
|
47
|
-
|
|
48
|
-
response = requests.get(url)
|
|
49
|
-
soup = BeautifulSoup(response.text, "html.parser")
|
|
50
|
-
package_names = soup.find_all("h3", class_=class_name)
|
|
51
|
-
included_packages = [package_name.text for package_name in package_names]
|
|
52
|
-
return included_packages
|
|
53
|
-
|
|
54
|
-
# def build_dependency_tree(dependencies_per_package: Dict[str, List[str]]) -> List[Union[str, Dict[str, List[Union[str, Dict]]]]]:
|
|
55
|
-
# called = set()
|
|
56
|
-
# def build_tree(package: str) -> Union[str, Dict[str, List[Union[str, Dict]]]]:
|
|
57
|
-
# if package in called:
|
|
58
|
-
# return package
|
|
59
|
-
# called.add(package)
|
|
60
|
-
# if package not in dependencies_per_package:
|
|
61
|
-
# return package
|
|
62
|
-
# return {package: [build_tree(dep) for dep in dependencies_per_package[package]]}
|
|
63
|
-
#
|
|
64
|
-
# trees = []
|
|
65
|
-
# for package in dependencies_per_package:
|
|
66
|
-
# trees.append(build_tree(package))
|
|
67
|
-
#
|
|
68
|
-
# return trees
|
|
69
|
-
#
|
|
70
|
-
# printed = []
|
|
71
|
-
#
|
|
72
|
-
# def display_dependency_tree(tree: Union[str, Dict[str, List[Union[str, Dict]]]], indent: int = 0) -> None:
|
|
73
|
-
# if isinstance(tree, dict):
|
|
74
|
-
# for package, dependencies in tree.items():
|
|
75
|
-
# if package not in printed:
|
|
76
|
-
# print("-" * indent + package)
|
|
77
|
-
# printed.append(package)
|
|
78
|
-
# for dep in dependencies:
|
|
79
|
-
# display_dependency_tree(dep, indent + 1)
|
|
80
|
-
# else:
|
|
81
|
-
# if tree not in printed:
|
|
82
|
-
# print("-" * (indent + 1) + tree)
|
|
83
|
-
# printed.append(tree)
|
|
84
|
-
|
|
85
|
-
def main():
|
|
86
|
-
# otherwise pip raise
|
|
87
|
-
remove = """CirclesS3Storage
|
|
88
|
-
age-detection-local-python-package
|
|
89
|
-
rest-api-vacancy-scraper-local
|
|
90
|
-
recruitment-employer-local-python-package
|
|
91
|
-
local-logger-python-backend
|
|
92
|
-
local-age-detection-python-backend
|
|
93
|
-
age-detection
|
|
94
|
-
external-user-local
|
|
95
|
-
message-send-platform-invitation
|
|
96
|
-
profile-instagram
|
|
97
|
-
smartlink-restapi-python-serverless-com
|
|
98
|
-
profile-reddit-local-restapi-imp-python-package
|
|
99
|
-
operational-hours-local-python-package-local
|
|
100
|
-
Age-detection
|
|
101
|
-
CirclesGenderDetectorPython
|
|
102
|
-
business-profile-yelp-local-python
|
|
103
|
-
profile-yelp-local-python-circles
|
|
104
|
-
OpenCage-local
|
|
105
|
-
circles-bert-local
|
|
106
|
-
community-waiting-list-local-python-package
|
|
107
|
-
contact-locations-local
|
|
108
|
-
contact-user-external-local
|
|
109
|
-
dialog-workflow
|
|
110
|
-
dialog-workflow-local-python-package
|
|
111
|
-
local-dialog-workflow-python-backend
|
|
112
|
-
email-local
|
|
113
|
-
item-local-python-package-local
|
|
114
|
-
labels-local
|
|
115
|
-
location-profile-local-python-package-local
|
|
116
|
-
phone-local
|
|
117
|
-
profile-instagram-graphql-imp-local-python-package-local
|
|
118
|
-
profile-zoominfo-graphql-imp
|
|
119
|
-
real-estate-realtor.com-imp-local
|
|
120
|
-
recruitment-employer-monster-com-indeed-com-vacancy-scraper-local
|
|
121
|
-
sms-message-aws-local-python-package
|
|
122
|
-
variable-local-python-package
|
|
123
|
-
circles-bert-local""".splitlines()
|
|
124
|
-
# too_popular = ["logger-local", "database-mysql-local", "python-sdk-remote", "url-remote", "user-context-remote", "language-remote", "database-infrastructure-local"]
|
|
125
|
-
# remove += too_popular
|
|
126
|
-
add = ['profiles-local', 'database-without-orm-local',
|
|
127
|
-
'python-sdk-local', 'url-local']
|
|
128
|
-
if os.path.exists('dependencies.json'):
|
|
129
|
-
print("getting from dependencies.json")
|
|
130
|
-
with open('dependencies.json', 'r') as f:
|
|
131
|
-
dependencies_per_package = json.load(f)
|
|
132
|
-
with open('dependencies.json', 'w') as f:
|
|
133
|
-
json.dump(dependencies_per_package, f, indent=4, sort_keys=True)
|
|
134
|
-
else:
|
|
135
|
-
include_packages = get_included_packages()
|
|
136
|
-
include_packages = [package for package in include_packages if package not in remove]
|
|
137
|
-
install(include_packages)
|
|
138
|
-
include_packages += add
|
|
139
|
-
dependencies_per_package = get_dependencies_per_package(include_packages)
|
|
140
|
-
print("writing to dependencies.json")
|
|
141
|
-
with open('dependencies.json', 'w') as f:
|
|
142
|
-
json.dump(dependencies_per_package, f, indent=4, sort_keys=True)
|
|
143
|
-
|
|
144
|
-
# clean dependencies_per_package keys and values
|
|
145
|
-
for package in list(dependencies_per_package.keys()):
|
|
146
|
-
if package in remove:
|
|
147
|
-
dependencies_per_package.pop(package)
|
|
148
|
-
else:
|
|
149
|
-
dependencies_per_package[package] = [dep for dep in dependencies_per_package[package]
|
|
150
|
-
if dep not in remove]
|
|
151
|
-
|
|
152
|
-
print("num of edges per node, sorted by num of edges:")
|
|
153
|
-
for package, dependencies in sorted(dependencies_per_package.items(), key=lambda x: len(x[1]), reverse=True):
|
|
154
|
-
print(f"{package}: {len(dependencies)}")
|
|
155
|
-
#
|
|
156
|
-
# dependency_trees = build_dependency_tree(dependencies_per_package)
|
|
157
|
-
# for tree in dependency_trees:
|
|
158
|
-
# display_dependency_tree(tree)
|
|
159
|
-
|
|
160
|
-
def plot_graph(dependencies_per_package: Dict[str, List[str]]):
|
|
161
|
-
import networkx as nx
|
|
162
|
-
import matplotlib.pyplot as plt
|
|
163
|
-
|
|
164
|
-
# Create a directed graph
|
|
165
|
-
G = nx.DiGraph()
|
|
166
|
-
|
|
167
|
-
# Add nodes (packages) to the graph
|
|
168
|
-
for package in dependencies_per_package:
|
|
169
|
-
G.add_node(package)
|
|
170
|
-
|
|
171
|
-
# Add edges (dependencies) to the graph
|
|
172
|
-
for package, dependencies in dependencies_per_package.items():
|
|
173
|
-
for dep in dependencies:
|
|
174
|
-
G.add_edge(dep, package)
|
|
175
|
-
|
|
176
|
-
# nx.kamada_kawai_layout, nx.circular_layout, nx.shell_layout, nx.spectral_layout
|
|
177
|
-
# nx.random_layout, nx.spring_layout, nx.spiral_layout
|
|
178
|
-
# error: nx.planar_layout, nx.planar_layout, nx.bipartite_layout, nx.rescale_layout, nx.multipartite_layout
|
|
179
|
-
|
|
180
|
-
# max_len = max(len(dependencies) for dependencies in dependencies_per_package.values())
|
|
181
|
-
# def weight_func(v, u, e):
|
|
182
|
-
# return 0.2 * (len(dependencies_per_package.get(v, [])) + len(dependencies_per_package.get(u, [])))
|
|
183
|
-
#
|
|
184
|
-
# pos = nx.kamada_kawai_layout(G, scale=2, weight=weight_func)
|
|
185
|
-
|
|
186
|
-
pos = nx.circular_layout(G)
|
|
187
|
-
# Draw the graph
|
|
188
|
-
plt.figure(figsize=(20, 15)) # Increase the figure size
|
|
189
|
-
nx.draw(G, pos, with_labels=True, node_color="skyblue", font_size=6, font_color="black", node_size=1000, width=1,
|
|
190
|
-
edge_color="gray", arrowsize=5)
|
|
191
|
-
plt.axis("off") # Hide the axes
|
|
192
|
-
plt.tight_layout() # Adjust the layout to fit the figure
|
|
193
|
-
|
|
194
|
-
# Save the plot as an image file
|
|
195
|
-
print("Saving to dependencies_tree.png")
|
|
196
|
-
plt.savefig("dependencies_tree.png", dpi=300, bbox_inches="tight")
|
|
197
|
-
|
|
198
|
-
if __name__ == "__main__":
|
|
199
|
-
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/valid_json_versions.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote/src/validate_environment.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.94 → python_sdk_remote-0.0.95}/python_sdk_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|