Skip to main content

A simple WSGI-compliant web application layer framework

Project description

This is a test project, upload the user test package to pypi

Project description

myWeb is an extremely simple but WSGI-compliant web application framework. myWeb uses decorators to register routes, not only supports static routes, but also supports dynamic route resolution. You can make it follow the parameters directly in the url.

Installing

Install using pip

pip3 install -i https://test.pypi.org/simple/ JuejinPdudoProject

Simple static routing case

code:

from JuejinPdudoSampleWeb import myWeb

@myWeb.routes(path="/index",methods="all")
def index(r):
    return "hello world\n"

def main():
    myWeb.run("",8888)


if __name__ == '__main__':
    main()

tests:

pdudo$ curl -v 127.0.0.1:8888/index
*   Trying 127.0.0.1:8888...
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /index HTTP/1.1
> Host: 127.0.0.1:8888
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Date: Sat, 06 May 2023 06:21:17 GMT
< Server: WSGIServer/0.2 CPython/3.11.0
< Content-Length: 12
<
hello world
* Closing connection 0
pdudo$

Simple Dynamic Routing Case

from JuejinPdudoSampleWeb import myWeb

@myWeb.routes(path="/hello/{name}",methods="all",regular=True)
def hello(r):
    name = r.regular[0]
    return "hello %s\n" % (name)


def main():
    myWeb.run("",8888)


if __name__ == '__main__':
    main()

tests:

pdudo$ curl -v 127.0.0.1:8888/hello/pdudo
*   Trying 127.0.0.1:8888...
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /hello/pdudo HTTP/1.1
> Host: 127.0.0.1:8888
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Date: Sat, 06 May 2023 06:22:11 GMT
< Server: WSGIServer/0.2 CPython/3.11.0
< Content-Length: 12
<
hello pdudo
* Closing connection 0
pdudo$

End

Good luck with your use.

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

python-test-struct-0.0.1.tar.gz (969.5 kB view details)

Uploaded Source

Built Distribution

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

python_test_struct-0.0.1-py3-none-any.whl (967.7 kB view details)

Uploaded Python 3

File details

Details for the file python-test-struct-0.0.1.tar.gz.

File metadata

  • Download URL: python-test-struct-0.0.1.tar.gz
  • Upload date:
  • Size: 969.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for python-test-struct-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2aa288a288145cfa0647889d8317cc13b7d9794077c4539cd03e33ab4d3b3df8
MD5 52ca71d2e4820b3396d8e7ad5ea5e9a7
BLAKE2b-256 4c151590b87e97fe1d91e988f19bd881852a7ee5a0eb5c6cd37afda4cf0f58d8

See more details on using hashes here.

File details

Details for the file python_test_struct-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_test_struct-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f126c901e5bd241526eb265a773785d129f1ccecb8628bf33e86999ff3c2116
MD5 08981a62ab14b1ee13b035840f4d175b
BLAKE2b-256 0d5a24bec30f37ff14a57d8becf70d98042f913dcb97e08e018f55fae3ac8da7

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