mirror of
https://github.com/Kludex/awesome-fastapi-projects.git
synced 2024-11-23 20:11:07 +00:00
feat: add links to table
This commit is contained in:
parent
c0df8d6f92
commit
c2d44ac780
1075
dependency.md
1075
dependency.md
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@ import json
|
|||
from pytablewriter import MarkdownTableWriter
|
||||
from stdlib_list import stdlib_list
|
||||
|
||||
NATIVE = ["fastapi", "starlette", "pydantic", "typing", "uvicorn"]
|
||||
NATIVE = ["fastapi", "starlette", "pydantic", "typing", "uvicorn", "app"]
|
||||
|
||||
|
||||
def filter_list(dependencies: List[str]) -> List[str]:
|
||||
|
@ -18,13 +18,23 @@ def filter_list(dependencies: List[str]) -> List[str]:
|
|||
]
|
||||
|
||||
|
||||
def format_with_link(project: str) -> str:
|
||||
links = open("unique_links.txt", "r")
|
||||
for link in links.readlines():
|
||||
if project in link:
|
||||
return f"[{project}]({link})"
|
||||
|
||||
with open("results.json") as json_file:
|
||||
data = json.load(json_file)
|
||||
writer = MarkdownTableWriter()
|
||||
writer.headers = ["Project", "Dependencies"]
|
||||
writer.value_matrix = [
|
||||
[project, filter_list(dependencies)]
|
||||
[format_with_link(project), filter_list(dependencies)]
|
||||
for project, dependencies in data.items()
|
||||
if len(filter_list(dependencies)) > 0 and len(filter_list(dependencies)) < 20
|
||||
if (
|
||||
len(filter_list(dependencies)) > 0
|
||||
and len(filter_list(dependencies)) < 20
|
||||
and project != ""
|
||||
)
|
||||
]
|
||||
writer.write_table()
|
||||
|
|
Loading…
Reference in New Issue
Block a user