lapis-api 0.2.0__tar.gz → 0.2.1.post1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/.github/workflows/pylint.yml +23 -23
  2. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/.github/workflows/python-publish.yml +70 -70
  3. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/.gitignore +3 -2
  4. lapis_api-0.2.1.post1/.pylintrc +2 -0
  5. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/LICENSE +20 -20
  6. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/PKG-INFO +2 -1
  7. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/README.md +32 -32
  8. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/pyproject.toml +30 -29
  9. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/Lapis.egg-info/PKG-INFO +14 -14
  10. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/lapis/__init__.py +10 -10
  11. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/lapis/lapis.py +316 -273
  12. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/lapis/protocols/http1.py +266 -251
  13. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/lapis/protocols/websocket.py +555 -544
  14. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/lapis/server_types.py +177 -172
  15. lapis_api-0.2.1.post1/tests/basic_load_test/api/other/path.py +5 -0
  16. lapis_api-0.2.1.post1/tests/basic_load_test/api/path.py +5 -0
  17. {lapis_api-0.2.0/tests/websocket_test → lapis_api-0.2.1.post1/tests/basic_load_test}/test.py +5 -5
  18. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/server_config_test/config.json +3 -3
  19. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/server_config_test/other/api/path.py +5 -4
  20. lapis_api-0.2.1.post1/tests/server_config_test/test.py +6 -0
  21. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/slugs_test/api/[slug1]/other/[slug2]/path.py +5 -4
  22. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/slugs_test/api/[slug1]/path.py +5 -4
  23. lapis_api-0.2.1.post1/tests/slugs_test/api/[slug2]/maybe/[slug3]/path.py +5 -0
  24. lapis_api-0.2.1.post1/tests/slugs_test/api/path.py +0 -0
  25. {lapis_api-0.2.0/tests/streamed_response_test → lapis_api-0.2.1.post1/tests/slugs_test}/test.py +5 -5
  26. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/streamed_response_test/api/path.py +16 -15
  27. {lapis_api-0.2.0/tests/basic_load_test → lapis_api-0.2.1.post1/tests/streamed_response_test}/test.py +5 -5
  28. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/tests/websocket_test/api/path.py +17 -15
  29. {lapis_api-0.2.0/tests/slugs_test → lapis_api-0.2.1.post1/tests/websocket_test}/test.py +5 -5
  30. lapis_api-0.2.0/.pylintrc +0 -2
  31. lapis_api-0.2.0/tests/basic_load_test/api/other/path.py +0 -4
  32. lapis_api-0.2.0/tests/basic_load_test/api/path.py +0 -4
  33. lapis_api-0.2.0/tests/server_config_test/test.py +0 -6
  34. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/.github/CONTRIBUTIONS.md +0 -0
  35. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/Lapis.egg-info/SOURCES.txt +0 -0
  36. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/Lapis.egg-info/dependency_links.txt +0 -0
  37. {lapis_api-0.2.0 → lapis_api-0.2.1.post1}/src/Lapis.egg-info/top_level.txt +0 -0
