APIfication using any2api
Initially, any2api started as a small research project and open-source prototype. Its goal was to auto-generate containerized APIs for any executable, primarily focusing on deployment scripts and scientific programs (e-science simulations and calculations). We utilized any2api successfully in these fields to implement the APIfication of Python scripts, Bash scripts, Chef cookbooks, Fortran programs (still used in academia), etc. Technically, we provided auto-generated Dockerized REST APIs as well as RPC APIs for these executables to make their functionality usable on a higher level. These APIs clearly simplify the orchestration of different kinds of executables.
Get Johannes’s stories in your inbox
Join Medium for free to get updates from this writer.
During our research activities, we gained a lot of valuable experience in dynamically providing APIs for lower-level code and executables. But what’s even more important: we see a lot of potential to broaden the scope of any2api to completely change the way how APIs are created and maintained.
What’s next
The next step for any2api is to evolve into an open ecosystem of composable API bricks, including reusable wrappers, adapters and plugins. Instead of using basic API development frameworks to build specific kinds of APIs from scratch (e.g. REST or messaging APIs), the API bricks simplify the process of creating diverse APIs. For example, a Python wrapper is used to bring a simple .py script into the ecosystem. Then, a specific adapter such as a REST adapter is utilized to expose the script’s functionality through an API. Plugins can optionally add more functionality to the provided API such as authentication. In addition, another adapter can be used to make the same functionality available in a different way, fostering API diversity:
API diversity is key because there is no ‘one-fits-all’ kind of API. In certain cases, REST is a good choice, but sometimes messaging, RPC or streaming APIs work much better.
API bricks are generic, reusable and configurable. They implement best practices how certain kinds of APIs are built, for example, how to implement long-running tasks with REST or how to emulate a synchronous invocation with a messaging API. This helps to avoid common and reoccurring issues that happen a lot when developing APIs from scratch.
More details and code to come!







