pyhttplib 0.0.0__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. pyhttplib-0.0.0/.codecov.yml +10 -0
  2. pyhttplib-0.0.0/.coveragerc +8 -0
  3. pyhttplib-0.0.0/.github/workflows/dependabot-auto-merge.yml +31 -0
  4. pyhttplib-0.0.0/.github/workflows/publish.yml +274 -0
  5. pyhttplib-0.0.0/.github/workflows/pytest.yml +48 -0
  6. pyhttplib-0.0.0/.gitignore +12 -0
  7. pyhttplib-0.0.0/.vscode/settings.json +10 -0
  8. pyhttplib-0.0.0/COPYING.md +131 -0
  9. pyhttplib-0.0.0/PKG-INFO +48 -0
  10. pyhttplib-0.0.0/README.md +29 -0
  11. pyhttplib-0.0.0/VERSION +1 -0
  12. pyhttplib-0.0.0/coverage.xml +761 -0
  13. pyhttplib-0.0.0/examples/chat/main.py +432 -0
  14. pyhttplib-0.0.0/examples/chat/static/404.html +76 -0
  15. pyhttplib-0.0.0/examples/chat/static/500.html +16 -0
  16. pyhttplib-0.0.0/examples/chat/static/index.html +911 -0
  17. pyhttplib-0.0.0/examples/chat/static/login.html +120 -0
  18. pyhttplib-0.0.0/examples/chat/static/register.html +133 -0
  19. pyhttplib-0.0.0/examples/chat/static/styles.css +787 -0
  20. pyhttplib-0.0.0/httplib.py +2089 -0
  21. pyhttplib-0.0.0/pyhttplib.egg-info/PKG-INFO +48 -0
  22. pyhttplib-0.0.0/pyhttplib.egg-info/SOURCES.txt +36 -0
  23. pyhttplib-0.0.0/pyhttplib.egg-info/dependency_links.txt +1 -0
  24. pyhttplib-0.0.0/pyhttplib.egg-info/top_level.txt +1 -0
  25. pyhttplib-0.0.0/pyproject.toml +7 -0
  26. pyhttplib-0.0.0/requirements.txt +1 -0
  27. pyhttplib-0.0.0/scripts/get_version.py +72 -0
  28. pyhttplib-0.0.0/scripts/print_with_lines.py +5 -0
  29. pyhttplib-0.0.0/scripts/prune_wheels.py +56 -0
  30. pyhttplib-0.0.0/setup.cfg +27 -0
  31. pyhttplib-0.0.0/setup.py +132 -0
  32. pyhttplib-0.0.0/tests/test_core.py +81 -0
  33. pyhttplib-0.0.0/tests/test_coverage_boost.py +479 -0
  34. pyhttplib-0.0.0/tests/test_final_coverage.py +424 -0
  35. pyhttplib-0.0.0/tests/test_more_core.py +102 -0
  36. pyhttplib-0.0.0/tests/test_remaining_coverage.py +479 -0
  37. pyhttplib-0.0.0/tests/test_ws_and_misc.py +95 -0
