Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Sep 30, 2024
1 parent 383fa4c commit 0055373
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/kvikio/kvikio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ def __init__(
range_support: bool = True,
max_lifetime: int = 120,
) -> None:
"""Create a context that starts a local http server.
Example
-------
>>> with LocalHttpServer(root_path="/my/server/") as server:
... with kvikio.RemoteFile.from_http_url(f"{server.url}/myfile") as f:
... f.read(...)
Parameters
----------
root_path
Path to the directory the server will serve.
range_support
Whether to support the ranges, required by `RemoteFile.from_http_url()`.
Depend on the `RangeHTTPServer` module (`pip install rangehttpserver`).
max_lifetime
Maximum lifetime of the server (in seconds).
"""
self.root_path = root_path
self.range_support = range_support
self.max_lifetime = max_lifetime
Expand Down

0 comments on commit 0055373

Please sign in to comment.