Skip to main content

eazy python framework

Project description

Myapi framework

Eazy python framework for beginers

pip install myapiframework

# main.py
from myapiframework import MyAPI
from myapiframework import Response
from myapiframework import parse_json, parse_form

app = MyAPI()


@app.get('/')
def home(request):
    data = {'message': 'hello'}
    return Response(status=200, data=data)

# get post with id 
@app.get('/post/{id}/')
def get_post(request, id):
    post = {
        'id': id,
        'name': 'myapi',
        'description': 'new framework myapi'
    }
    return Response(status=200, data=post)


# create post
@app.post('/post/')
def create_post(request):
    if request.content_type == 'application/json':
        data = parse_json(request.data)
        return Response(status=201, data=data)
    data = parse_form(request.data, request)
    return Response(status=201, data=data)

gunicorn main:app

methods:

  • get
  • post
  • put
  • patch

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myapiframework-1.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file myapiframework-1.0.tar.gz.

File metadata

  • Download URL: myapiframework-1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for myapiframework-1.0.tar.gz
Algorithm Hash digest
SHA256 c5464742e04134d9a8357e5bca6de4db8de79aef431e97d657927830a7080c8d
MD5 fbfa8c990a5d48fdc1727f73e9c365f8
BLAKE2b-256 e91a86daf4aef54db650e26c35d5ce812a820d08f88bbcfda8dfca99e871ff8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page