Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shbenzer committed Jan 10, 2025
1 parent 58f38f2 commit 6381bca
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
Binary file added .DS_Store
Binary file not shown.
13 changes: 9 additions & 4 deletions build/lib/depster/depster.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def convert_package_lock_to_csv(input_file, output_file="dependencies.csv"):
df['Requires'] = None
df['Dependencies'] = None
df['hasDependencies'] = False
df['Description'] = None
df['License'] = None


# make and fill new columns
Expand All @@ -44,17 +46,20 @@ def convert_package_lock_to_csv(input_file, output_file="dependencies.csv"):
#drop columns
df.drop(labels={'dict','lockfileVersion'},axis=1,inplace=True)

# in order to populate the 'Newest Version' column, we'll need to do some querys
## https://registry.npmjs.org/:package will suffice
### we'll also be making a LOT of requests
#### response.json() turns the response into a dict for us to parse
# in order to populate the 'Newest Version', 'License', and 'Description' columns,
## we'll need to do some querys...
### https://registry.npmjs.org/:package will suffice
#### we'll also be making a LOT of requests
##### response.json() turns the response into a dict for us to parse

header = {'Accept' : 'application/vnd.npm.install-v1+json'} ##gets an abbreviated response

for index, _ in df.iterrows():
try:
response = requests.get('https://registry.npmjs.org/'+index,headers=header).json()
df['Latest Version'][index] = response['dist-tags']['latest']
df['Description'][index] = response.get('description', 'No description available.')
df['License'][index] = response.get('license', 'Unknown')
except Exception as e:
print(f"Warning: Could not fetch version for package '{index}': {e}")

Expand Down
7 changes: 2 additions & 5 deletions depster.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: depster
Version: 1.0.1
Version: 1.1.0
Summary: A tool create a detailed CSV analyzing your project's dependencies
Home-page: https://github.com/shbenzer/depster
Author: Simon H. Benzer
Expand Down Expand Up @@ -28,7 +28,7 @@ This Python package converts a `package-lock.json` file into a CSV file containi
- **Extract Key Information:** Captures current version, integrity hash, requirements, and nested dependencies.
- **Check Dependencies:** Identifies if a package has dependencies.
- **Fetch Latest Versions:** Uses the NPM registry API to get the most recent version of each package.
- **Export to CSV:** Outputs the cleaned and enriched data to `package-lock.csv`.
- **Export to CSV:** Outputs the cleaned and enriched data to `dependencies.csv`.

---

Expand Down Expand Up @@ -98,9 +98,6 @@ The resulting CSV file will include the following columns:

### Performance Considerations
- The script sends a separate request to the NPM registry for each package. This can slow down processing for projects with a large number of dependencies.
- **Optimization Suggestions:**
- Use bulk queries if supported by the API.
- Implement caching for frequently queried packages.

### Warning Suppression
- Warnings are suppressed in the script for a cleaner execution log.
Expand Down
Binary file removed dist/depster-1.0.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/depster-1.0.1.tar.gz
Binary file not shown.
Binary file added dist/depster-1.1.0-py3-none-any.whl
Binary file not shown.
Binary file added dist/depster-1.1.0.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="depster",
version="1.0.1",
version="1.1.0",
author="Simon H. Benzer",
author_email="[email protected]",
description="A tool create a detailed CSV analyzing your project's dependencies",
Expand Down

0 comments on commit 6381bca

Please sign in to comment.