Skip to content

Commit

Permalink
python and shell scripts for dependencies analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
amdomanska committed Oct 31, 2022
1 parent 339b74d commit 8960e60
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import subprocess
import pandas as pd
import json

if __name__ == "__main__":
rc = subprocess.call("./dependencies.sh")

with open("dependencies.json", encoding='utf-8') as file:
lst = json.load(file)

out = []
for d in lst:
out.append({})
for k, v in d["package"].items():
out[-1][f"package.{k}"] = v
out[-1]["dependencies"] = "; ".join(v["key"] for v in d["dependencies"])

df = pd.DataFrame(out)
print(df)
df.to_csv("dependencies.csv", index=False)
6 changes: 6 additions & 0 deletions dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

rm dependencies.json
rm dependencies.csv

pipdeptree --json --reverse >> dependencies.json

0 comments on commit 8960e60

Please sign in to comment.