DEV Community

Discussion on: What developers mean when they say "API"

Collapse
 
k4ml profile image
Kamal Mustafa

If I have following python module named user.py:-

def list_user():
    pass

def show_user(name):
    pass
Enter fullscreen mode Exit fullscreen mode

I can say my user.py module expose 2 APIs which is user.list_user() and user.show_user(). As long as you have 2 separate program that need to talk to each other, they have to do that through some interfacing, and that can be low as a function call.

Collapse
 
rikvik2006 profile image
Riccardo

So when a module or package documentation says "API Reference" it is essentially documenting the methods or functions that developers will need to call to use that module or package. So we can consider methods and functions that a module exposes as APIs that the user of the module or package must call to use the module/package. While we can consider public properties (or attributes as they are called in python) exposed by an object as APIs, or we can only consider methods exposed by an object/functions exposed by a module as APIs.