Enasis Network Remote Connect#
Documentation Welcome#
Welcome to the project documentation. Below you will find the most common functions and classes within the library, but you may click your way further into the project from there. You can also view the source code.Discord#
- class enconnect.discord.Client(params: ClientParams, logger: Callable[[...], None] | None = None)[source]#
Bases:
objectEstablish and maintain connection with the chat service.
- Parameters:
params – Parameters used to instantiate the class.
- property params: ClientParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property connected: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property nickname: tuple[str, str] | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property mqueue: Queue[ClientEvent]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property canceled: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- operate(*, intents: int = 4609) None[source]#
Operate the client and populate queue with the messages.
- Parameters:
intents – Determine what content will be received.
- socket_send(send: dict[str, Any]) None[source]#
Transmit provided content through the socket connection.
- Parameters:
send – Content which will be sent through socket.
- socket_recv() dict[str, Any] | None[source]#
Return the content received from the socket connection.
- Returns:
Content received from the socket connection.
- request(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, data: dict[str, Any] | None = None, files: dict[str, Any] | None = None, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
data – Optional dict payload included in request.
files – Optional file payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
- slash_create(command: dict[str, Any], guild: str | None = None) Response[source]#
Register the specified command using upstream endpoint.
- Parameters:
command – Parameters for registering the command.
guild – Discord guild for registering the command.
- Returns:
Response from upstream request to the server.
- slash_delete(name: str, guild: str | None = None) None[source]#
Remove specified slash command using upstream endpoint.
- Parameters:
name – Match of the name of the returned commands.
guild – Discord guild where command is registred.
- get_guild(unique: str) dict[str, Any][source]#
Return the information about the object within Discord.
- Parameters:
unique – Unique identifier to locate with Discord.
- Returns:
Response from upstream request to the server.
- get_channel(unique: str) dict[str, Any][source]#
Return the information about the object within Discord.
- Parameters:
unique – Unique identifier to locate with Discord.
- Returns:
Response from upstream request to the server.
- message_create(channel: str, **kwargs: Any) Response[source]#
Create the message using the unique Discord identifier.
- Parameters:
channel – Unique identifier in the Discord server.
kwargs – Keyword arguments passed for downstream.
- Returns:
Response from upstream request to the server.
- message_update(channel: str, unique: str, **kwargs: Any) Response[source]#
Update the message using the unique Discord identifiers.
- Parameters:
channel – Unique identifier in the Discord server.
unique – Unique identifier in the Discord server.
payload – Message payload with the Discord syntax.
kwargs – Keyword arguments passed for downstream.
- Returns:
Response from upstream request to the server.
- message_delete(channel: str, unique: str) Response[source]#
Delete the message using the unique Discord identifiers.
- Parameters:
channel – Unique identifier in the Discord server.
unique – Unique identifier in the Discord server.
- Returns:
Response from upstream request to the server.
- message_react(channel: str, unique: str, emoji: str) Response[source]#
React to the message with the provided emoji identifier.
- Parameters:
channel – Unique identifier in the Discord server.
unique – Unique identifier in the Discord server.
emoji – Unique identifier in the Discord server.
- Returns:
Response from upstream request to the server.
- interact_create(event: ClientEvent, **kwargs: Any) None[source]#
Create the interaction using the raw event from server.
- Parameters:
event – Raw event received from the network peer.
kwargs – Keyword arguments passed for downstream.
- interact_update(event: ClientEvent, **kwargs: Any) None[source]#
Update the interaction using the raw event from server.
- Parameters:
event – Raw event received from the network peer.
kwargs – Keyword arguments passed for downstream.
- class enconnect.discord.ClientParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
10000ge=1000, le=1000000
No
Nonemin_length=1
No
TrueNo
30ge=1, le=300
Yes
min_length=1
- appid: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Optional application identifier', metadata=[MinLen(min_length=1)])]#
- token: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
- class enconnect.discord.ClientEvent[source]#
Bases:
BaseModelContains information returned from the upstream server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
FalseNo
FalseLiteral[‘event’, ‘chanmsg’, ‘privmsg’]No
'event'No
Nonemin_length=1
Yes
ge=0
Yes
min_length=1
No
Nonemin_length=1
No
Nonege=0
No
Nonemin_length=1
No
Nonemin_length=1
- type: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Type of event that occurred', metadata=[MinLen(min_length=1)])]#
- opcode: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Type of operation performed', metadata=[Ge(ge=0)])]#
- data: Annotated[dict[str, Any] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Payload with the event data', metadata=[MinLen(min_length=1)])]#
- seqno: Annotated[int | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Event number within squence', metadata=[Ge(ge=0)])]#
- original: Annotated[dict[str, Any], FieldInfo(annotation=NoneType, required=True, description='Original received from server', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['event', 'chanmsg', 'privmsg'], FieldInfo(annotation=NoneType, required=False, default='event', description='Dynamic field parsed from event')]#
- isme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message is from client')]#
- hasme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message mentions client')]#
- whome: Annotated[tuple[str, str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current nickname of when received', metadata=[MinLen(min_length=1)])]#
- author: Annotated[tuple[str, str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Dynamic field parsed from event', metadata=[MinLen(min_length=1)])]#
IRC#
- class enconnect.irc.Client(params: ClientParams, logger: Callable[[...], None] | None = None)[source]#
Bases:
objectEstablish and maintain connection with the chat service.
- Parameters:
params – Parameters used to instantiate the class.
- property params: ClientParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property connected: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property nickname: str | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property mqueue: Queue[ClientEvent]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property canceled: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- class enconnect.irc.ClientParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
'ircbot'min_length=1
Literal[‘normal’, ‘service’]No
'normal'No
Nonemin_length=1
No
6697ge=1, le=65535
No
10000ge=1000, le=1000000
No
'Chatting Robie'min_length=1
Yes
min_length=1
No
'42X'min_length=1
No
'services.invalid'min_length=1
No
TrueNo
TrueNo
30ge=1, le=300
No
'ircbot'min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- port: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=6697, description='Server address for connection', metadata=[Ge(ge=1), Le(le=65535)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- operate: Annotated[Literal['normal', 'service'], FieldInfo(annotation=NoneType, required=False, default='normal', description='Method for server connection')]#
- nickname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='ircbot', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- realname: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='Chatting Robie', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- servername: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='services.invalid', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- serverid: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='42X', description='Unique identifier for services', metadata=[MinLen(min_length=1)])]#
- ssl_enable: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Enable connection encryption')]#
- class enconnect.irc.ClientEvent[source]#
Bases:
BaseModelContains information returned from the upstream server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
FalseNo
FalseLiteral[‘event’, ‘chanmsg’, ‘privmsg’]No
'event'No
Nonemin_length=1
Yes
min_length=1
No
NoneNo
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
- prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Prefix or origin information', metadata=[MinLen(min_length=1)])]#
- command: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Code or command for the event', metadata=[MinLen(min_length=1)])]#
- params: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Event or command parameters')]#
- original: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Original received from server', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['event', 'chanmsg', 'privmsg'], FieldInfo(annotation=NoneType, required=False, default='event', description='Dynamic field parsed from event')]#
- isme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message is from client')]#
- hasme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message mentions client')]#
- whome: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current nickname of when received', metadata=[MinLen(min_length=1)])]#
- author: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Dynamic field parsed from event', metadata=[MinLen(min_length=1)])]#
Mattermost#
- class enconnect.mattermost.Client(params: ClientParams, logger: Callable[[...], None] | None = None)[source]#
Bases:
objectEstablish and maintain connection with the chat service.
- Parameters:
params – Parameters used to instantiate the class.
- property params: ClientParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property connected: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property nickname: tuple[str, str] | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property mqueue: Queue[ClientEvent]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property canceled: bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- socket_send(send: dict[str, Any]) None[source]#
Transmit provided content through the socket connection.
- Parameters:
send – Content which will be sent through socket.
- socket_recv() dict[str, Any] | None[source]#
Return the content received from the socket connection.
- Returns:
Content received from the socket connection.
- request(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
- class enconnect.mattermost.ClientParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
443ge=1, le=65535
No
10000ge=1000, le=1000000
Yes
min_length=1
No
Nonemin_length=1
No
TrueYes
min_length=1
No
30ge=1, le=300
Yes
min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- port: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=443, description='Server address for connection', metadata=[Ge(ge=1), Le(le=65535)])]#
- token: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- teamid: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
- class enconnect.mattermost.ClientEvent[source]#
Bases:
BaseModelContains information returned from the upstream server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
No
FalseNo
FalseLiteral[‘event’, ‘chanmsg’, ‘privmsg’]No
'event'No
Nonemin_length=1
Yes
min_length=1
No
Nonemin_length=1
No
Nonege=0
No
Nonege=0
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
- type: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Type of event that occurred', metadata=[MinLen(min_length=1)])]#
- data: Annotated[dict[str, Any] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Payload with the event data', metadata=[MinLen(min_length=1)])]#
- broadcast: Annotated[dict[str, Any] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Payload with the event data', metadata=[MinLen(min_length=1)])]#
- seqno: Annotated[int | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Event number within squence', metadata=[Ge(ge=0)])]#
- status: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Type of event that occurred', metadata=[MinLen(min_length=1)])]#
- error: Annotated[dict[str, Any] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Payload with the event data', metadata=[MinLen(min_length=1)])]#
- seqre: Annotated[int | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Reply number within squence', metadata=[Ge(ge=0)])]#
- original: Annotated[dict[str, Any], FieldInfo(annotation=NoneType, required=True, description='Original received from server', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['event', 'chanmsg', 'privmsg'], FieldInfo(annotation=NoneType, required=False, default='event', description='Dynamic field parsed from event')]#
- isme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message is from client')]#
- hasme: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Indicates message mentions client')]#
- whome: Annotated[tuple[str, str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current nickname of when received', metadata=[MinLen(min_length=1)])]#
- author: Annotated[tuple[str, str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Dynamic field parsed from event', metadata=[MinLen(min_length=1)])]#
Philips#
Hubitat#
Ubiquiti#
Instagram#
Reddit#
- class enconnect.reddit.Reddit(params: RedditParams)[source]#
Bases:
objectInteract with the cloud service API with various methods.
- Parameters:
params – Parameters used to instantiate the class.
- property params: RedditParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property client: HTTPClient#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property token: str | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- request_token_block() str[source]#
Establish new session obtaining token for authorization.
- Returns:
Access token used with authenticated requests.
- async request_token_async() str[source]#
Establish new session obtaining token for authorization.
- Returns:
Access token used with authenticated requests.
- request_block(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
data – Optional dict payload included in request.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.
- async request_async(method: Literal['get', 'post'], path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None, *, httpauth: tuple[str, str] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
data – Optional dict payload included in request.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.
- listing(unique: str) RedditListing[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- listing_block(unique: str) RedditListing[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- async listing_async(unique: str) RedditListing[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- latest(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#
Return the new items within the provided subreddit path.
- Parameters:
subred – Path to subreddit containing the content.
params – Optional parameters included in request.
- Returns:
New items within the provided subreddit path.
- latest_block(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#
Return the new items within the provided subreddit path.
- Parameters:
subred – Path to subreddit containing the content.
params – Optional parameters included in request.
- Returns:
New items within the provided subreddit path.
- async latest_async(subred: str, params: dict[str, Any] | None = None) list[RedditListing][source]#
Return the new items within the provided subreddit path.
- Parameters:
subred – Path to subreddit containing the content.
params – Optional parameters included in request.
- Returns:
New items within the provided subreddit path.
- class enconnect.reddit.RedditParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
Yes
min_length=1
Yes
min_length=1
No
Nonemin_length=1
No
TrueNo
30ge=1, le=300
Yes
min_length=1
Yes
min_length=1
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- secret: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- useragent: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- class enconnect.reddit.RedditListing[source]#
Bases:
BaseModelContains information returned from the upstream response.
Fields# Field
Type
Required
Default
Yes
Yes
Yes
Yes
Yes
Yes
No
NoneYes
Yes
Yes
Yes
No
NoneYes
Yes
Yes
Yes
No
NoneYes
Yes
- name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- id: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- created: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- selftext: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- url: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- permalink: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- thumbnail: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- url_dest: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- domain: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- medias: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- pinned: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- edited: Annotated[bool | float, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- stickied: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- archived: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- vote_downs: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
YouTube#
- class enconnect.youtube.YouTube(params: YouTubeParams)[source]#
Bases:
objectInteract with the cloud service API with various methods.
- Parameters:
params – Parameters used to instantiate the class.
- property params: YouTubeParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property client: HTTPClient#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- request_block(method: Literal['get'], path: str, params: dict[str, Any] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
- Returns:
Response from upstream request to the server.
- async request_async(method: Literal['get'], path: str, params: dict[str, Any] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
- Returns:
Response from upstream request to the server.
- search(params: dict[str, Any] | None = None) list[YouTubeResult][source]#
Return the results from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- search_block(params: dict[str, Any] | None = None) list[YouTubeResult][source]#
Return the results from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- async search_async(params: dict[str, Any] | None = None) list[YouTubeResult][source]#
Return the results from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- videos(params: dict[str, Any] | None = None) list[YouTubeVideo][source]#
Return the videos from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- videos_block(params: dict[str, Any] | None = None) list[YouTubeVideo][source]#
Return the videos from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- async videos_async(params: dict[str, Any] | None = None) list[YouTubeVideo][source]#
Return the videos from the provided search parameters.
- Parameters:
params – Optional parameters included in request.
- Returns:
Results from the provided search parameters.
- video(unique: str) YouTubeVideo[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- video_block(unique: str) YouTubeVideo[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- async video_async(unique: str) YouTubeVideo[source]#
Return the specific content within the social platform.
- Parameters:
unique – Unique identifier within social platform.
- Returns:
Specific content within the social platform.
- class enconnect.youtube.YouTubeParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
TrueNo
30ge=1, le=300
Yes
min_length=1
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- token: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- class enconnect.youtube.YouTubeResult[source]#
Bases:
BaseModelContains information returned from the upstream response.
Fields# Field
Type
Required
Default
No
NoneNo
NoneNo
NoneLiteral[‘channel’, ‘playlist’, ‘video’]Yes
No
NoneYes
Yes
Yes
No
None- kind: Annotated[Literal['channel', 'playlist', 'video'], FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- channel: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- playlist: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- video: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- channel_title: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
- class enconnect.youtube.YouTubeVideo[source]#
Bases:
BaseModelContains information returned from the upstream response.
Fields# Field
Type
Required
Default
No
NoneYes
Literal[‘channel’, ‘playlist’, ‘video’]Yes
Yes
Yes
Yes
Yes
- kind: Annotated[Literal['channel', 'playlist', 'video'], FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- channel: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- video: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- title: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Value from the server response')]#
- about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Value from the server response')]#
General Utilities#
- class enconnect.utils.HTTPClient(timeout: int = 30, headers: dict[str, str] | None = None, verify: SSLContext | str | bool = True, capem: str | None = None, httpauth: tuple[str, str] | None = None, retry: int = 3, backoff: float = 3.0, states: set[int] = {429})[source]#
Bases:
objectInteract with the upstream server in blocking or async.
- Parameters:
timeout – Timeout waiting for the server response.
headers – Optional headers to include in requests.
verify – Require valid certificate from the server.
capem – Optional path to the certificate authority.
httpauth – Optional information for authentication.
retry – How many attempts are made with the server.
backoff – Backoff backoff if encountered retries.
states – Which states will be retried with backoff.
- property timeout: int#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property httpauth: tuple[str, str] | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property headers: dict[str, str] | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property verify: SSLContext | str | bool#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property capem: str | None#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property retry: int#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property backoff: float#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property states: set[int]#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property client_block: Client#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- property client_async: AsyncClient#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- request_block(method: Literal['delete', 'get', 'post', 'patch', 'put'], location: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, data: dict[str, Any] | None = None, files: dict[str, Any] | None = None, timeout: int | None = None, headers: dict[str, str] | None = None, httpauth: tuple[str, str] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
location – Location with path for server request.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
data – Optional dict payload included in request.
files – Optional file payload included in request.
timeout – Timeout waiting for the server response.
headers – Optional headers to include in requests.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.
- async request_async(method: Literal['delete', 'get', 'post', 'patch', 'put'], location: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, data: dict[str, Any] | None = None, files: dict[str, Any] | None = None, timeout: int | None = None, headers: dict[str, str] | None = None, httpauth: tuple[str, str] | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
location – Location with path for server request.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
data – Optional dict payload included in request.
files – Optional file payload included in request.
timeout – Timeout waiting for the server response.
headers – Optional headers to include in requests.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.
- stream_block(method: Literal['delete', 'get', 'post', 'patch', 'put'], location: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, data: dict[str, Any] | None = None, timeout: int | None = None, headers: dict[str, str] | None = None, httpauth: tuple[str, str] | None = None) Iterator[str][source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
location – Location with path for server request.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
data – Optional dict payload included in request.
timeout – Timeout waiting for the server response.
headers – Optional headers to include in requests.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.
- async stream_async(method: Literal['delete', 'get', 'post', 'patch', 'put'], location: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, data: dict[str, Any] | None = None, timeout: int | None = None, headers: dict[str, str] | None = None, httpauth: tuple[str, str] | None = None) AsyncIterator[str][source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
location – Location with path for server request.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
data – Optional dict payload included in request.
timeout – Timeout waiting for the server response.
headers – Optional headers to include in requests.
httpauth – Optional information for authentication.
- Returns:
Response from upstream request to the server.