@@ -1,23 +1,23 @@
1
- name: Pylint
2
-
3
- on: [push]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- strategy:
9
- matrix:
10
- python-version: ["3.8", "3.9", "3.10"]
11
- steps:
12
- - uses: actions/checkout@v4
13
- - name: Set up Python ${{ matrix.python-version }}
14
- uses: actions/setup-python@v3
15
- with:
16
- python-version: ${{ matrix.python-version }}
17
- - name: Install dependencies
18
- run: |
19
- python -m pip install --upgrade pip
20
- pip install pylint
21
- - name: Analysing the code with pylint
22
- run: |
23
- pylint .
1
+ name: Pylint
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.8", "3.9", "3.10"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Set up Python ${{ matrix.python-version }}
14
+ uses: actions/setup-python@v3
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Install dependencies
18
+ run: |
19
+ python -m pip install --upgrade pip
20
+ pip install pylint
21
+ - name: Analysing the code with pylint
22
+ run: |
23
+ pylint .
@@ -1,70 +1,70 @@
1
- # This workflow will upload a Python Package to PyPI when a release is created
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
-
4
- # This workflow uses actions that are not certified by GitHub.
5
- # They are provided by a third-party and are governed by
6
- # separate terms of service, privacy policy, and support
7
- # documentation.
8
-
9
- name: Upload Python Package
10
-
11
- on:
12
- release:
13
- types: [published]
14
-
15
- permissions:
16
- contents: read
17
-
18
- jobs:
19
- release-build:
20
- runs-on: ubuntu-latest
21
-
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - uses: actions/setup-python@v5
26
- with:
27
- python-version: "3.x"
28
-
29
- - name: Build release distributions
30
- run: |
31
- # NOTE: put your own distribution build steps here.
32
- python -m pip install build
33
- python -m build
34
-
35
- - name: Upload distributions
36
- uses: actions/upload-artifact@v4
37
- with:
38
- name: release-dists
39
- path: dist/
40
-
41
- pypi-publish:
42
- runs-on: ubuntu-latest
43
- needs:
44
- - release-build
45
- permissions:
46
- # IMPORTANT: this permission is mandatory for trusted publishing
47
- id-token: write
48
-
49
- # Dedicated environments with protections for publishing are strongly recommended.
50
- # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
- environment:
52
- name: pypi
53
- # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
- # url: https://pypi.org/p/YOURPROJECT
55
- #
56
- # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
- # ALTERNATIVE: exactly, uncomment the following line instead:
58
- # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
-
60
- steps:
61
- - name: Retrieve release distributions
62
- uses: actions/download-artifact@v4
63
- with:
64
- name: release-dists
65
- path: dist/
66
-
67
- - name: Publish release distributions to PyPI
68
- uses: pypa/gh-action-pypi-publish@release/v1
69
- with:
70
- packages-dir: dist/
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -1,2 +1,3 @@
1
- __pycache__/
2
- venv/
1
+ __pycache__/
2
+ venv/
3
+ TODO.md
@@ -0,0 +1,2 @@
1
+ [MASTER]
2
+ ignore=tests
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) [2025] [Chandler Van]
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) [2025] [Chandler Van]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lapis-api
3
- Version: 0.2.0
3
+ Version: 0.2.1.post1
4
4
  Summary: An organized way to create REST APIs
5
5
  Project-URL: Homepage, https://github.com/CQVan/Lapis
6
+ Project-URL: Wiki, https://github.com/CQVan/Lapis/wiki
6
7
  Project-URL: Issues, https://github.com/CQVan/Lapis/issues
7
8
  Author: Chandler Van
8
9
  License: MIT
