An api module generator.
Project description
apininja
apininja
is a simple CLI automation tool that generates a small boilerplate module
that serves as api for database models or other models. Currently it generates the basic
CRUD operations as well as functions for serializing a single object to dictionary.
Sample Output
A sample output for apininja MyModel
# API Created for my_model
def serialize_my_model(data):
return {"id": data.id}
def serialize_my_models(lst):
serialized = []
for item in lst:
serialized.append(serialize_my_model(item))
return serialized
def my_model_list_api(lst):
return serialize_my_models(lst)
def my_model_detail_api(data):
return serialize_my_model(data)
def my_model_create_api(*args, **kwargs):
pass
def my_model_update_api(*args, **kwargs):
pass
def my_model_delete_api(*args):
pass
Installation
pip install apininja
Usage
apininja UserModel
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apininja-0.1.9.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file apininja-0.1.9.tar.gz
.
File metadata
- Download URL: apininja-0.1.9.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66e505734dd27e976720489583d98078fd8be0699b7345fe5dcf8d7d8e7ebe61 |
|
MD5 | 3318c786e2691059950ef67c1d8cc6f8 |
|
BLAKE2b-256 | c5fd2e7a553f635c818afb3ec40365f5e4aaffe1a4f2e66d07547f05e7493d42 |
File details
Details for the file apininja-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: apininja-0.1.9-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55858695047676790ef1fa1a44719eccc3a4dc0b92a9af4616ebce6cfbe33aec |
|
MD5 | 0728e27219620cbded2a61b202d4c5d6 |
|
BLAKE2b-256 | 2c7f705ca067e662a7130fcccf38559bf7c5aaa22ace4a8b7c8df2b98b99ee94 |