Metadata-Version: 2.5
Name: tnldotdev-tnl
Version: 0.1.0rc46
Summary: take a shortcut through the internet.
License-Expression: BSD-3-Clause
License-File: LICENSE
License-File: NOTICE
License-File: THIRD_PARTY_LICENSES.txt
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: starlette<2,>=0.45
Requires-Dist: uvicorn<1,>=0.40
Requires-Dist: websockets<18,>=14
Description-Content-Type: text/markdown

# tnldotdev-tnl

Give a Python ASGI app a public URL with tnl. Install the [tnl CLI](https://tnl.dev/docs/releases) first, then:

```sh
uv add tnldotdev-tnl
tnl auth login
tnl publisher setup --namespace
```

With an ASGI app named `app` in `myapp.py`, run this script with `uv run python preview.py`:

```python
import asyncio
import tnl
from myapp import app

async def main():
    client = tnl.create_client(project="my-team/my-project")
    async with client.deployment("local") as local:
        async with await local.publish(app) as publication:
            print(publication.url)
            await publication.wait()

asyncio.run(main())
```

Stop the script to remove the temporary URL. `publish("web", app)` uses a configured local service or an approved saved remote URL. Remote publication requires a registered deployment credential; connection-only sources cannot publish. The returned `Publication` is routable, supports `wait()` and retryable `aclose()`, and is an async context manager.

An explicit publication can take a `ServiceCertificate` or a callback as `certificate=`.
Use `await publication.export_certificate()` to read its installed chain, private
key, and expiry. Treat the result as a secret.

See the [publishing guide](https://tnl.dev/docs/publish), [quickstart](https://tnl.dev/docs), and [main README](https://github.com/tnldotdev/tnl#readme).