@@ -1,32 +1,32 @@
1
- Lapis is a file-based REST API framework inspired by Modern Serverless Cloud Services
2
-
3
- To create a basic Lapis server, create a folder called *api* and create python script named *path.py*
4
- then within your main folder create a python script to start the server (we will call this script *main.py* in our example)
5
-
6
- Your project directory should look like this:
7
-
8
- ```
9
- project-root/
10
- |-- api/
11
- | |-- path.py
12
- `-- main.py
13
- ```
14
-
15
- Then within the *api/path.py* file create your first GET api endpoint by adding the following code:
16
- ```py
17
- from lapis import Response, Request
18
-
19
- async def GET (req : Request) -> Response:
20
- return Response(status_code=200, body="Hello World!")
21
- ```
22
-
23
- Finally by adding the following code to *main.py* and running it:
24
- ```py
25
- from lapis import Lapis
26
-
27
- server = Lapis()
28
-
29
- server.run("localhost", 80)
30
- ```
31
-
32
- You can now send an HTTP GET request to localhost:80 and recieve the famous **Hello World!** response!
1
+ Lapis is a file-based REST API framework inspired by Modern Serverless Cloud Services
2
+
3
+ To create a basic Lapis server, create a folder called *api* and create python script named *path.py*
4
+ then within your main folder create a python script to start the server (we will call this script *main.py* in our example)
5
+
6
+ Your project directory should look like this:
7
+
8
+ ```
9
+ project-root/
10
+ |-- api/
11
+ | |-- path.py
12
+ `-- main.py
13
+ ```
14
+
15
+ Then within the *api/path.py* file create your first GET api endpoint by adding the following code:
16
+ ```py
17
+ from lapis import Response, Request
18
+
19
+ async def GET (req : Request) -> Response:
20
+ return Response(status_code=200, body="Hello World!")
21
+ ```
22
+
23
+ Finally by adding the following code to *main.py* and running it:
24
+ ```py
25
+ from lapis import Lapis
26
+
27
+ server = Lapis()
28
+
29
+ server.run("localhost", 80)
30
+ ```
31
+
32
+ You can now send an HTTP GET request to localhost:80 and recieve the famous **Hello World!** response!
@@ -1,30 +1,31 @@
1
- [build-system]
2
- requires = ["hatchling >= 1.26"]
3
- build-backend = "hatchling.build"
4
-
5
- [tool.hatch.build.targets.wheel]
6
- packages = ["src/lapis"]
7
-
8
- [project]
9
- name = "lapis-api"
10
- version = "0.2.0"
11
- description = "An organized way to create REST APIs"
12
- readme = "README.md"
13
- requires-python = ">=3.9"
14
- authors = [
15
- { name = "Chandler Van" },
16
- ]
17
-
18
-
19
-
20
- license = {text = "MIT"}
21
-
22
- classifiers = [
23
- "Programming Language :: Python :: 3",
24
- "Operating System :: OS Independent",
25
- "License :: OSI Approved :: MIT License",
26
- ]
27
-
28
- [project.urls]
29
- Homepage = "https://github.com/CQVan/Lapis"
1
+ [build-system]
2
+ requires = ["hatchling >= 1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [tool.hatch.build.targets.wheel]
6
+ packages = ["src/lapis"]
7
+
8
+ [project]
9
+ name = "lapis-api"
10
+ version = "0.2.1.post1"
11
+ description = "An organized way to create REST APIs"
12
+ readme = "README.md"
13
+ requires-python = ">=3.9"
14
+ authors = [
15
+ { name = "Chandler Van" },
16
+ ]
17
+
18
+
19
+
20
+ license = {text = "MIT"}
21
+
22
+ classifiers = [
23
+ "Programming Language :: Python :: 3",
24
+ "Operating System :: OS Independent",
25
+ "License :: OSI Approved :: MIT License",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/CQVan/Lapis"
30
+ Wiki = "https://github.com/CQVan/Lapis/wiki"
30
31
  Issues = "https://github.com/CQVan/Lapis/issues"
@@ -1,14 +1,14 @@
1
- Metadata-Version: 2.4
2
- Name: Lapis
3
- Version: 0.1.0
4
- Summary: A small example package
5
- Author: Chandler Van
6
- Project-URL: Homepage, https://github.com/CQVan/Lapis
7
- Project-URL: Issues, https://github.com/CQVan/Lapis/issues
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Operating System :: OS Independent
10
- Classifier: License :: OSI Approved :: MIT License
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE.bak
14
- Dynamic: license-file
1
+ Metadata-Version: 2.4
2
+ Name: Lapis
3
+ Version: 0.1.0
4
+ Summary: A small example package
5
+ Author: Chandler Van
6
+ Project-URL: Homepage, https://github.com/CQVan/Lapis
7
+ Project-URL: Issues, https://github.com/CQVan/Lapis/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE.bak
14
+ Dynamic: license-file
@@ -1,10 +1,10 @@
1
- """Lapis web framework core exports.
2
-
3
- This module exposes the primary public classes for consumers of the
4
- lapis package.
5
- """
6
-
7
- from .lapis import Lapis
8
- from .server_types import ServerConfig, Protocol
9
- from .protocols.http1 import Request, Response, StreamedResponse
10
- from .protocols.websocket import WebSocketProtocol, WSPortal
1
+ """Lapis web framework core exports.
2
+
3
+ This module exposes the primary public classes for consumers of the
4
+ lapis package.
5
+ """
6
+
7
+ from .lapis import Lapis
8
+ from .server_types import ServerConfig, Protocol
9
+ from .protocols.http1 import Request, Response, StreamedResponse
10
+ from .protocols.websocket import WebSocketProtocol, WSPortal