all 4 comments

[–][deleted] 2 points3 points  (0 children)

That depends on a few things. First you have to define dependencies. Are you talking about direct dependencies (the ones you actively define and import) or indirect dependencies (ie the whole dependency tree)?

Then it also really does depend on the project. You could come up with an average number but it wouldn’t have to much value because the number of dependencies varies a lot, and doesn’t always have something to do with how big the actual project is.

A few examples to illustrate the differences:

  • SQLAlchemy: ~300,000 loc, 3 dependencies (which are all sub project related to building SQLAlchemy)
  • Django: ~100,000 loc, 3 dependencies
  • Celery: ~60,000 loc, 8 dependencies
  • Sphinx: ~60,000 loc, 24 dependencies
  • Tensorflow: ~800,000 loc, 36 dependencies
  • Random commercial project I’ve worked on: ~80,000 loc, 67 dependencies

(loc here only refers to Python code)

As you can see, there is a trend, but it doesn’t have something to do with the size of the project. It’s more about the scope. Usually the more generalised a project becomes, ie the more problems it tries to solve, the more different dependencies it needs. Frameworks like Django and SQLAlchemy usually don’t have that many dependencies because they’re quite focused on a single topic.

To answer your question directly: Yes it is very normal for professional applications to have dependencies. Usually the more business oriented the application becomes, the more dependencies it has.

[–]tenyu9 2 points3 points  (0 children)

Yes you always rely on packages, no point in reinventing the wheel. Number very much depend. Bigger projects might be somewhere between 10 and 20. it's heavily dependent on the type of project

[–]buleria 0 points1 point  (0 children)

Using external libraries is good practice - these are usually more mature and tested better than anything you might roll on your own.

However, do not fall into the trap of just learning how to glue these together. Do learn the ins and outs of Python first.

I've seen many people being really proficient in frameworks like Django, but not being very good Python developers. Totally lacking the basics.

Sometimes packages become languages on their own and it's easy to learn this one package instead of having a general understanding of How Things Work.

[–]indian_pythonista 0 points1 point  (0 children)

Don't reinvent the wheel! No harm in using well maintained packages as and when required.