Giter Club home page Giter Club logo

toodamnbig's Introduction

That dependency is too damn big!

Tell that ninja dev to get off your lawn!

Too Damn Big!

This is a small script that takes a NPM or PyPI package name and tells how heavy that package is, including its dependencies. That gives you ammunition to keep people who are trigger-happy with dependencies at bay.

Requirements

  • Python 3.4+

Usage

Clone the repo and execute the script directly:

$ python3 toodamnbig.py npm/browserify
Getting dependencies...
89,413 SLOC in 116 packages needed to provide you with browserify's functionalities
... not counting Node which is itself 5M SLOC
NASA flies to **space** with 400k sloc

Arguments

There's one positional argument: the package name. It has to be prefixed by its type, npm or pypi. For example, npm/async means the async package on NPM and pypi/django means the Django package on PyPI.

Otherwise, there's the --verbose flag to make the output... more verbose!

PyPI limitations

Extracting dependencies from a Python package is not always an easy thing. Packaging in Python went through many phases, most of which requiring dependencies to be declared in setup.py, an executable file. Yes, it means that to know the dependencies of such a package, you need to execute a possibly untrusted script you've just downloaded from the internet.

Because I don't want to take the responsibility for possibly endangering your machine, I don't do that. Instead, I tokenize the setup.py and extract dependencies from there. However, it only works for "simple" dependencies declaration. As soon as you add dynamicity into the mix, it doesn't work anymore.

Fortunately, there's the new "wheel" format available with many packages on PyPI. With this package format, it's much easier to extract dependencies without running any arbitrary script. So, whenever it can, this script will use the "wheel" format.

If, for any reason, dependencies can't be extracted for a package, there will be a warning in the output.

Roadmap

  • RubyGems support
  • Version stability stats (warning about very frequent releases)
  • package.json, setup.py, requirements.txt, Gemfile parsing

License

GPLv3

toodamnbig's People

Contributors

hsoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.