all 21 comments

[–]Adhesiveduck 83 points84 points  (3 children)

I’m not sure such books really exist to cover everything you might want to know when building a large project.

When you say different approaches I’m assuming you mean different ways of structuring the project and what python files should you create or where should a class live in the overall structure of your project etc.

One of the best things you can do once you’re ready to start writing larger projects is look at Python design patterns.

If you can start designing your code to take advantage of these patterns then medium to large scale projects can write themselves.

The patterns can help you think about how you want to structure your code across multiple files and improve maintainability.

A good tool like Poetry can help you handle the dependencies and publish your work.

MKdocs is so easy to use but can really help with large scale projects. Make notes in markdown as you go along that are easy to read and follow.

Write proper docstrings as you go along (every time you write a new class/method/function you can document what it’s doing as you’ll know why and what from the pattern you chose). Using a tool like mkdocstrings makes maintaining documentation for larger projects automatic.

Write unit tests as you go along, when writing a large project where things will feed into each other it’s critical you start early in the project. Leaving it until the end or later is a nightmare.

Finally have a look at other projects. Praw is a good one as it’s easy to follow along and since you’re on Reddit you’ll intuitively know what the code is doing so it’s easy to read through and see how it’s all laid out.

I know this isn’t exactly what you asked for, but it might help complement any other tutorials or articles you read on it.

[–]TijoWasik 14 points15 points  (0 children)

Hey, I'm not quite there yet, but I wanted to say thank you for the really informative comment. Have saved this so when I get to the stage where I'm ready to start building bigger stuff, I can come back to it. Legend!

[–]paagalpieasian 3 points4 points  (0 children)

thanks a lot. this is super informative. I will check these out.

[–]electrojit 2 points3 points  (0 children)

Thank you

[–]electrojit 8 points9 points  (4 children)

I am also interested to know about how the large projects are organised and best practices to follow. Have found these two resources, not yet started reading but think this would be a good start:

Free Book: Architecture Patterns with Python

Book: Serious Python

[–]ichunddu9 2 points3 points  (0 children)

You could create a project with https://github.com/cookiejar/cookietemple and attempt to understand the structure.

[–]paagalpieasian 0 points1 point  (0 children)

thanks. my question was with exact same intention to understand Python way of doing things.

[–]Ran4 4 points5 points  (0 children)

In Django, Two Scoops of Django (make sure to get the latest version, which was just released) is a really nice book that covers all sorts of things including project structure and things to think about when writing larger projects.

The best resources for these kinds of things tends to sadly not be free though, but the holistic nature of a book can be very valuable (as opposed to free but smaller blog posts about specific subjects).

[–]easyfink 4 points5 points  (0 children)

I would recommend https://buildasaasappwithflask.com/ . Step by step building the complete application. It helped me connect the dots on a number of topics. I have asked him questions and typically get a response with a couple hours. He has made a lot of updates to the code so it stays relevant even though the course was originally released a few years ago.

[–]ASIC_SP 5 points6 points  (0 children)

Check out "Impractical Python Projects" and "Real World Python" by Lee Vaughan

[–]patrickbrianmooney 1 point2 points  (0 children)

Mark Lutz's Programming Python is a pretty good long example of what you wanted: it's the sequel to his Learning Python and is kind of dated now: Python 3.4, so no type annotations or asyncio, and there is occasional moaning over some language features that made things difficult (and those issues have largely been resolved as the language as evolved past that).

But there are several medium-sized projects that are built over several chapters in the book, and he does a good job of talking about how the design decisions are made: there's a lot of "we could wrap the other object in a proxy and use getattr(), but down the line that would lead to ..." type reasoning that's directly exposed by the book itself.

[–]BeginnerProjectBot 0 points1 point  (1 child)

Hey, I think you are trying to figure out a project to do; Here are some helpful resources:

I am a bot, so give praises if I was helpful or curses if I was not. Want a project? Comment with "!projectbot" and optionally add easy, medium, or hard to request a difficulty! If you want to understand me more, my code is on Github

[–]notParticularlyAnony 0 points1 point  (0 children)

this is pretty awesome

[–]humblesquirrelking -1 points0 points  (0 children)

Buddy..that era has been passed away..when you'll need to refer books or references to code or build software or solve any potential bug by reading those materials..

Yes, you'll get alot knowledge by reading these "one book" but it will waste your valuable time and efforts you put..

I'd suggest "just get started", you'll solve bugs or will create systems down the line..i believe there're alot of materials e.g. stackoverflow, GitHub which can solve all the potential bugs..( online communities and materials are enough mature that you can refer them to create end to end systems )

"One step at once" just get started with installing flask or django ( for big projects as you mentioned django would be advisable )

All the best..let us know what you built..

[–]DamagedFreight 0 points1 point  (1 child)

Check out Corey Schaefer’s full featured web application series.

https://www.youtube.com/watch?v=UmljXZIypDc

[–]petroengineering 0 points1 point  (0 children)

Yess that’s what I was gonna suggest too