Skip to main content

An organized way to create REST APIs

Project description

Lapis is a file-based REST API framework inspired by Modern Serverless Cloud Services

To create a basic Lapis server, create a folder called api and create python script named path.py then within your main folder create a python script to start the server (we will call this script main.py in our example)

Your project directory should look like this:

project-root/
|-- api/
|  |-- path.py
`-- main.py

Then within the api/path.py file create your first GET api endpoint by adding the following code:

from lapis import Response, Request

async def GET (req : Request) -> Response:
    return Response(status_code=200, body="Hello World!")

Finally by adding the following code to main.py and running it:

from lapis import Lapis

server = Lapis()

server.run("localhost", 80)

You can now send an HTTP GET request to localhost:80 and recieve the famous Hello World! response!

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

lapis_api-0.2.1.post1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lapis_api-0.2.1.post1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file lapis_api-0.2.1.post1.tar.gz.

File metadata

  • Download URL: lapis_api-0.2.1.post1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lapis_api-0.2.1.post1.tar.gz
Algorithm Hash digest
SHA256 6e6273b579a45e05ae849f1cf23f477621ea4ae8f3d1cc46fc0dc37fe324e1ef
MD5 c94ff53fe919feae7905c267d0eaa615
BLAKE2b-256 36ccdd4c1197af656c8eda59e44932ac142ee6c44548a6821b980c44e3c7beed

See more details on using hashes here.

Provenance

The following attestation bundles were made for lapis_api-0.2.1.post1.tar.gz:

Publisher: python-publish.yml on CQVan/Lapis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lapis_api-0.2.1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for lapis_api-0.2.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 2cec81c096e9b2d0d09a85358ea91e4bd1ce1fb6dfc3341921a0e2357067acd6
MD5 43491bacb4a92e2bf93f15b462e13c51
BLAKE2b-256 3bfee6cabd3993525dcf2d10aee3a192e29ad3f99323405ea9540ab470045749

See more details on using hashes here.

Provenance

The following attestation bundles were made for lapis_api-0.2.1.post1-py3-none-any.whl:

Publisher: python-publish.yml on CQVan/Lapis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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