I am currently building a small python CLI
(Command Line Interface) application with ambition. In the first development phase I would concentrate on making it work through the CLI
interface only, but in the second phase I will make it work through a GUI
.
To avoid a lot of refactoring of the functionnalities and to keep both version running on a similar code base I was thinking of developping my own internal API to handle processing.
IE:
- Loading the config file
- Saving the config file
- Logging info (through
CLI
or log files) - And the general process of the application
I was wondering where to start and what to keep in mind while building an internal API?
I already watched the following presentation : How To Design A Good API and Why it Matters or and read the text version
** What I mean by API
is : If i want to load the configs I would only have to do something like config = api.load.config(path/to/config/file)
and i would get a dictionnary
(or object
, yet to be determined) without having to detect the type of file and if the file exists, that part would be handled by the internal API
's framework