René's URL Explorer Experiment


Title: Structuring a Python Application (Overview) (Video) – Real Python

Open Graph Title: Structuring a Python Application (Overview) – Real Python

Description: Welcome to Python Application Layouts. My name is Chris and I will be your guide. This series of videos will show you how to organize your Python code and the files associated therein. Each lesson in the video will cover different kinds of…

Open Graph Description: Welcome to Python Application Layouts. My name is Chris and I will be your guide. This series of videos will show you how to organize your Python code and the files associated therein. Each lesson in the video will cover different kinds of…

Opengraph URL: https://realpython.com/videos/structuring-python-application/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
  {
    "@context": "https://schema.org",
    "@type": "VideoObject",
    "name": "Structuring a Python Application (Overview)",
    "description": "Welcome to Python Application Layouts. My name is Chris and I will be your guide. This series of videos will show you how to organize your Python code and the files associated therein. Each lesson in the video will cover different kinds of…",
    "thumbnailUrl": ["https://files.realpython.com/media/python_application_layout_watermark.31a037620d92.jpg"],
    "uploadDate": "2020-04-28T14:00:00+00:00",
    "duration": "PT12M25S",
    "embedUrl": "https://player.vimeo.com/video/409896384",
    "potentialAction": {
      "@type": "SeekToAction",
      "target": "https://realpython.com/videos/structuring-python-application/#t={seek_to_second_number}",
      "startOffset-input": "required name=seek_to_second_number"
    }
  }
  

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/python_application_layout_watermark.31a037620d92.jpg
og:imagehttps://files.realpython.com/media/python_application_layout_watermark.31a037620d92.jpg
twitter:creator@realpython
og:typevideo.episode

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/courses/structuring-python-application/discussion/
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/courses/structuring-python-application/discussion/
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Fvideos%2Fstructuring-python-application%2F
https://realpython.com/courses/structuring-python-application/#team
Structuring a Python Applicationhttps://realpython.com/courses/structuring-python-application/
Christopher Trudeauhttps://realpython.com/courses/structuring-python-application/#team
Recommended Tutorialhttps://realpython.com/python-application-layouts/
Course Slides (.pdf)https://realpython.com/courses/structuring-python-application/downloads/layout-slides/
Sample Code (.zip)https://realpython.com/courses/structuring-python-application/downloads/layout-code/
Ask a Questionhttps://realpython.com/courses/structuring-python-application/discussion/#discussion
https://realpython.com/feedback/survey/course/structuring-python-application/liked/?from=lesson-title
https://realpython.com/feedback/survey/course/structuring-python-application/disliked/?from=lesson-title
Contentshttps://realpython.com/courses/structuring-python-application/discussion/#description
Transcripthttps://realpython.com/courses/structuring-python-application/discussion/#transcript
Discussion (5)https://realpython.com/courses/structuring-python-application/discussion/#discussion
Flaskhttps://realpython.com/tutorials/flask/
Djangohttps://realpython.com/tutorials/django/
Sample Code (.zip)https://realpython.com/courses/structuring-python-application/downloads/layout-code/
Course Slides (.pdf)https://realpython.com/courses/structuring-python-application/downloads/layout-slides/
00:00https://realpython.com/courses/structuring-python-application/discussion/#t=0.48
Welcome to Python Application Layouts.https://realpython.com/courses/structuring-python-application/discussion/#t=0.48
My name is Chris and I will be your guide.https://realpython.com/courses/structuring-python-application/discussion/#t=2.37
This series of videos will show you how to organize your Python code and thehttps://realpython.com/courses/structuring-python-application/discussion/#t=4.74
files associated therein. Each lesson in the videohttps://realpython.com/courses/structuring-python-application/discussion/#t=7.83
will cover different kinds of configurations: simple one-off scripts, installablehttps://realpython.com/courses/structuring-python-application/discussion/#t=10.77
single packages, larger applications, a Django web application,https://realpython.com/courses/structuring-python-application/discussion/#t=15.43
and finally, a Flask application. First off,https://realpython.com/courses/structuring-python-application/discussion/#t=20.07
I’m going to assume that you have some familiarity with Python modules andhttps://realpython.com/courses/structuring-python-application/discussion/#t=23.7
packages. If you need a refresher,https://realpython.com/courses/structuring-python-application/discussion/#t=26.64
there’s a course on Real Python that can help you with the details.https://realpython.com/courses/structuring-python-application/discussion/#t=28.89
00:32https://realpython.com/courses/structuring-python-application/discussion/#t=32.369
So, let’s get started.https://realpython.com/courses/structuring-python-application/discussion/#t=32.369
Python is very flexible when it comes to how you structure your applications.https://realpython.com/courses/structuring-python-application/discussion/#t=33.93
You can more or less get away with almost anything you want.https://realpython.com/courses/structuring-python-application/discussion/#t=36.99
00:39https://realpython.com/courses/structuring-python-application/discussion/#t=39.66
That’s very powerful,https://realpython.com/courses/structuring-python-application/discussion/#t=39.66
but it can also be very daunting if you’re just getting going. Unfortunately,https://realpython.com/courses/structuring-python-application/discussion/#t=40.65
the internet is no help. If you start googling for how to do this,https://realpython.com/courses/structuring-python-application/discussion/#t=44.1
there’s lots and lots of opinions on how it should be done. That being said,https://realpython.com/courses/structuring-python-application/discussion/#t=47.52
the content in this video is based on a Real Python article from Kyle.https://realpython.com/courses/structuring-python-application/discussion/#t=52.5
00:56https://realpython.com/courses/structuring-python-application/discussion/#t=56.1
You can see the original article here.https://realpython.com/courses/structuring-python-application/discussion/#t=56.1
This means that it in itself is also opinionated.https://realpython.com/courses/structuring-python-application/discussion/#t=58.77
Now, I happen to agree with Kyle’s opinions and he’s outlining things that arehttps://realpython.com/courses/structuring-python-application/discussion/#t=62.13
best practices,https://realpython.com/courses/structuring-python-application/discussion/#t=65.34
but you will be able to find contradictory information out there.https://realpython.com/courses/structuring-python-application/discussion/#t=66.51
01:10https://realpython.com/courses/structuring-python-application/discussion/#t=70.14
The intent of this course is to give you good places to start.https://realpython.com/courses/structuring-python-application/discussion/#t=70.14
Once you’re comfortable, you can adjust things to your own style.https://realpython.com/courses/structuring-python-application/discussion/#t=73.47
Accompanying this video is a selection of sample code.https://realpython.com/courses/structuring-python-application/discussion/#t=76.92
01:19https://realpython.com/courses/structuring-python-application/discussion/#t=79.38
It’s actually executable. It doesn’t just show the file layout;https://realpython.com/courses/structuring-python-application/discussion/#t=79.38
it actually works. This means you can package it,https://realpython.com/courses/structuring-python-application/discussion/#t=82.53
run the tests, and see how things change from a small application to a largehttps://realpython.com/courses/structuring-python-application/discussion/#t=86.04
application. Hopefully, this is helpful as you’re following along.https://realpython.com/courses/structuring-python-application/discussion/#t=90.63
01:35https://realpython.com/courses/structuring-python-application/discussion/#t=95.34
I’ll start with the simplest situation:https://realpython.com/courses/structuring-python-application/discussion/#t=95.34
a program consisting of a single Python file. This kind of situation workshttps://realpython.com/courses/structuring-python-application/discussion/#t=97.44
if you don’t have any dependencies and everything’s just pure Python or ifhttps://realpython.com/courses/structuring-python-application/discussion/#t=101.97
you’re using a virtual env with tools like pip or Pipenv to manage externalhttps://realpython.com/courses/structuring-python-application/discussion/#t=105.45
dependencies. Of course, single-file programshttps://realpython.com/courses/structuring-python-application/discussion/#t=109.47
often aren’t just single files. You’re writing automated tests, right?https://realpython.com/courses/structuring-python-application/discussion/#t=113.94
01:57https://realpython.com/courses/structuring-python-application/discussion/#t=117.45
You should be. Even if you’re not, there’s also things that go along with it—https://realpython.com/courses/structuring-python-application/discussion/#t=117.45
for example, configuration for your git setup,https://realpython.com/courses/structuring-python-application/discussion/#t=121.62
setup.py for organizing how your system is packagedhttps://realpython.com/courses/structuring-python-application/discussion/#t=124.44
if you are trying to do packaging, requirements.txt that specifies yourhttps://realpython.com/courses/structuring-python-application/discussion/#t=128.1
dependencies, and licensing and README information is always usefulhttps://realpython.com/courses/structuring-python-application/discussion/#t=132.75
if you’re trying to hand this script off to somebody else.https://realpython.com/courses/structuring-python-application/discussion/#t=136.23
02:19https://realpython.com/courses/structuring-python-application/discussion/#t=139.29
This course comes with sample code that actually executes.https://realpython.com/courses/structuring-python-application/discussion/#t=139.29
I’m going to give you a quick tour of what it does.https://realpython.com/courses/structuring-python-application/discussion/#t=142.56
It’s a little Hello World so that you can see as I build on it in the differenthttps://realpython.com/courses/structuring-python-application/discussion/#t=144.39
lessonshttps://realpython.com/courses/structuring-python-application/discussion/#t=148.26
how the pieces fit together, and what changes as things become more complicated.https://realpython.com/courses/structuring-python-application/discussion/#t=148.89
02:33https://realpython.com/courses/structuring-python-application/discussion/#t=153.51
So, here it is: helloworld.py.https://realpython.com/courses/structuring-python-application/discussion/#t=153.51
Normally, a Hello World example is nothing but print("Hello, World!").https://realpython.com/courses/structuring-python-application/discussion/#t=155.82
In order to show you how to interact with external libraries and how thesehttps://realpython.com/courses/structuring-python-application/discussion/#t=159.66
pieces fit together, my Hello World is a little bit more complicated,https://realpython.com/courses/structuring-python-application/discussion/#t=163.05
but not by much.https://realpython.com/courses/structuring-python-application/discussion/#t=166.8
02:48https://realpython.com/courses/structuring-python-application/discussion/#t=168.63
All it’s doing in line 12 is using the very popular requests library.https://realpython.com/courses/structuring-python-application/discussion/#t=168.63
If you haven’t seen it before, requests wraps HTTP code.https://realpython.com/courses/structuring-python-application/discussion/#t=173.43
02:57https://realpython.com/courses/structuring-python-application/discussion/#t=177.18
It’s the easiest way of grabbing the contents ofhttps://realpython.com/courses/structuring-python-application/discussion/#t=177.18
a web page. Line 8 shows the URL that I’m grabbing. The URL I’m grabbing is ahttps://realpython.com/courses/structuring-python-application/discussion/#t=179.29
Wikipedia article on Hello World programs—https://realpython.com/courses/structuring-python-application/discussion/#t=184.99
how very meta. And then on line 13, I’m printing it—https://realpython.com/courses/structuring-python-application/discussion/#t=187.48
finding the tag inside of it and printing out just the result of that.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=191.47'>https://realpython.com/courses/structuring-python-application/discussion/#t=191.47</a></td></tr> <tr><td>03:17</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=197.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=197.17</a></td></tr> <tr><td>So, as I said, pretty simple—essentially, it just prints "Hello, World!"</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=197.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=197.17</a></td></tr> <tr><td>but uses the requests library to do it.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=202.0'>https://realpython.com/courses/structuring-python-application/discussion/#t=202.0</a></td></tr> <tr><td>03:25</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=205.6'>https://realpython.com/courses/structuring-python-application/discussion/#t=205.6</a></td></tr> <tr><td>The other thing to notice here is I’ve embedded a version number.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=205.6'>https://realpython.com/courses/structuring-python-application/discussion/#t=205.6</a></td></tr> <tr><td>03:29</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=209.14'>https://realpython.com/courses/structuring-python-application/discussion/#t=209.14</a></td></tr> <tr><td>There are multiple ways of specifying version numbers;</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=209.14'>https://realpython.com/courses/structuring-python-application/discussion/#t=209.14</a></td></tr> <tr><td>this is my preferred mechanism because you can actually get at it</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=211.45'>https://realpython.com/courses/structuring-python-application/discussion/#t=211.45</a></td></tr> <tr><td>programmatically. Later on, when this goes from a single file to multiple files,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=214.09'>https://realpython.com/courses/structuring-python-application/discussion/#t=214.09</a></td></tr> <tr><td>I’ll move this out of the script and into the __init__.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=218.71'>https://realpython.com/courses/structuring-python-application/discussion/#t=218.71</a></td></tr> <tr><td>03:43</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=223.63'>https://realpython.com/courses/structuring-python-application/discussion/#t=223.63</a></td></tr> <tr><td>And here it is in action.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=223.63'>https://realpython.com/courses/structuring-python-application/discussion/#t=223.63</a></td></tr> <tr><td>03:46</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=226.33'>https://realpython.com/courses/structuring-python-application/discussion/#t=226.33</a></td></tr> <tr><td>That’s the <title> tag from the Wikipedia page on Hello</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=226.33'>https://realpython.com/courses/structuring-python-application/discussion/#t=226.33</a></td></tr> <tr><td>World programs, as expected.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=229.3'>https://realpython.com/courses/structuring-python-application/discussion/#t=229.3</a></td></tr> <tr><td>03:54</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=234.22'>https://realpython.com/courses/structuring-python-application/discussion/#t=234.22</a></td></tr> <tr><td>So, this is some test code to go with my Hello World program.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=234.22'>https://realpython.com/courses/structuring-python-application/discussion/#t=234.22</a></td></tr> <tr><td>Interestingly enough,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=237.49'>https://realpython.com/courses/structuring-python-application/discussion/#t=237.49</a></td></tr> <tr><td>there’s actually more code in the tests than there is in the program itself.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=238.3'>https://realpython.com/courses/structuring-python-application/discussion/#t=238.3</a></td></tr> <tr><td>04:01</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=241.72'>https://realpython.com/courses/structuring-python-application/discussion/#t=241.72</a></td></tr> <tr><td>That’s because I’m avoiding the call to the internet inside of requests.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=241.72'>https://realpython.com/courses/structuring-python-application/discussion/#t=241.72</a></td></tr> <tr><td>The meat of the test is lines 15 through 19. Line 18 calls</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=246.67'>https://realpython.com/courses/structuring-python-application/discussion/#t=246.67</a></td></tr> <tr><td>the actual code. requests is mocked out so that the internet call isn’t actually</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=251.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=251.29</a></td></tr> <tr><td>made. I generally try to make a difference between my unit tests,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=256.959'>https://realpython.com/courses/structuring-python-application/discussion/#t=256.959</a></td></tr> <tr><td>which are self-contained and don’t require the dependencies, versus my</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=261.25'>https://realpython.com/courses/structuring-python-application/discussion/#t=261.25</a></td></tr> <tr><td>integration tests, which would include going off to the world.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=264.58'>https://realpython.com/courses/structuring-python-application/discussion/#t=264.58</a></td></tr> <tr><td>04:28</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=268.09'>https://realpython.com/courses/structuring-python-application/discussion/#t=268.09</a></td></tr> <tr><td>This allows me to write much faster unit tests, and I’m not dependent on the</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=268.09'>https://realpython.com/courses/structuring-python-application/discussion/#t=268.09</a></td></tr> <tr><td>environment I’m running them in.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=271.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=271.21</a></td></tr> <tr><td>If you haven’t seen unit tests or mocks before,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=273.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=273.34</a></td></tr> <tr><td>there’s plenty of good content on Real Python to help you out with that. For now,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=275.38'>https://realpython.com/courses/structuring-python-application/discussion/#t=275.38</a></td></tr> <tr><td>just understand that this is the code that tests it, and I’ll show you quickly</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=280.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=280.39</a></td></tr> <tr><td>how that works.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=283.99'>https://realpython.com/courses/structuring-python-application/discussion/#t=283.99</a></td></tr> <tr><td>04:46</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=286.75'>https://realpython.com/courses/structuring-python-application/discussion/#t=286.75</a></td></tr> <tr><td>The Python unittest module is executable. On the command line,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=286.75'>https://realpython.com/courses/structuring-python-application/discussion/#t=286.75</a></td></tr> <tr><td>I can specify -m to execute unittest, passing in my tests file. Python’s</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=290.53'>https://realpython.com/courses/structuring-python-application/discussion/#t=290.53</a></td></tr> <tr><td>unittest library will then execute the tests in my tests.py file.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=296.77'>https://realpython.com/courses/structuring-python-application/discussion/#t=296.77</a></td></tr> <tr><td>05:01</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=301.36'>https://realpython.com/courses/structuring-python-application/discussion/#t=301.36</a></td></tr> <tr><td>Here it goes. You see the results of the program:</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=301.36'>https://realpython.com/courses/structuring-python-application/discussion/#t=301.36</a></td></tr> <tr><td>"Hello, World!" program - Wikipedia, because do_hello() prints something to the screen,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=304.02'>https://realpython.com/courses/structuring-python-application/discussion/#t=304.02</a></td></tr> <tr><td>and then you see the output from the unittest module specifying that it ran one</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=309.7'>https://realpython.com/courses/structuring-python-application/discussion/#t=309.7</a></td></tr> <tr><td>test successfully and everything’s okay.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=313.45'>https://realpython.com/courses/structuring-python-application/discussion/#t=313.45</a></td></tr> <tr><td>05:17</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=317.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=317.17</a></td></tr> <tr><td>So, you’ve seen the code and the tests that go with it. Now,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=317.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=317.17</a></td></tr> <tr><td>I want to show you the accompanying files</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=319.99'>https://realpython.com/courses/structuring-python-application/discussion/#t=319.99</a></td></tr> <tr><td>that would probably also be in the directory,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=321.19'>https://realpython.com/courses/structuring-python-application/discussion/#t=321.19</a></td></tr> <tr><td>particularly if you’re going to package this up for other people. For starters,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=322.81'>https://realpython.com/courses/structuring-python-application/discussion/#t=322.81</a></td></tr> <tr><td>.gitignore. This is a configuration file</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=327.31'>https://realpython.com/courses/structuring-python-application/discussion/#t=327.31</a></td></tr> <tr><td>for git to tell it to ignore certain file types.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=329.65'>https://realpython.com/courses/structuring-python-application/discussion/#t=329.65</a></td></tr> <tr><td>05:32</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=332.38'>https://realpython.com/courses/structuring-python-application/discussion/#t=332.38</a></td></tr> <tr><td>It stops it from trying to check in things like backup files and swap files that</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=332.38'>https://realpython.com/courses/structuring-python-application/discussion/#t=332.38</a></td></tr> <tr><td>you’re not interested in. Here’s a really, really simple example.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=336.13'>https://realpython.com/courses/structuring-python-application/discussion/#t=336.13</a></td></tr> <tr><td>If you’re writing code on a Mac, the .DS_Store directory shows up everywhere.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=340.33'>https://realpython.com/courses/structuring-python-application/discussion/#t=340.33</a></td></tr> <tr><td>05:44</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=344.68'>https://realpython.com/courses/structuring-python-application/discussion/#t=344.68</a></td></tr> <tr><td>It’s where meta information is stored. You probably don’t want that checked in.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=344.68'>https://realpython.com/courses/structuring-python-application/discussion/#t=344.68</a></td></tr> <tr><td>If you’re writing Python 3, __pycache__/</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=349.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=349.21</a></td></tr> <tr><td>will have the contents of the compiled Python files. Any Python c, Python o, or</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=352.45'>https://realpython.com/courses/structuring-python-application/discussion/#t=352.45</a></td></tr> <tr><td>Python d files—so that’s .pyc, .pyo,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=358.04'>https://realpython.com/courses/structuring-python-application/discussion/#t=358.04</a></td></tr> <tr><td>or .pyd—are all object files and don’t need to be in your repository.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=360.71'>https://realpython.com/courses/structuring-python-application/discussion/#t=360.71</a></td></tr> <tr><td>06:05</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=365.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=365.39</a></td></tr> <tr><td>These are examples of things you probably don’t want to store inside of git. A</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=365.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=365.39</a></td></tr> <tr><td>complete version of this file is much longer than this. You can see sample</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=369.23'>https://realpython.com/courses/structuring-python-application/discussion/#t=369.23</a></td></tr> <tr><td>.gitignore files off at GitHub itself.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=372.68'>https://realpython.com/courses/structuring-python-application/discussion/#t=372.68</a></td></tr> <tr><td>06:15</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=375.26'>https://realpython.com/courses/structuring-python-application/discussion/#t=375.26</a></td></tr> <tr><td>It has good .gitignore files for almost every programming language you can think</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=375.26'>https://realpython.com/courses/structuring-python-application/discussion/#t=375.26</a></td></tr> <tr><td>of. My Hello World program uses the requests library.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=379.58'>https://realpython.com/courses/structuring-python-application/discussion/#t=379.58</a></td></tr> <tr><td>06:23</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=383.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=383.21</a></td></tr> <tr><td>That means I need to be able to pip install it to a virtual env.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=383.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=383.21</a></td></tr> <tr><td>The requirements.txt file shows this dependency as well as anything else</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=386.81'>https://realpython.com/courses/structuring-python-application/discussion/#t=386.81</a></td></tr> <tr><td>that I might use when I’m developing. A sample file includes requests 2.22,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=391.7'>https://realpython.com/courses/structuring-python-application/discussion/#t=391.7</a></td></tr> <tr><td>which is the library I was using, as well as coverage and pudb—coverage</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=398.78'>https://realpython.com/courses/structuring-python-application/discussion/#t=398.78</a></td></tr> <tr><td>being a program to help me see what my tests are covering and aren’t covering,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=403.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=403.34</a></td></tr> <tr><td>and pudb is my favorite command-line</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=407.69'>https://realpython.com/courses/structuring-python-application/discussion/#t=407.69</a></td></tr> <tr><td>debugger. requirements.txt generally stores</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=409.7'>https://realpython.com/courses/structuring-python-application/discussion/#t=409.7</a></td></tr> <tr><td>everything you need to run your tests and develop.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=413.84'>https://realpython.com/courses/structuring-python-application/discussion/#t=413.84</a></td></tr> <tr><td>06:57</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=417.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=417.29</a></td></tr> <tr><td>This is often more than what you would include in a shipped application.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=417.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=417.29</a></td></tr> <tr><td>So, setup.py won’t have the coverage and pudb items in it—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=422.54'>https://realpython.com/courses/structuring-python-application/discussion/#t=422.54</a></td></tr> <tr><td>it’ll only have requests. Just the strict dependencies. Speaking of setup.py—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=426.53'>https://realpython.com/courses/structuring-python-application/discussion/#t=426.53</a></td></tr> <tr><td>what is it? It’s a way of specifying what is packaged in your application.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=431.72'>https://realpython.com/courses/structuring-python-application/discussion/#t=431.72</a></td></tr> <tr><td>07:16</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=436.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=436.34</a></td></tr> <tr><td>Unfortunately, Python</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=436.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=436.34</a></td></tr> <tr><td>isn’t really strong when it comes to packaging. Or an alternative way of looking</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=437.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=437.39</a></td></tr> <tr><td>at that is there’s lots and lots of choice;</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=441.02'>https://realpython.com/courses/structuring-python-application/discussion/#t=441.02</a></td></tr> <tr><td>it isn’t really baked into the language and there’s tons of third-party ways of</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=443.33'>https://realpython.com/courses/structuring-python-application/discussion/#t=443.33</a></td></tr> <tr><td>doing it. The Python community is trying to tackle this,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=446.81'>https://realpython.com/courses/structuring-python-application/discussion/#t=446.81</a></td></tr> <tr><td>but it’s changed a lot over the years</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=450.98'>https://realpython.com/courses/structuring-python-application/discussion/#t=450.98</a></td></tr> <tr><td>and so you’re going to bump into all sorts of ways of doing things.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=453.5'>https://realpython.com/courses/structuring-python-application/discussion/#t=453.5</a></td></tr> <tr><td>07:37</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=457.07'>https://realpython.com/courses/structuring-python-application/discussion/#t=457.07</a></td></tr> <tr><td>setup.py isn’t the only way, but it is one of the more common</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=457.07'>https://realpython.com/courses/structuring-python-application/discussion/#t=457.07</a></td></tr> <tr><td>popular ways, and a lot of tools interact with it. For example,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=460.43'>https://realpython.com/courses/structuring-python-application/discussion/#t=460.43</a></td></tr> <tr><td>if you’ve heard of tox,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=464.27'>https://realpython.com/courses/structuring-python-application/discussion/#t=464.27</a></td></tr> <tr><td>it’s a test harness for testing your program under multiple versions of Python.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=465.8'>https://realpython.com/courses/structuring-python-application/discussion/#t=465.8</a></td></tr> <tr><td>07:49</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=469.85'>https://realpython.com/courses/structuring-python-application/discussion/#t=469.85</a></td></tr> <tr><td>twine is a tool for uploading a package to PyPI</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=469.85'>https://realpython.com/courses/structuring-python-application/discussion/#t=469.85</a></td></tr> <tr><td>so you can share it with other people.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=472.52'>https://realpython.com/courses/structuring-python-application/discussion/#t=472.52</a></td></tr> <tr><td>The packages that twine uploads are the result of setup.py</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=474.68'>https://realpython.com/courses/structuring-python-application/discussion/#t=474.68</a></td></tr> <tr><td>being executed and creating bundles. For more information on setup.py and how</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=477.77'>https://realpython.com/courses/structuring-python-application/discussion/#t=477.77</a></td></tr> <tr><td>to use it with Pipenv, go to the Real Python article on this topic.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=483.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=483.17</a></td></tr> <tr><td>08:07</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=487.55'>https://realpython.com/courses/structuring-python-application/discussion/#t=487.55</a></td></tr> <tr><td>Now, I’ll show you an example. This is the bottom chunk of a setup.py file.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=487.55'>https://realpython.com/courses/structuring-python-application/discussion/#t=487.55</a></td></tr> <tr><td>It’s kind of funny; not only were the tests twice as long as the code, now</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=492.41'>https://realpython.com/courses/structuring-python-application/discussion/#t=492.41</a></td></tr> <tr><td>the configuration file is four times as long.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=497.12'>https://realpython.com/courses/structuring-python-application/discussion/#t=497.12</a></td></tr> <tr><td>08:20</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=500.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=500.21</a></td></tr> <tr><td>The heart of setup.py is down at the bottom here in these final four lines—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=500.21'>https://realpython.com/courses/structuring-python-application/discussion/#t=500.21</a></td></tr> <tr><td>calling the setup() library and passing in a dictionary that describes your</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=504.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=504.17</a></td></tr> <tr><td>package. I’ll move up a little bit</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=507.74'>https://realpython.com/courses/structuring-python-application/discussion/#t=507.74</a></td></tr> <tr><td>now. Lines 16 through 38—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=510.02'>https://realpython.com/courses/structuring-python-application/discussion/#t=510.02</a></td></tr> <tr><td>this is the dictionary specifying information. Really,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=513.559'>https://realpython.com/courses/structuring-python-application/discussion/#t=513.559</a></td></tr> <tr><td>this is just attributes about the program helloworld.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=516.59'>https://realpython.com/courses/structuring-python-application/discussion/#t=516.59</a></td></tr> <tr><td>08:40</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=520.94'>https://realpython.com/courses/structuring-python-application/discussion/#t=520.94</a></td></tr> <tr><td>It includes things like name, the version, description, a longer description,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=520.94'>https://realpython.com/courses/structuring-python-application/discussion/#t=520.94</a></td></tr> <tr><td>where to find it, who the author is, the license you’ve picked,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=525.41'>https://realpython.com/courses/structuring-python-application/discussion/#t=525.41</a></td></tr> <tr><td>what kind of program it is, what modules it uses, and what it requires.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=529.82'>https://realpython.com/courses/structuring-python-application/discussion/#t=529.82</a></td></tr> <tr><td>08:54</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=534.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=534.29</a></td></tr> <tr><td>35 through 37 is important—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=534.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=534.29</a></td></tr> <tr><td>this is what makes sure dependencies get installed when your package is</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=536.58'>https://realpython.com/courses/structuring-python-application/discussion/#t=536.58</a></td></tr> <tr><td>installed by someone else.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=540.69'>https://realpython.com/courses/structuring-python-application/discussion/#t=540.69</a></td></tr> <tr><td>Remember how this is different from requirements.txt: requirements.txt</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=542.94'>https://realpython.com/courses/structuring-python-application/discussion/#t=542.94</a></td></tr> <tr><td>includes everything that you would put in your development virtual environment—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=547.53'>https://realpython.com/courses/structuring-python-application/discussion/#t=547.53</a></td></tr> <tr><td>and that includes things like your debugging tools—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=550.92'>https://realpython.com/courses/structuring-python-application/discussion/#t=550.92</a></td></tr> <tr><td>whereas install_requires is only what someone using your program would need.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=553.8'>https://realpython.com/courses/structuring-python-application/discussion/#t=553.8</a></td></tr> <tr><td>09:18</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=558.84'>https://realpython.com/courses/structuring-python-application/discussion/#t=558.84</a></td></tr> <tr><td>So. install_requires—the requests</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=558.84'>https://realpython.com/courses/structuring-python-application/discussion/#t=558.84</a></td></tr> <tr><td>library; requirements.txt only has requests as well as things like coverage</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=561.09'>https://realpython.com/courses/structuring-python-application/discussion/#t=561.09</a></td></tr> <tr><td>and pudb inside of it. I’m going to scroll up to the top now.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=566.55'>https://realpython.com/courses/structuring-python-application/discussion/#t=566.55</a></td></tr> <tr><td>09:30</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=570.96'>https://realpython.com/courses/structuring-python-application/discussion/#t=570.96</a></td></tr> <tr><td>Lines 1 through 13 aren’t required for setup.py to work;</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=570.96'>https://realpython.com/courses/structuring-python-application/discussion/#t=570.96</a></td></tr> <tr><td>as long as you fill in your dictionary args, you’re good to go.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=574.65'>https://realpython.com/courses/structuring-python-application/discussion/#t=574.65</a></td></tr> <tr><td>These 13 lines are things that I often do inside of my setup.py</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=577.77'>https://realpython.com/courses/structuring-python-application/discussion/#t=577.77</a></td></tr> <tr><td>so that I’m reusing information from the outside world. For example,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=581.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=581.34</a></td></tr> <tr><td>I have a regular expression looking for "__version__" inside of the</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=584.97'>https://realpython.com/courses/structuring-python-application/discussion/#t=584.97</a></td></tr> <tr><td>program file. It reads it and puts it inside of the dictionary.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=589.38'>https://realpython.com/courses/structuring-python-application/discussion/#t=589.38</a></td></tr> <tr><td>09:53</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=593.61'>https://realpython.com/courses/structuring-python-application/discussion/#t=593.61</a></td></tr> <tr><td>This means I don’t have to remember to update the version number in two places:</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=593.61'>https://realpython.com/courses/structuring-python-application/discussion/#t=593.61</a></td></tr> <tr><td>the code and the setup.py file. Similarly,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=597.42'>https://realpython.com/courses/structuring-python-application/discussion/#t=597.42</a></td></tr> <tr><td>because I have a README file,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=601.2'>https://realpython.com/courses/structuring-python-application/discussion/#t=601.2</a></td></tr> <tr><td>I’m reading that in and putting it inside of the long_description. You can</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=602.64'>https://realpython.com/courses/structuring-python-application/discussion/#t=602.64</a></td></tr> <tr><td>of course</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=606.66'>https://realpython.com/courses/structuring-python-application/discussion/#t=606.66</a></td></tr> <tr><td>just set these things up inside of the dictionary—or in some cases, not even</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=607.08'>https://realpython.com/courses/structuring-python-application/discussion/#t=607.08</a></td></tr> <tr><td>include them—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=610.41'>https://realpython.com/courses/structuring-python-application/discussion/#t=610.41</a></td></tr> <tr><td>but I wanted to show you what I often include inside of my own application</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=611.04'>https://realpython.com/courses/structuring-python-application/discussion/#t=611.04</a></td></tr> <tr><td>configuration. Now, you’ve seen requirements.txt and setup.py.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=614.52'>https://realpython.com/courses/structuring-python-application/discussion/#t=614.52</a></td></tr> <tr><td>10:18</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=618.75'>https://realpython.com/courses/structuring-python-application/discussion/#t=618.75</a></td></tr> <tr><td>Just a couple of housekeeping files left. First off, the LICENSE.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=618.75'>https://realpython.com/courses/structuring-python-application/discussion/#t=618.75</a></td></tr> <tr><td>There’s a lot of misinformation out there about copyrights,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=623.28'>https://realpython.com/courses/structuring-python-application/discussion/#t=623.28</a></td></tr> <tr><td>particularly when it comes to software.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=625.89'>https://realpython.com/courses/structuring-python-application/discussion/#t=625.89</a></td></tr> <tr><td>10:28</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=628.26'>https://realpython.com/courses/structuring-python-application/discussion/#t=628.26</a></td></tr> <tr><td>The thing you have to know is if you do not include a license file,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=628.26'>https://realpython.com/courses/structuring-python-application/discussion/#t=628.26</a></td></tr> <tr><td>the code is fully copyrighted by default, in most jurisdictions.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=632.01'>https://realpython.com/courses/structuring-python-application/discussion/#t=632.01</a></td></tr> <tr><td>What that means is no one has any right to use it or copy it in any fashion.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=636.6'>https://realpython.com/courses/structuring-python-application/discussion/#t=636.6</a></td></tr> <tr><td>10:42</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=642.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=642.39</a></td></tr> <tr><td>The open-source world would not exist if everyone did this. Licenses are what</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=642.39'>https://realpython.com/courses/structuring-python-application/discussion/#t=642.39</a></td></tr> <tr><td>grant other people the ability to use your software,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=647.94'>https://realpython.com/courses/structuring-python-application/discussion/#t=647.94</a></td></tr> <tr><td>and you’re probably using an awful lot of opensource products right now,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=651.27'>https://realpython.com/courses/structuring-python-application/discussion/#t=651.27</a></td></tr> <tr><td>so in my view, it’s only fair to share some of what you’re using yourself.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=655.44'>https://realpython.com/courses/structuring-python-application/discussion/#t=655.44</a></td></tr> <tr><td>10:59</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=659.58'>https://realpython.com/courses/structuring-python-application/discussion/#t=659.58</a></td></tr> <tr><td>There’s plenty of variations on licenses. You can pick which one you like.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=659.58'>https://realpython.com/courses/structuring-python-application/discussion/#t=659.58</a></td></tr> <tr><td>If you’re using GitHub, when you create a new repository</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=664.17'>https://realpython.com/courses/structuring-python-application/discussion/#t=664.17</a></td></tr> <tr><td>it will even give you a dropdown to choose which license to include in your</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=666.93'>https://realpython.com/courses/structuring-python-application/discussion/#t=666.93</a></td></tr> <tr><td>repository. That massive text there is the MIT License.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=670.53'>https://realpython.com/courses/structuring-python-application/discussion/#t=670.53</a></td></tr> <tr><td>11:14</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=674.49'>https://realpython.com/courses/structuring-python-application/discussion/#t=674.49</a></td></tr> <tr><td>It’s one of the simpler licenses and it’s very, very popular in the Python world.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=674.49'>https://realpython.com/courses/structuring-python-application/discussion/#t=674.49</a></td></tr> <tr><td>This is the one I tend to go to myself unless I’m doing something that’s</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=679.08'>https://realpython.com/courses/structuring-python-application/discussion/#t=679.08</a></td></tr> <tr><td>interacting with other projects that don’t allow it.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=682.86'>https://realpython.com/courses/structuring-python-application/discussion/#t=682.86</a></td></tr> <tr><td>11:26</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=686.22'>https://realpython.com/courses/structuring-python-application/discussion/#t=686.22</a></td></tr> <tr><td>There’s lots of good information off at ChooseALicense.com</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=686.22'>https://realpython.com/courses/structuring-python-application/discussion/#t=686.22</a></td></tr> <tr><td>if you want to see what the differences are and help you pick a license.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=689.64'>https://realpython.com/courses/structuring-python-application/discussion/#t=689.64</a></td></tr> <tr><td>Just remember: if you don’t include a license</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=693.78'>https://realpython.com/courses/structuring-python-application/discussion/#t=693.78</a></td></tr> <tr><td>you’re not actually sharing your code, regardless of whatever your intent was.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=696.29'>https://realpython.com/courses/structuring-python-application/discussion/#t=696.29</a></td></tr> <tr><td>11:40</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=700.11'>https://realpython.com/courses/structuring-python-application/discussion/#t=700.11</a></td></tr> <tr><td>Finally, a README file is also important. If you’re sharing your code,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=700.11'>https://realpython.com/courses/structuring-python-application/discussion/#t=700.11</a></td></tr> <tr><td>you need to be able to tell people what it is.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=703.41'>https://realpython.com/courses/structuring-python-application/discussion/#t=703.41</a></td></tr> <tr><td>This should be a short description of your project.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=706.47'>https://realpython.com/courses/structuring-python-application/discussion/#t=706.47</a></td></tr> <tr><td>11:48</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=708.84'>https://realpython.com/courses/structuring-python-application/discussion/#t=708.84</a></td></tr> <tr><td>Two very common formats for this are Markdown and reStructuredText.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=708.84'>https://realpython.com/courses/structuring-python-application/discussion/#t=708.84</a></td></tr> <tr><td>If you’re using GitHub,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=713.35'>https://realpython.com/courses/structuring-python-application/discussion/#t=713.35</a></td></tr> <tr><td>README.md or README.rst will automatically show as the project’s homepage.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=714.82'>https://realpython.com/courses/structuring-python-application/discussion/#t=714.82</a></td></tr> <tr><td>12:00</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=720.52'>https://realpython.com/courses/structuring-python-application/discussion/#t=720.52</a></td></tr> <tr><td>Writing these things sometimes can be a bit of a challenge. Us programmers—</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=720.52'>https://realpython.com/courses/structuring-python-application/discussion/#t=720.52</a></td></tr> <tr><td>not so goodly in English.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=723.85'>https://realpython.com/courses/structuring-python-application/discussion/#t=723.85</a></td></tr> <tr><td>If you’re having a little trouble and you want to figure out how to do it,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=725.68'>https://realpython.com/courses/structuring-python-application/discussion/#t=725.68</a></td></tr> <tr><td>Dan’s written a great article on how to describe your project and how to tell</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=728.59'>https://realpython.com/courses/structuring-python-application/discussion/#t=728.59</a></td></tr> <tr><td>others about it. So, that’s a simple single-file program.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=732.34'>https://realpython.com/courses/structuring-python-application/discussion/#t=732.34</a></td></tr> <tr><td>12:16</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=736.93'>https://realpython.com/courses/structuring-python-application/discussion/#t=736.93</a></td></tr> <tr><td>Next up,</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=736.93'>https://realpython.com/courses/structuring-python-application/discussion/#t=736.93</a></td></tr> <tr><td>I’ll make things a little more complicated and show you how to use a single</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=737.62'>https://realpython.com/courses/structuring-python-application/discussion/#t=737.62</a></td></tr> <tr><td>package which has multiple files in it.</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#t=740.8'>https://realpython.com/courses/structuring-python-application/discussion/#t=740.8</a></td></tr> <tr><td>April 29, 2020</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#comment-2c00b202-6c00-4b52-a922-03bee3ba0e66'>https://realpython.com/courses/structuring-python-application/discussion/#comment-2c00b202-6c00-4b52-a922-03bee3ba0e66</a></td></tr> <tr><td>ive only been maintaining in my setup.py</td><td><a href='/?url=https://github.com/drewmullen/vault-kv-migrate/blob/0169fe421bf8d25aa83b081a17a7f00a40ca42db/setup.py#L28'>https://github.com/drewmullen/vault-kv-migrate/blob/0169fe421bf8d25aa83b081a17a7f00a40ca42db/setup.py#L28</a></td></tr> <tr><td>April 30, 2020</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#comment-e13a42ce-d755-4cb1-ac1b-2449677a6b38'>https://realpython.com/courses/structuring-python-application/discussion/#comment-e13a42ce-d755-4cb1-ac1b-2449677a6b38</a></td></tr> <tr><td>realpython.com/python-modules-packages</td><td><a href='/?url=https://realpython.com/python-modules-packages'>https://realpython.com/python-modules-packages</a></td></tr> <tr><td>realpython.com/python-application-layouts</td><td><a href='/?url=https://realpython.com/python-application-layouts'>https://realpython.com/python-application-layouts</a></td></tr> <tr><td>github.com/github/gitignore</td><td><a href='/?url=https://github.com/github/gitignore'>https://github.com/github/gitignore</a></td></tr> <tr><td>realpython.com/pipenv-guide</td><td><a href='/?url=https://realpython.com/pipenv-guide'>https://realpython.com/pipenv-guide</a></td></tr> <tr><td>choosealicense.com</td><td><a href='/?url=https://choosealicense.com'>https://choosealicense.com</a></td></tr> <tr><td>dbader.org/blog/write-a-great-readme-for-your-github-project</td><td><a href='/?url=https://dbader.org/blog/write-a-great-readme-for-your-github-project'>https://dbader.org/blog/write-a-great-readme-for-your-github-project</a></td></tr> <tr><td>May 2, 2020</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#comment-71b5523e-46e2-4f68-8f8e-9136bccb4ecf'>https://realpython.com/courses/structuring-python-application/discussion/#comment-71b5523e-46e2-4f68-8f8e-9136bccb4ecf</a></td></tr> <tr><td>May 3, 2020</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#comment-01e09859-6825-4698-bef1-97daf866d5ed'>https://realpython.com/courses/structuring-python-application/discussion/#comment-01e09859-6825-4698-bef1-97daf866d5ed</a></td></tr> <tr><td>May 4, 2020</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/discussion/#comment-33d9c49d-881a-4b79-a7ae-f49e7b42c3ac'>https://realpython.com/courses/structuring-python-application/discussion/#comment-33d9c49d-881a-4b79-a7ae-f49e7b42c3ac</a></td></tr> <tr><td>Become a Member</td><td><a href='/?url=https://realpython.com/account/join/'>https://realpython.com/account/join/</a></td></tr> <tr><td>Overview</td><td><a href='/?url=https://realpython.com/courses/structuring-python-application/'>https://realpython.com/courses/structuring-python-application/</a></td></tr> <tr><td></td><td><a href='/?url=https://realpython.com/lessons/installable-single-package/'>https://realpython.com/lessons/installable-single-package/</a></td></tr> <tr><td> Structuring a Python Application (Overview) 12:25 </td><td><a href='/?url=https://realpython.com/videos/structuring-python-application/'>https://realpython.com/videos/structuring-python-application/</a></td></tr> <tr><td> Installable Single Package 06:11 </td><td><a href='/?url=https://realpython.com/lessons/installable-single-package/'>https://realpython.com/lessons/installable-single-package/</a></td></tr> <tr><td> Application With Internal Packages 06:23 </td><td><a href='/?url=https://realpython.com/lessons/application-internal-packages/'>https://realpython.com/lessons/application-internal-packages/</a></td></tr> <tr><td> Django Web Application 04:19 </td><td><a href='/?url=https://realpython.com/lessons/django-web-application/'>https://realpython.com/lessons/django-web-application/</a></td></tr> <tr><td> Flask Web Application 01:58 </td><td><a href='/?url=https://realpython.com/lessons/flask-web-application/'>https://realpython.com/lessons/flask-web-application/</a></td></tr> <tr><td> Structuring a Python Application (Summary) 04:39 </td><td><a href='/?url=https://realpython.com/lessons/structuring-python-application-summary/'>https://realpython.com/lessons/structuring-python-application-summary/</a></td></tr> <tr><td>Privacy Policy</td><td><a href='/?url=https://realpython.com/privacy-policy/'>https://realpython.com/privacy-policy/</a></td></tr> </table> <p>Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover <p>Robots: max-image-preview:large <hr> URLs of <a href='/known-crawlers'>crawlers that visited me</a>.