A package that tells you the size of your dependencies in Megabytes!
Project description
depsize
This python package helps you measure the disk space used by your python dependencies. The purpose of this package is to help you understand how much each package contributes to the size of your app, and to help you find ways to reduce the size of the app.
When used in combination with docker image history this tool helps you find ways to reduce the total size of the docker image.
This package has no third party dependencies. The program only uses the built-in packages of python.
Supports python version 3.8 and newer.
Install
Install depsize with your tools of choice, for example
pip
pip install depsize
or add depsize to your requirements-dev.txt file and install it with your other dev requirements using pip install -r requirements-dev.txt`.
uv
uv add depsize --dev
Or just copy the main python program as a script. It runs on all versions greater than and including python 3.7.
How to use depsize
You can run the depsize package from within your application repository from the terminal by running
Run depsize to get a description of the tool
> depsize
depsize: Get the total size of installed python dependencies in MB.
Use 'depsize total' to get a summary including total size and the largest packages.
Use 'depsize --o FILE' to export as JSON, f.ex 'depsize --o data/packages.json'
Run depsize total to print the size of all packages in MB, and name the largest:
> depsize total
Total size of all packages: 56.27 MB
==================================================
Packages larger than 1 MB:
debugpy: 27.93 MB
zmq: 4.99 MB
jedi: 4.75 MB
pygments: 4.50 MB
IPython: 3.48 MB
prompt_toolkit: 2.24 MB
tornado: 1.76 MB
Packages smaller than 1 MB: 68 packages
Combined size of packages smaller than 1 MB: 6.62 MB
You can store the results as a json file with depsize --o File, which will contain the python packages by name, package version and size in megabytes.
> depsize --o data/packages.json
Dependencies written to data/packages.json
Example JSON file contents:
Developing locally
just install # to install dependencies for depsize
just build # to build depsize
uv pip install -e . # to install an editable build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file depsize-0.1.2.tar.gz.
File metadata
- Download URL: depsize-0.1.2.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c945354851084f14d55814ccd0d71686c71e32a5137c41a1586c8f2d0a0a6cce
|
|
| MD5 |
7e517e7ac355cc45e467dcbfdc755156
|
|
| BLAKE2b-256 |
369d831c616d1ee58be3d8e8b54989e3d77c2053c72bdae89a4f837c9ec36e84
|
File details
Details for the file depsize-0.1.2-py3-none-any.whl.
File metadata
- Download URL: depsize-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
203793ec5495a65de1232a6fb27db1a4d292948ed794517e02d64d355156f5f8
|
|
| MD5 |
b9b915f90589a164248b28aac8052bc4
|
|
| BLAKE2b-256 |
f20583c6357a0b2ed42cb3bfa5a4cdc99f677076d345828a720f2aacb2502d71
|