What kind of Python should I learn to start making add-ons for Anki?

Specifically, I’m looking at Codecadamy.

There’s a bazillion courses, do you guys have any recommendation on which ones to take?

I’m currently looking into “Learn Python 3,” “Learn Intermediate Python,” and “Learn Advanced Python”

What about ones like Build Python Web Apps with Django or Build Python Web Apps with Flask?

I guess my question is what kind of application is Anki? Is it Python for Data Science? Python for Web Apps? Etc.

Thank you, and sorry if this is a dumb question.

None of these. I’ve looked into Python classes, and I would say they roughly belong to these categories:

  • General purpose classes, such as Learn Python 3 or Learn [Level] Python. It’s probably a good thing that you take these. Even though you probably won’t strictly need advanced Python features when writing add-ons, they are probably required to understand (at least to a certain minimum degree) Anki’s internals which are, you know, useful if you want to develop add-ons. I would very definitively recommend for you.
  • Very specific courses about data sciences in general (which include data manipulation classes, deep learning, but also statistic classes, probability classes or more general purpose maths classes). There is a lot of effervescence about data sciences right now, and especially in the Python community because it’s easy to use and the available tools are very good. Maybe even too much effervescence: in Python forums, I’d say about 50% of the questions are extremely basic questions from people using very advanced data sciences libraries…
    Anyways, this isn’t at all useful for add-ons development, and, contrary to a lot of people are willing to tell you lately, this is a very advanced topic. I wouldn’t recommend this to a beginner, as I see (as said) a lot of beginners trying and failing.
  • Very specific courses about cryptocurrencies / mining. Similarly to the previous, this is a very popular topic, and about 30% of the questions of Python forums are beginners with very basic questions trying to use cryptcurrencies libraries they don’t understand, and, just as before, this isn’t useful for developing Anki add-ons, and is not that easy (although I think it’s still easier than machine learning and data sciences). I wouldn’t recommend to a beginner.
  • Interview classes. This is about how to do a job interview. Never took such a class in my life, so I can’t really tell you what they contain.
  • Courses about a library and / or a specific hardware (numpy, scipy, raspberry pi, …). I don’t think they’re particularly useful for add-ons, and it might be better to take these when you actually need to use the library / are developing on that hardware.
  • Courses about web development. Web development is quite a vast topic. Although Anki makes a heavy usage of web technologies, it’s never of Python’s frameworks, so learning about Flask or Django won’t be useful right away. Still, learning about the web stack overall can be pretty useful to understand Anki’s webviews. I would recommend these for you, if you still have some free time.
  • Programming patterns. These are the main strength of an experienced engineer. You may not realize it yet, but one of the biggest challenge when writing medium to large software is actually designing it, that is, that is, thinking about how will you split that big project into smaller components, and how you will make these components interact. There is not a single answer to this kind of question, and often the difference between a program considered to be well coded or not (ever heard the expression a great piece of software?) lies in this initial subdivision (besides how it was actually implemented).
    Turns out that this subdivision process / implementation strategy depends a lot on the kind of tasks you want to perform, and each part of it is called a programming pattern (or software pattern). You can think of these as ready-to-use solutions or part of solutions that you can apply when you realize your problem can be solved by these. I would very strongly recommend these, after learning the basics.

In general, when learning a language, there are three components:

  1. The language’s syntax, paradigms and quirks.
  2. Its standard library, the most commonly used libraries and, more in general, conventions and good practices.
  3. Its idiomatic patterns.

Learning the first one can be more or less long, but it’s possible to go through it completely (or almost completely): maybe one day you’ll know almost every about Python’s syntax and philosophy (and since Python is relatively easy, that day may be closer than you think). That day, if you want keep learning, you’ll have to expand your knowledge on the two other points. Since libraries are only useful when you use them, general-purpose knowledge (which is mainly what you need to develop Anki add-ons) is expanded mainly by learning new patterns. And how do you do that? Well, you can read theory books about it (a very well-known book is, for instance, Design Patterns: Object Oriented Design for OOP) and practice: as you will face problems, you will also solve them, finding yourself in the need for such patterns, and starting developing your own.

But you don’t have to wait to be a master of Python to do so: even before completing several courses, you can try developing an add-on. If you keep it simply, you’ll probably succeed, otherwise you’ll struggle. In either case, it’s going to be very useful! So don’t hesitate to simply try and code, besides taking classes about it.


NB: when I say I wouldn’t recommend a class, I say it with the development of Anki add-ons in mind. Once you want to learn something else, don’t hesitate in taking these classes too!

6 Likes

Thank you so much for such a detailed answer! I’ll definitely look into this as I start my journey into programming.

Thank you so much again!

Ah also, read about coding conventions, case and formatting in Python. It’s not that long, and it makes your code readable. See code qualitty, from which here is an excerpt:


I honestly didn’t think you could even USE emoji in variable names. Or that there were so many different crying ones.
Have fun in your learning!

3 Likes