@@ -0,0 +1,10 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ target: 100%
6
+ precision: 2
7
+ range: 80..100
8
+ ignore:
9
+ - "tests/*"
10
+ - "scripts/*"
@@ -0,0 +1,8 @@
1
+ [run]
2
+ omit =
3
+ */tests/*
4
+
5
+ [report]
6
+ exclude_lines =
7
+ pragma: no cover
8
+ if __name__ == .__main__:
@@ -0,0 +1,31 @@
1
+
2
+ name: Dependabot auto-merge
3
+
4
+ on:
5
+ pull_request_target:
6
+ types: [opened, synchronize, reopened, ready_for_review]
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ automerge:
14
+ if: github.event.pull_request.user.login == 'dependabot[bot]'
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Fetch Dependabot metadata
19
+ id: metadata
20
+ uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
21
+ with:
22
+ github-token: ${{ secrets.GITHUB_TOKEN }}
23
+
24
+ - name: Enable auto-merge
25
+ if: |
26
+ steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
27
+ steps.metadata.outputs.update-type == 'version-update:semver-minor'
28
+ env:
29
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ PR_URL: ${{ github.event.pull_request.html_url }}
31
+ run: gh pr merge --auto --squash "$PR_URL"
@@ -0,0 +1,274 @@
1
+ name: Build
2
+
3
+ on: push
4
+
5
+ # This workflow uses actions that are not certified by GitHub.
6
+ # They are provided by a third-party and are governed by
7
+ # separate terms of service, privacy policy, and support
8
+ # documentation.
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ ensure-tag:
15
+ runs-on: ubuntu-latest
16
+ outputs:
17
+ should_build: ${{ steps.detect.outputs.should_build }}
18
+ # pyhttplib_version and release_display_name are computed in the build job
19
+ # to keep version logic centralized in scripts/get_version.py
20
+ # This job needs write permissions to push tags back to the repository
21
+ permissions:
22
+ contents: write
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+ with:
27
+ fetch-depth: 0
28
+
29
+ - name: Ensure release has a tag
30
+ id: ensure_tag
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ run: |
34
+ set -euo pipefail
35
+ RELEASE_TAG="${{ github.event.release.tag_name }}"
36
+ echo "Release tag (from event): '$RELEASE_TAG'"
37
+
38
+ if [ -n "$RELEASE_TAG" ]; then
39
+ echo "Release already has tag: $RELEASE_TAG"
40
+ echo "should_build=true" >> "$GITHUB_OUTPUT"
41
+ exit 0
42
+ fi
43
+
44
+ # Reuse the same detection logic the later step uses to find a candidate
45
+ FOUND=0
46
+ TAG=""
47
+ for commit in $(git rev-list --max-count=200 HEAD); do
48
+ msg=$(git log -1 --pretty=%B "$commit" | sed -n '1p' | tr -d '\r')
49
+ if echo "$msg" | grep -q "-"; then
50
+ candidate=$(echo "$msg" | cut -d'-' -f1 | tr -d '[:space:]')
51
+ if echo "$candidate" | grep -E -q '^[0-9]+[A-Za-z]?$'; then
52
+ FOUND=1
53
+ TAG="$candidate"
54
+ break
55
+ fi
56
+ fi
57
+ done
58
+
59
+ if [ "$FOUND" -eq 0 ]; then
60
+ echo "No matching commit found; should_build=false" >> "$GITHUB_OUTPUT"
61
+ exit 0
62
+ fi
63
+
64
+ echo "Found tag candidate from commits: $TAG"
65
+
66
+ # Push tag only if it doesn't exist remotely
67
+ if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then
68
+ echo "Tag $TAG already exists on remote"
69
+ else
70
+ echo "Creating tag: $TAG"
71
+ git config user.name "github-actions[bot]"
72
+ git config user.email "github-actions[bot]@users.noreply.github.com"
73
+ git tag -a "$TAG" -m "Tag for release $TAG"
74
+ git push origin "refs/tags/$TAG"
75
+ fi
76
+ echo "should_build=true" >> "$GITHUB_OUTPUT"
77
+ # Export the chosen tag as a step output so later steps can use it
78
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
79
+
80
+ - name: Detect release candidate in commits
81
+ id: detect
82
+ run: |
83
+ set -euo pipefail
84
+ # If CI explicitly sets PYHTTPLIB_VERSION, build
85
+ if [ -n "${PYHTTPLIB_VERSION-}" ]; then
86
+ echo "should_build=true" >> "$GITHUB_OUTPUT"
87
+ exit 0
88
+ fi
89
+ FOUND=0
90
+ for commit in $(git rev-list --max-count=200 HEAD); do
91
+ msg=$(git log -1 --pretty=%B "$commit" | sed -n '1p' | tr -d '\r')
92
+ if echo "$msg" | grep -q "-"; then
93
+ candidate=$(echo "$msg" | cut -d'-' -f1 | tr -d '[:space:]')
94
+ if echo "$candidate" | grep -E -q '^[0-9]+[A-Za-z]?$'; then
95
+ FOUND=1
96
+ break
97
+ fi
98
+ fi
99
+ done
100
+ if [ "$FOUND" -eq 1 ]; then
101
+ echo "should_build=true" >> "$GITHUB_OUTPUT"
102
+ else
103
+ echo "should_build=false" >> "$GITHUB_OUTPUT"
104
+ fi
105
+
106
+ # The numeric package version is determined in the build job using
107
+ # scripts/get_version.py; removing the set_version step keeps the
108
+ # ensure-tag job focused on tagging only and avoids cross-job
109
+ # heredoc/python invocation complexity.
110
+
111
+ build:
112
+ runs-on: ubuntu-latest
113
+ needs:
114
+ - ensure-tag
115
+ if: needs.ensure-tag.outputs.should_build == 'true'
116
+ outputs:
117
+ pyhttplib_version: ${{ steps.get_version.outputs.pyhttplib_version }}
118
+ release_display_name: ${{ steps.get_version.outputs.release_display_name }}
119
+
120
+ steps:
121
+ - uses: actions/checkout@v4
122
+
123
+ - uses: actions/setup-python@v5
124
+ with:
125
+ python-version: "3.x"
126
+
127
+ - name: Determine package version
128
+ id: get_version
129
+ run: |
130
+ set -euo pipefail
131
+ python -c "from scripts.get_version import get_pyhttplib_version,get_release_display_name; print(get_pyhttplib_version()); print(get_release_display_name())" > /tmp/_vers
132
+ echo "pyhttplib_version=$(sed -n '1p' /tmp/_vers)" >> "$GITHUB_OUTPUT"
133
+ echo "release_display_name=$(sed -n '2p' /tmp/_vers)" >> "$GITHUB_OUTPUT"
134
+
135
+ - name: Log resolved version
136
+ run: |
137
+ set -euo pipefail
138
+ echo "Resolved PYHTTPLIB_VERSION=${{ steps.get_version.outputs.pyhttplib_version }}"
139
+ echo "Resolved RELEASE_DISPLAY_NAME=${{ steps.get_version.outputs.release_display_name }}"
140
+ # Append to the GitHub Actions job summary for quick visibility
141
+ if [ -n "${GITHUB_STEP_SUMMARY-}" ]; then
142
+ echo "### pyhttplib version info" >> "$GITHUB_STEP_SUMMARY"
143
+ echo "* PYHTTPLIB_VERSION: ${{ steps.get_version.outputs.pyhttplib_version }}" >> "$GITHUB_STEP_SUMMARY"
144
+ echo "* RELEASE_DISPLAY_NAME: ${{ steps.get_version.outputs.release_display_name }}" >> "$GITHUB_STEP_SUMMARY"
145
+ fi
146
+
147
+ - name: Build release distributions
148
+ run: |
149
+ set -euo pipefail
150
+ # Clean any previous build artifacts so we don't upload stale packages
151
+ rm -rf dist || true
152
+ python -m pip install --upgrade build
153
+ python -m build
154
+
155
+ - name: Upload distributions
156
+ uses: actions/upload-artifact@v4
157
+ with:
158
+ name: release-dists
159
+ path: dist/
160
+
161
+ pypi-publish:
162
+ runs-on: ubuntu-latest
163
+ needs:
164
+ - build
165
+ if: needs.build.result == 'success' && needs.ensure-tag.outputs.should_build == 'true'
166
+
167
+ # Dedicated environments with protections for publishing are strongly recommended.
168
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
169
+ environment:
170
+ name: pypi
171
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
172
+ url: https://pypi.org/project/pyhttplib
173
+ #
174
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
175
+ # ALTERNATIVE: exactly, uncomment the following line instead:
176
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
177
+
178
+ permissions:
179
+ id-token: write
180
+
181
+ steps:
182
+ - name: Checkout repository
183
+ uses: actions/checkout@v4
184
+ with:
185
+ fetch-depth: 0
186
+ - name: Determine version and check PyPI
187
+ id: check_pypi
188
+ run: |
189
+ set -euo pipefail
190
+ # Prefer the canonical version discovered during the build job.
191
+ if [ -n "${{ needs.build.outputs.pyhttplib_version }}" ]; then
192
+ VER="${{ needs.build.outputs.pyhttplib_version }}"
193
+ echo "Using version from build job: $VER"
194
+ else
195
+ # Fall back to inferring from the sdist filename
196
+ SDIST=$(ls dist/*.tar.gz 2>/dev/null | head -n 1 || true)
197
+ if [ -z "$SDIST" ]; then
198
+ echo "No sdist found in dist/; cannot determine version" >&2
199
+ echo "skip_publish=true" >> "$GITHUB_OUTPUT"
200
+ exit 0
201
+ fi
202
+ FNAME=$(basename "$SDIST")
203
+ VER=$(echo "$FNAME" | sed -E 's/^[Pp][Yy][Hh][Tt][Tt][Pp][Ll][Ii][Bb]-//; s/\.tar\.gz$//')
204
+ fi
205
+ echo "version=$VER" >> "$GITHUB_OUTPUT"
206
+ echo "Version to publish: $VER"
207
+
208
+ # Query PyPI for the version; 200 means it already exists.
209
+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/pyhttplib/$VER/json" || true)
210
+ if [ "$STATUS" = "200" ]; then
211
+ echo "Version $VER already exists on PyPI; skipping publish"
212
+ echo "skip_publish=true" >> "$GITHUB_OUTPUT"
213
+ else
214
+ echo "skip_publish=false" >> "$GITHUB_OUTPUT"
215
+ fi
216
+
217
+ - name: Clean dist directory
218
+ if: steps.check_pypi.outputs.skip_publish != 'true'
219
+ run: |
220
+ set -euo pipefail
221
+ rm -rf dist || true
222
+
223
+ - name: Retrieve release distributions
224
+ if: steps.check_pypi.outputs.skip_publish != 'true'
225
+ uses: actions/download-artifact@v4
226
+ with:
227
+ name: release-dists
228
+ path: dist/
229
+
230
+ - name: Select latest artifact and prune others
231
+ if: steps.check_pypi.outputs.skip_publish != 'true'
232
+ run: |
233
+ set -euo pipefail
234
+ echo "Listing dist contents before selection:"
235
+ ls -l dist || true
236
+
237
+ # Find newest sdist by modification time
238
+ SDIST=$(ls -t dist/*.tar.gz 2>/dev/null | head -n 1 || true)
239
+ if [ -z "$SDIST" ]; then
240
+ echo "No sdist found in dist/; nothing to publish" >&2
241
+ ls -l dist || true
242
+ exit 1
243
+ fi
244
+
245
+ echo "Selected sdist: $SDIST"
246
+ FNAME=$(basename "$SDIST")
247
+ # Normalize project name prefix and strip .tar.gz to obtain version
248
+ VER=$(echo "$FNAME" | sed -E 's/^[Pp][Yy]?[Nn]?[Ee]?[Tt]?[Ss]?[Pp]?[Ll]?[Ii]?[Tt]-//; s/\.tar\.gz$//')
249
+ echo "Determined version: $VER"
250
+
251
+ # Remove other sdists not matching the selected version
252
+ for f in dist/*.tar.gz; do
253
+ if [ -f "$f" ] && [ "$f" != "$SDIST" ]; then
254
+ echo "Removing extra sdist: $f"
255
+ rm -f "$f"
256
+ fi
257
+ done
258
+
259
+ echo "dist/ contents after pruning:"
260
+ ls -l dist || true
261
+
262
+ - name: Prune wheels by METADATA Version
263
+ if: steps.check_pypi.outputs.skip_publish != 'true'
264
+ env:
265
+ SELECTED_VER: ${{ steps.check_pypi.outputs.version }}
266
+ run: |
267
+ set -euo pipefail
268
+ python scripts/prune_wheels.py
269
+
270
+ - name: Publish to PyPI (OIDC)
271
+ if: steps.check_pypi.outputs.skip_publish != 'true'
272
+ uses: pypa/gh-action-pypi-publish@release/v1
273
+ with:
274
+ packages-dir: dist/
@@ -0,0 +1,48 @@
1
+ name: pytest
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: '3.11'
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install pytest pytest-asyncio coverage codecov
25
+
26
+ - name: Run tests with coverage
27
+ run: |
28
+ python -m coverage run -m pytest
29
+ python -m coverage xml -o coverage.xml
30
+ python -m coverage report -m
31
+
32
+ - name: Upload coverage to Codecov
33
+ uses: codecov/codecov-action@v4
34
+ with:
35
+ # Upload the generated coverage.xml. For public repos a token is
36
+ # not required, but you can add CODECOV_TOKEN as a secret if needed.
37
+ files: ./coverage.xml
38
+ # Add a flag/name so uploads are easy to identify in Codecov UI
39
+ flags: unittests
40
+ name: pytest-coverage
41
+ # Do not fail the CI if upload to Codecov has an issue (helps debug badge problems)
42
+ fail_ci_if_error: false
43
+
44
+ - name: Show coverage.xml (first 40 lines) # helps debug Codecov uploads
45
+ if: always()
46
+ run: |
47
+ echo '--- coverage.xml (preview) ---'
48
+ head -n 40 coverage.xml || true
@@ -0,0 +1,12 @@
1
+ examples/chat/users.json
2
+ *.pyc
3
+ *.pyd
4
+ *__*
5
+ *-info*
6
+ dist
7
+ *cache
8
+ *.gz
9
+ *.whl
10
+ dist/
11
+ *.egg-info/
12
+ .coverage
@@ -0,0 +1,10 @@
1
+ {
2
+ "python.analysis.typeCheckingMode": "strict",
3
+ "python.REPL.enableREPLSmartSend": false,
4
+ "python.testing.pytestArgs": [
5
+ "tests"
6
+ ],
7
+ "python.testing.unittestEnabled": false,
8
+ "python.testing.pytestEnabled": true,
9
+ "python.defaultInterpreterPath": "d:\\GitHub\\http\\.venv\\Scripts\\python.exe"
10
+ }
@@ -0,0 +1,131 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyhttplib
3
+ Version: 0.0.0
4
+ Summary: pyhttplib
5
+ Home-page: https://github.com/Omena0/http
6
+ Author: Omena0
7
+ License: PolyForm Noncommercial 1.0.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: License :: Other/Proprietary License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+ License-File: COPYING.md
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: license-file
18
+ Dynamic: summary
19
+
20
+
21
+ # httplib
22
+
23
+ [![pytest](https://github.com/Omena0/http/actions/workflows/pytest.yml/badge.svg)](https://github.com/Omena0/http/actions/workflows/pytest.yml)
24
+ [![codecov](https://codecov.io/gh/Omena0/http/branch/master/graph/badge.svg?token=)](https://codecov.io/gh/Omena0/http)
25
+
26
+ Simple, asynchronous, dependency-free, strictly-typed, fully docstringed HTTP server framework.
27
+
28
+ ## Example
29
+
30
+ ```py
31
+ from typing import Any
32
+ import httplib as app
33
+
34
+ @app.route('/')
35
+ async def index() -> Any:
36
+ return app.template('static/index.html')
37
+
38
+ @app.route('/hello/<name>')
39
+ async def hello(name: str) -> Any:
40
+ return f'<h1>Hello, {name}!'
41
+
42
+ @app.error(404)
43
+ async def not_found() -> Any:
44
+ return await app.template('static/404.html')
45
+
46
+ app.serve('localhost')
47
+
48
+ ```
@@ -0,0 +1,29 @@
1
+
2
+ # httplib
3
+
4
+ [![pytest](https://github.com/Omena0/http/actions/workflows/pytest.yml/badge.svg)](https://github.com/Omena0/http/actions/workflows/pytest.yml)
5
+ [![codecov](https://codecov.io/gh/Omena0/http/branch/master/graph/badge.svg?token=)](https://codecov.io/gh/Omena0/http)
6
+
7
+ Simple, asynchronous, dependency-free, strictly-typed, fully docstringed HTTP server framework.
8
+
9
+ ## Example
10
+
11
+ ```py
12
+ from typing import Any
13
+ import httplib as app
14
+
15
+ @app.route('/')
16
+ async def index() -> Any:
17
+ return app.template('static/index.html')
18
+
19
+ @app.route('/hello/<name>')
20
+ async def hello(name: str) -> Any:
21
+ return f'<h1>Hello, {name}!'
22
+
23
+ @app.error(404)
24
+ async def not_found() -> Any:
25
+ return await app.template('static/404.html')
26
+
27
+ app.serve('localhost')
28
+
29
+ ```
@@ -0,0 +1 @@
1
+ 0.0.0