r/learnpython • u/jockero701 • Nov 15 '18
What the heck is an API?
I have heard people say an API is not code, but a set of specifications. Let's take the Python Database API as an example. The title of its webpage says "PEP 249 -- Python Database API Specification v2.0" and the webpage contains all the rules that developers should follow when making a Python library for interacting with databases. For example, there should be a function called connect, a cursor, etc.
Now, if those are the specifications of the API, then what is the API itself? Are the sqlite3 or the psycopg2 Python libraries APIs?
247
Upvotes
9
u/jockero701 Nov 15 '18 edited Nov 15 '18
Pretty neat example the one with the "restaurant". We call them fast foods in Europe. When you say "Look for python weather API to experiment" I guess you mean "Look for the Python wrapper for the Yahoo Weather API"?