4 Replies - 922 Views - Last Post: 15 July 2019 - 01:15 PM Rate Topic: -----

#1 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11689
  • View blog
  • Posts: 19,870
  • Joined: 19-March 11

Discussion: python libraries

Posted 05 June 2019 - 10:02 AM

In a recent thread, DK3250 raised a question about libraries:

Quote

So, what are the most important (must-learn) modules in python?


I suspect that there are a few threads on this topic buried down in the deeps of the Discussion Lounge, but it's worth having another go-round.

To expand on the question:
- what are the libraries you reach for most often?
- what libraries do you feel every python developer should be aware of?
- what is your approach to "learning a library"?

A request: Discussion is welcome, obviously, but pretty please start by giving a thoughtful answer to those three questions first! Much thanks.

Is This A Good Question/Topic? 2
  • +

Replies To: Discussion: python libraries

#2 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11689
  • View blog
  • Posts: 19,870
  • Joined: 19-March 11

Re: Discussion: python libraries

Posted 05 June 2019 - 06:04 PM

Just to kick things off here:

- I personally find that the collections library is pretty much always useful. defaultdicts and namedtuples especially - the former are great for saving you from boilerplate key-checking, and the latter are a nice way to make a simple tuple behave like a simple bag-of-attributes object. If you're passing around big dictionaries of "context", stuffing those into a namedtuple is a great idea. Not least because it paves the way for this datablob to seamlessly become a full-fledged object as it becomes entrenched.

- if we're thinking in the sense of interview questions, I would certainly feel like familiarity with regular expressions is a reasonably reliable proxy for a certain level of practical experience. You don't have to know the details of a complex regex scenario, but if I hand you a clear regex problem and you write me an artisanal parser, that tells me something. If we're thinking in terms of "oh wow, that's cool" value, itertools is full of cool stuff that is worth exploring.

- for the most part, I learn libraries when I find that there's a thing I want to to which is made easier by that library. My procedure is to read the docs until I think I know something about the overall mindset driving the library, and then to drill down into the bits that I think I'm going to need until I think I have the solution I want, and then stop. :)/>
Was This Post Helpful? 0
  • +
  • -

#3 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15361
  • View blog
  • Posts: 61,605
  • Joined: 12-June 08

Re: Discussion: python libraries

Posted 06 June 2019 - 02:59 PM

Plotting helps.. be it GGPLOT, matplotlib, or Plotly.

'json' if your world shifts that way.. same with PycURL.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is online

  • never lube your breaks
  • member icon

Reputation: 6823
  • View blog
  • Posts: 28,276
  • Joined: 12-December 12

Re: Discussion: python libraries

Posted 07 June 2019 - 12:28 AM

I have not written any Python recently myself but, hopefully, can contribute to the discussion in a small way.

For an overview this might be worth a look

20 Python libraries you canít live without

From memory, the ones that occur most often in questions here at DIC are Numpy, PyGame, BeautifulSoup and matplotlib. Though, of course, this is an arbitrary statistic and not a measure of their importance.

The choice of libraries will also be influenced by the readers' direction of travel (web-based, scientific, etc.).
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11689
  • View blog
  • Posts: 19,870
  • Joined: 19-March 11

Re: Discussion: python libraries

Posted 15 July 2019 - 01:15 PM

Working on some time-dependent code lately, I suspect that most python programmers would be well-served to spend some time learning the ins and outs of datetimes and timezones. They're not as intuitive as one might hope.

This talk from this year's pycon might be a useful starting point: https://www.youtube....h?v=rz3D8VG_2TY
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1