base
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| ShareResult anyenv.text_sharing.base Result of a text sharing operation. |
||
| TextSharer anyenv.text_sharing.base Base class for text sharing services. |
🛈 DocStrings¶
Base class for text sharing services.
ShareResult
dataclass
¶
TextSharer
¶
Bases: ABC
Base class for text sharing services.
Source code in src/anyenv/text_sharing/base.py
share
abstractmethod
async
¶
share(
content: str,
*,
title: str | None = None,
syntax: str | None = None,
visibility: Visibility = "unlisted",
expires_in: int | None = None,
) -> ShareResult
Share text content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
The text content to share |
required |
title
|
str | None
|
Optional title/filename for the content |
None
|
syntax
|
str | None
|
Syntax highlighting hint (e.g. "python", "markdown") |
None
|
visibility
|
Visibility
|
Visibility level (not all providers support all levels) |
'unlisted'
|
expires_in
|
int | None
|
Expiration time in seconds (not supported by all providers) |
None
|
Returns:
| Type | Description |
|---|---|
ShareResult
|
ShareResult with URL and metadata |
share_sync
¶
share_sync(
content: str,
*,
title: str | None = None,
syntax: str | None = None,
visibility: Visibility = "unlisted",
expires_in: int | None = None,
) -> ShareResult