Modules Documentation
This section contains the complete API documentation for all Mycelian modules, automatically generated from the source code.
Overview
Mycelian is a comprehensive streaming toolkit with the following major components:
Alert System: Custom alert processing for Twitch events (follows, subs, bits, etc.)
Chatbot System: Advanced Twitch chatbot with commands, events, and automated responses
Connector Automation: Trigger-action workflows for stream automation
Web Engine: Flask-based server for browser sources and real-time data
Service Integrations: Support for Twitch, Spotify, PlayStation Network, and StreamLabs
Desktop UI: NiceGUI-based interface for configuration and management
Core Modules
Main Application
Configuration Management
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.config_manager.AppConfig(database_type='sql', sql_database_path='mycelian.db', firebase_service_account_path='ServiceAccountKey.json', firebase_database_url='https://your-project-default-rtdb.firebaseio.com/', mongodb_connection_string='mongodb://localhost:27017/', mongodb_database_name='mycelian', connection_timeout=30, retry_attempts=3, config_version='1.0', last_updated='')[source]
Bases:
objectApplication configuration structure
- class modules.config_manager.ConfigManager(config_path='config.json')[source]
Bases:
objectManages application configuration stored in external files
Database Management
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.database_manager.DatabaseConfig(database_type='sql', sql_database_path='mycelian.db', firebase_service_account_path='', firebase_database_url='', mongodb_connection_string='', mongodb_database_name='', streamer_name='mycelian', connection_timeout=30, retry_attempts=3)[source]
Bases:
objectConfiguration settings for database connections
- class modules.database_manager.DatabaseInterface[source]
Bases:
ABCAbstract base class for database implementations
- abstractmethod async get_multiple_data_async(paths)[source]
Get data from multiple paths asynchronously
- class modules.database_manager.DatabaseManager[source]
Bases:
objectMain database manager that handles all database operations
- initialize(config=None)[source]
Initialize the database manager with the specified configuration
- Return type:
- migrate_data(source_config, target_config)[source]
Migrate data from one database to another
- Return type:
- class modules.database_manager.FirebaseDatabase(config)[source]
Bases:
DatabaseInterfaceFirebase Realtime Database implementation
- class modules.database_manager.MongoDatabase(config)[source]
Bases:
DatabaseInterfaceMongoDB database implementation
- class modules.database_manager.SQLDatabase(config)[source]
Bases:
DatabaseInterfaceSQLite database implementation
- modules.database_manager.get_connection_status()[source]
Get the current database connection status
- async modules.database_manager.get_multiple_data_async(paths)[source]
Get data from multiple paths asynchronously
- modules.database_manager.get_snapshot()[source]
Get a complete snapshot of all database data as a nested dictionary
- modules.database_manager.initialize_database(config=None)[source]
Initialize the database with the specified configuration
- Return type:
Statistics Manager
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.statistics_manager.AlertStatistics(bit_alerts_played=0, total_bits=0, resubs_played=0, new_subs_played=0, gift_subs_played=0, total_gift_subs=0, follow_alerts_played=0, raids=0, point_alerts_redeemed=0, total_channel_points_redeemed=0, donations=0, user_stats=<factory>, alert_type_stats=<factory>)[source]
Bases:
objectStatistics for alert events
- alert_type_stats: Dict[str, IndividualAlertTypeStatistics]
- user_stats: Dict[str, UserAlertStatistics]
- class modules.statistics_manager.ChatStatistics(twitch_messages_received=0, total_messages=0, user_stats=<factory>)[source]
Bases:
objectStatistics for chat messages
- user_stats: Dict[str, UserChatStatistics]
- class modules.statistics_manager.ChatbotStatistics(commands_triggered=0, events_triggered=0, total_interactions=0, user_stats=<factory>, user_command_stats=<factory>, user_event_stats=<factory>, command_stats=<factory>, event_stats=<factory>)[source]
Bases:
objectStatistics for chatbot system
- command_stats: Dict[str, IndividualCommandStatistics]
- event_stats: Dict[str, IndividualEventStatistics]
- user_command_stats: Dict[str, UserCommandStatistics]
- user_event_stats: Dict[str, UserEventStatistics]
- user_stats: Dict[str, UserChatbotStatistics]
- class modules.statistics_manager.ConnectorStatistics(connectors_triggered=0, total_triggers=0, user_stats=<factory>, user_connector_stats=<factory>, connector_stats=<factory>)[source]
Bases:
objectStatistics for connector system
- connector_stats: Dict[str, IndividualConnectorStatistics]
- user_connector_stats: Dict[str, UserConnectorStatistics]
- user_stats: Dict[str, UserConnectorStatistics]
- class modules.statistics_manager.HypeTrainStatistics(level_completions=<factory>, total_completions=0)[source]
Bases:
objectStatistics for hype train completions by level
- class modules.statistics_manager.IndividualAlertTypeStatistics(alert_type='', alert_name='', trigger_count=0, last_triggered=<factory>, first_triggered=<factory>)[source]
Bases:
objectStatistics for individual alert types
- class modules.statistics_manager.IndividualCommandStatistics(command_name='', usage_count=0, last_used=<factory>, first_used=<factory>)[source]
Bases:
objectStatistics for individual commands
- class modules.statistics_manager.IndividualConnectorStatistics(connector_name='', trigger_count=0, last_triggered=<factory>, first_triggered=<factory>)[source]
Bases:
objectStatistics for individual connectors
- class modules.statistics_manager.IndividualEventStatistics(event_name='', trigger_count=0, last_triggered=<factory>, first_triggered=<factory>)[source]
Bases:
objectStatistics for individual events
- class modules.statistics_manager.QuoteStatistics(total_quotes_redeemed=0, individual_quote_usage=<factory>, user_stats=<factory>)[source]
Bases:
objectStatistics for quote system
- user_stats: Dict[str, UserQuoteStatistics]
- class modules.statistics_manager.SessionStatistics(start_time=<factory>, last_save_time=<factory>, session_duration=0.0)[source]
Bases:
objectStatistics for the current session
- class modules.statistics_manager.StatisticsData(alerts=<factory>, hype_trains=<factory>, connectors=<factory>, chatbot=<factory>, quotes=<factory>, chat=<factory>, templates=<factory>, session=<factory>)[source]
Bases:
objectMain statistics data container
- alerts: AlertStatistics
- chat: ChatStatistics
- chatbot: ChatbotStatistics
- connectors: ConnectorStatistics
- hype_trains: HypeTrainStatistics
- quotes: QuoteStatistics
- session: SessionStatistics
- templates: Dict[str, TemplateStatistics]
- class modules.statistics_manager.StatisticsManager[source]
Bases:
objectComprehensive statistics manager for Mycelian
- get_all_tracked_usernames()[source]
Get all usernames that have been tracked in the events database.
- get_date_range_summary(start_time, end_time)[source]
Get aggregate stats across all users for a date range.
- get_top_users_by_statistic(stat_type, limit=10)[source]
Get top users ranked by a specific statistic
- get_top_users_for_command(command_name, limit=10)[source]
Get top users who used a specific command the most
- get_top_users_for_connector(connector_name, limit=10)[source]
Get top users who triggered a specific connector the most
- get_top_users_for_event(event_name, limit=10)[source]
Get top users who triggered a specific event the most
- get_top_users_for_quote(quote_id, limit=10)[source]
Get top users who redeemed a specific quote the most
- get_top_users_in_range(start_time, end_time, event_type=None, limit=10)[source]
Get top contributors in a date range.
- Parameters:
- Return type:
- Returns:
List of dicts with username, event_count, and total_amount.
- get_user_events(username, start_time=None, end_time=None, event_type=None, limit=100)[source]
Query timestamped events for a user within a date range.
- Parameters:
username (
str) – Username to query.start_time (
Optional[float]) – Start of range (unix timestamp). None for no lower bound.end_time (
Optional[float]) – End of range (unix timestamp). None for no upper bound.event_type (
Optional[str]) – Filter by event type. None for all types.limit (
int) – Maximum number of events to return.
- Return type:
- Returns:
List of event dictionaries ordered by timestamp descending.
- increment_bit_alerts(bit_amount=0, username=None, alert_name='')[source]
Increment bit alerts played count and total bits amount
- increment_channel_points_redeemed(points_amount, username=None)[source]
Increment total channel points redeemed and track per-user statistics
- increment_commands_triggered(username=None, command_name='')[source]
Increment chatbot commands triggered count
- increment_connector_triggers(count=1, username=None, connector_name='')[source]
Increment total connector triggers
- increment_connectors_triggered(username=None, connector_name='')[source]
Increment connectors triggered count
- increment_events_triggered(username=None, event_name='')[source]
Increment chatbot events triggered count
- increment_gift_subs(gift_quantity=1, username=None, alert_name='')[source]
Increment gift subs played count and total gift subs amount
- increment_hype_train_completion(level)[source]
Increment hype train completion for specific level (supports unlimited levels)
- increment_quote_redeemed(quote_id, username=None)[source]
Increment quote redeemed count for specific quote
- increment_template_counter(template_name, counter_name, increment=1)[source]
Convenience method to increment a template counter
- repair_data_integrity()[source]
Attempt to repair data integrity issues. Returns True if repairs were made.
- Return type:
- start_periodic_saving()[source]
Start the periodic saving task (deprecated - use start_periodic_saving_safe)
- class modules.statistics_manager.TemplateStatistics(template_name='', custom_stats=<factory>, last_updated=<factory>)[source]
Bases:
objectStatistics for individual templates
- class modules.statistics_manager.UserAlertStatistics(bit_alerts_played=0, resubs_played=0, new_subs_played=0, gift_subs_played=0, follow_alerts_played=0, raids=0, point_alerts_redeemed=0, channel_points_redeemed=0, donations=0, total_alerts=0, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for alert events
- class modules.statistics_manager.UserChatStatistics(twitch_messages_received=0, total_messages=0, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for chat messages
- class modules.statistics_manager.UserChatbotStatistics(commands_triggered=0, events_triggered=0, total_interactions=0, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for chatbot system
- class modules.statistics_manager.UserCommandStatistics(command_usage=<factory>, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for individual commands
- class modules.statistics_manager.UserConnectorStatistics(connectors_triggered=0, total_triggers=0, connector_usage=<factory>, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for connector system
- class modules.statistics_manager.UserEventStatistics(event_usage=<factory>, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for individual events
- class modules.statistics_manager.UserQuoteStatistics(total_quotes_redeemed=0, individual_quote_usage=<factory>, first_seen=<factory>, last_seen=<factory>)[source]
Bases:
objectPer-user statistics for quote system
- modules.statistics_manager.get_statistics_manager()[source]
Get the global statistics manager instance
- Return type:
Service Integration Modules
Twitch Integration
Twitch API Reference Documentation
This module contains structured information about all Twitch API endpoints including URLs, request parameters, and response structures.
All endpoints use the base URL: https://api.twitch.tv/helix/
- class modules.twitch_api_reference.APIEndpoint(name, endpoint, method, description, authorization, required_params, optional_params, response_fields, rate_limits=None, auto_fill_params=None)[source]
Bases:
objectRepresents a Twitch API endpoint with its specifications.
- class modules.twitch_api_reference.TwitchAPIReference[source]
Bases:
objectContainer for all Twitch API endpoints organized by category.
- get_all_endpoints()[source]
Get all endpoints organized by category.
- Return type:
Dict[str,Dict[str,APIEndpoint]]
- get_endpoint_by_name(category, endpoint_name)[source]
Get a specific endpoint by category and name.
- Return type:
- get_endpoints_by_method(method)[source]
Get all endpoints that use a specific HTTP method.
- Return type:
Spotify Integration
PlayStation Network
StreamLabs
OBS Studio Integration
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chatbot System
The Chatbot system provides comprehensive Twitch chat bot functionality including commands, events, quotes, and automated responses.
Chatbot API Integration
Chatbot Core
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.chatbot_core.ChatCommand(**kwargs)[source]
Bases:
objectRepresents a chat command
- class modules.chatbot_core.ChatEvent(**kwargs)[source]
Bases:
objectRepresents an automatic event response
- set_interval_from_string(interval_str)[source]
Set interval from hh:mm:ss format string
- Return type:
- class modules.chatbot_core.CommandType(*values)[source]
Bases:
EnumTypes of chat commands
- BASIC = 'basic'
- COUNTER = 'counter'
- RESET = 'reset'
- class modules.chatbot_core.ComparisonOperator(*values)[source]
Bases:
EnumComparison operators for conditions
- CONTAINS = 'contains'
- ENDS_WITH = 'ends_with'
- EQUAL = 'equal'
- GREATER_THAN = 'greater_than'
- GREATER_THAN_OR_EQUAL = 'greater_than_or_equal'
- LESS_THAN = 'less_than'
- LESS_THAN_OR_EQUAL = 'less_than_or_equal'
- STARTS_WITH = 'starts_with'
- class modules.chatbot_core.EventType(*values)[source]
Bases:
EnumTypes of automatic events
- BITS = 'bits'
- CHANNEL_POINT_REDEMPTION = 'channel_point_redemption'
- CHAT_MESSAGE = 'chat_message'
- DONATION = 'donation'
- FOLLOW = 'follow'
- GIFT_SUBSCRIPTION = 'gift_subscription'
- HYPE_TRAIN_END = 'hype_train_end'
- HYPE_TRAIN_PROGRESS = 'hype_train_progress'
- HYPE_TRAIN_START = 'hype_train_start'
- INTERVAL = 'interval'
- RAID = 'raid'
- RESUBSCRIPTION = 'resubscription'
- SPECIFIC_TIME = 'specific_time'
- SUBSCRIPTION = 'subscription'
- class modules.chatbot_core.Greeting(**kwargs)[source]
Bases:
objectRepresents a user greeting in the greetings system
- class modules.chatbot_core.Quote(**kwargs)[source]
Bases:
objectRepresents a quote in the quote system
- class modules.chatbot_core.TriggerCondition(field, operator, value)[source]
Bases:
objectCondition for triggering a command or event
- class modules.chatbot_core.VariableType(*values)[source]
Bases:
EnumTypes of variables that can be used in responses
- AMOUNT = 'amount'
- COOLDOWN = 'cooldown'
- COUNT = 'count'
- LEVEL = 'level'
- MESSAGE = 'message'
- MONTHS = 'months'
- TIER = 'tier'
- TIMESTAMP = 'timestamp'
- USAGE_LEFT = 'usage_left'
- USERNAME = 'username'
- VIEWER_COUNT = 'viewer_count'
- modules.chatbot_core.format_time_with_options(format_options='')[source]
Format current time with various options
Format options syntax: [timezone]:[hour_format]:[ampm_display] - timezone: UTC, EST, PST, etc. (default: local) - hour_format: 12 or 24 (default: 24) - ampm_display: show or hide (default: hide for 24hr, show for 12hr)
Examples: - “EST:12:show” -> “02:30 PM EST” - “UTC:24” -> “19:30 UTC” - “PST:12:hide” -> “11:30 PST” - “” -> “19:30” (local time, 24hr)
- Return type:
Chatbot Manager
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.chatbot_manager.ChatbotManager[source]
Bases:
objectManages chat commands and automatic event responses
- start_deferred_interval_events()[source]
Start any interval events that were deferred due to chatbot not being ready
- async test_command(command_id, test_data)[source]
Test a command with sample data and send message to Twitch chat
- async test_event(event_id, test_data)[source]
Test an event with sample data and send message to Twitch chat
- toggle_custom_greeting_enabled(enabled)[source]
Toggle whether custom greetings are enabled
- Return type:
- toggle_default_greeting_enabled(enabled)[source]
Toggle whether default greetings are enabled
- Return type:
- toggle_greetings_enabled(enabled)[source]
Toggle whether the greetings system is enabled (legacy method)
- Return type:
- class modules.chatbot_manager.GreetingFlagManager(file_path=None)[source]
Bases:
objectManages greeting flags in a local file for simple boolean-based greeting system
- perform_reset_if_needed(reset_interval_hours, current_time=None)[source]
Check and perform reset if needed
Alert System
Alert Processing
Alert Utilities
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.alertutils.AlertObj(duration=0.0, alert_name='', display_name='', alert_type='', deleted=False, alert_id='', played=False, stackable=False, timestamp=0.0, skip_alert=False, is_replay=False, is_test=False, username='', anonymous=False, message=None, emotes=None, title=None, tier=0, gift_qty=0, resub_month=0, months_prepaid=0, amt_cheered=0, twitch_reward_id=None, point_cost=0, enable_alert=False, raider_count=0, donation_amount=0.0, currency='USD', hype_train_level=0, hype_train_in_progress=False, fade_in=0, fade_out=0, volume=0, audio_only=False, single_audio_dir=None, single_audio_name=None, gif_dir=None, gif_name=None, randomized=False, randomized_dir=None, randomized_chance=0, randomized_extra=False, randomized_extra_chance=0, randomized_extra_dir=None)[source]
Bases:
object
- class modules.alertutils.AlertSettings(global_delay=3, default_bit_alert='bit1', default_sub_alert='sub1', default_follow_alert='follow1', default_point_alert='point1', default_raids_alert='raid1', default_giftsub_alert='giftsub1', default_donation_alert='donation1', FALLBACK_ALERT_ID='subs_fallback')[source]
Bases:
object- alert_types = ['sub', 'bit', 'follow', 'point', 'raid', 'giftsub', 'donation', 'hype_train_start', 'hype_train_progress', 'hype_train_end']
- class modules.alertutils.AlertStateManager[source]
Bases:
objectManages the state of all alert configurations and provides methods to access and update them.
This class serves as the central source of truth for all alert configurations, handling both the in-memory state and synchronization with Firebase.
- get_alerts_by_type(alert_type, include_ranges=True)[source]
Get alerts of a specific type from the state
- get_all_alerts()[source]
Get all alerts from the state, including alert configurations and stored alerts
- Returns:
Dictionary with all alerts including ‘alert_storage’ key
- Return type:
- get_display_name(alert_type, alert_id, alert_data=None)[source]
Generate a consistent display name for an alert based on type and ID
- get_limited_stored_alerts_from_firebase(max_alerts)[source]
Get only the most recent X alerts directly from Firebase to reduce bandwidth
- get_limited_stored_alerts_paginated(page=1, limit=25, max_total_alerts=250)[source]
Get stored completed alerts with pagination, limited to a maximum total number of alerts
- Parameters:
- Returns:
- Dictionary containing:
alerts: List of alert data sorted by timestamp (newest first)
total_count: Total number of stored alerts (limited to max_total_alerts)
page: Current page number
limit: Items per page
total_pages: Total number of pages
has_next: Whether there’s a next page
has_prev: Whether there’s a previous page
- Return type:
- get_resub_fallback_enabled()[source]
Check if the resub fallback alert is enabled.
- Returns:
True if the resub fallback alert is enabled, False otherwise.
- Return type:
- get_stored_alerts()[source]
Get all stored completed alerts
- Returns:
Dictionary of stored alerts
- Return type:
- get_stored_alerts_paginated(page=1, limit=25)[source]
Get stored completed alerts with pagination
- Parameters:
- Returns:
- Dictionary containing:
alerts: List of alert data sorted by timestamp (newest first)
total_count: Total number of stored alerts
page: Current page number
limit: Items per page
total_pages: Total number of pages
has_next: Whether there’s a next page
has_prev: Whether there’s a previous page
- Return type:
- async initialize_async()[source]
Initialize the alert state by loading all alerts from Firebase asynchronously
- migrate_individual_alerts_to_collections()[source]
Migrate individual alert records to collection format
This method finds all individual alert records in the database and consolidates them into their respective collections.
- Returns:
True if successful, False otherwise
- Return type:
- save_alert(alert_type, alert_id, alert_data, update_collection=True)[source]
Save an alert to the state and sync with Firebase
- save_alert_by_id(alert_id)[source]
Save an alert by its ID to Firebase using the current data in state manager
- update_alert(alert_type, alert_id, alert_data)[source]
Update an alert in the alert state and sync with Firebase
- update_alert_collections(alert_type)[source]
Update the alert collections for a specific alert type after batch operations
- modules.alertutils.fetch_bits_alert(quantity)[source]
Get bits alert data based on quantity. Checks for exact match in BitAlerts, otherwise falls back to range alerts. If no match is found, returns the default bit alert.
- modules.alertutils.fetch_donation_alert(quantity)[source]
Get donation alert data based on quantity. Checks for exact match in DonationAlerts, otherwise falls back to range alerts. If no match is found, returns the default donation alert.
- modules.alertutils.fetch_follow_alert()[source]
Get follow alert data. Since there’s only one follow alert, it simply returns the first available follow alert or the default follow alert.
- modules.alertutils.fetch_giftsub_alert(quantity)[source]
Get giftsub alert data based on quantity. Checks for exact match in GiftsubAlerts, otherwise falls back to range alerts. If no match is found, returns the default giftsub alert.
- modules.alertutils.fetch_point_alert(twitch_reward_id)[source]
Get channel point redemption alert data based on reward ID. Returns only exact matches for the twitch_reward_id.
- modules.alertutils.fetch_raid_alert(raider_count)[source]
Get raid alert data based on raider count. Checks for exact match in RaidAlerts, otherwise falls back to range alerts. If no match is found, returns the default raid alert.
- modules.alertutils.fetch_resub_alert(months)[source]
Get resubscription alert data based on months.
Checks for an exact month match first. If none is found and the resub fallback alert is enabled, uses the fallback alert. Otherwise falls back to the default sub alert (sub1 / first available).
- modules.alertutils.fetch_sub_alert(months)[source]
Get subscription alert data based on months. If no match is found, returns the default sub alert.
- async modules.alertutils.initialize_alert_state_async()[source]
Initialize the global alert state manager asynchronously
Alert Parsing
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.alerts_parser.AlertData(alerttype, audioname, audiodirectory, duration, volume, randomized, randomizedchance, randomizeddirectory, randomizedextrachance, randomizedextradirectory, twitchrewardid, gifname, gifdirectory, alert_id='', alert_category='', alertname=None, disabled=False)[source]
Bases:
objectData class to hold parsed alert information
- class modules.alerts_parser.AlertsParser(file_path=None)[source]
Bases:
objectParser for alerts.json files used in Twitch alert systems.
This class provides methods to parse and extract specific alert configuration data from JSON files, making it easy to work with alert settings programmatically.
User Interface
Main UI Window
Web Engine
UI Windows
Connector Automation System
The Connector system provides a powerful automation framework for creating trigger-action workflows that respond to stream events automatically.
Core Connector Framework
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.connector_core.ActionType(*values)[source]
Bases:
EnumTypes of actions available in the connector system
- ADD_GREETING = 'add_greeting'
- API_CALL = 'api_call'
- AUDIO_CONTROL = 'audio_control'
- EXECUTE_COMMAND = 'execute_command'
- KEY_PRESS = 'key_press'
- SEND_CHAT_MESSAGE = 'send_chat_message'
- SEND_GREETING = 'send_greeting'
- TEMPLATE_CONTROL = 'template_control'
- TRIGGER_ALERT = 'trigger_alert'
- UPDATE_GREETING = 'update_greeting'
- WEBSOCKET_EMIT = 'websocket_emit'
- WRITE_FILE = 'write_file'
- class modules.connector_core.BaseAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>)[source]
Bases:
ABCBase class for all action types
- action_type: ActionType
- class modules.connector_core.BaseTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
ABCBase class for all trigger types
- conditions: List[TriggerCondition]
- abstractmethod should_trigger(event_data)[source]
Determine if this trigger should fire based on event data
- Return type:
- trigger_type: TriggerType
- class modules.connector_core.ComparisonOperator(*values)[source]
Bases:
EnumComparison operators for trigger conditions
- CONTAINS = 'contains'
- ENDS_WITH = 'ends_with'
- EQUAL = 'equal'
- GREATER_THAN = 'greater_than'
- GREATER_THAN_OR_EQUAL = 'greater_than_or_equal'
- LESS_THAN = 'less_than'
- LESS_THAN_OR_EQUAL = 'less_than_or_equal'
- NOT_CONTAINS = 'not_contains'
- NOT_EQUAL = 'not_equal'
- REGEX_MATCH = 'regex_match'
- STARTS_WITH = 'starts_with'
- class modules.connector_core.Connector(connector_id, name, description='', enabled=True, trigger=None, actions=<factory>, created_at=<factory>, last_triggered=0, trigger_count=0, metadata=<factory>)[source]
Bases:
objectA connector that links a trigger to one or more actions
- actions: List[BaseAction]
- async process_event(event_data)[source]
Process an event and potentially trigger actions
- Return type:
- trigger: BaseTrigger = None
- class modules.connector_core.EventData[source]
Bases:
objectStandardized event data structure for the connector system
- static from_donation(amount, username, message='', currency='USD', **kwargs)[source]
Create event data from donation event
- static from_twitch_bits(bits_amount, username, message='', **kwargs)[source]
Create event data from Twitch bits event
- static from_twitch_chat(username, message, is_command=False, command='', **kwargs)[source]
Create event data from Twitch chat message
- class modules.connector_core.TriggerCondition(field, operator, value, case_sensitive=True)[source]
Bases:
objectA single condition that must be met for a trigger to fire
- operator: ComparisonOperator
- class modules.connector_core.TriggerType(*values)[source]
Bases:
EnumTypes of triggers available in the connector system
- DONATION = 'donation'
- HOTKEY = 'hotkey'
- SCHEDULE = 'schedule'
- TIMER = 'timer'
- TWITCH_BITS = 'twitch_bits'
- TWITCH_CHAT_MESSAGE = 'twitch_chat_message'
- TWITCH_FOLLOW = 'twitch_follow'
- TWITCH_GIFTSUB = 'twitch_giftsub'
- TWITCH_HYPE_TRAIN_END = 'twitch_hype_train_end'
- TWITCH_HYPE_TRAIN_START = 'twitch_hype_train_start'
- TWITCH_POINTS = 'twitch_points'
- TWITCH_RAID = 'twitch_raid'
- TWITCH_RESUB = 'twitch_resub'
- TWITCH_SUB = 'twitch_sub'
- WEBHOOK = 'webhook'
Connector Manager
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.connector_manager.ConnectorManager[source]
Bases:
objectManages connectors and processes events through the trigger-action system
- async process_event(event_data)[source]
Process an event through all enabled connectors
- Return type:
- start_connector_thread()[source]
Start connector processing in a separate thread with its own event loop
Trigger System
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.connector_triggers.DonationTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for donation events from StreamLabs
- class modules.connector_triggers.HotkeyTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>, key_combination='', modifiers=None, key_code='', is_global=True)[source]
Bases:
BaseTriggerTrigger for hotkey/key press activation
- class modules.connector_triggers.ScheduleTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>, schedule_pattern='', timezone='UTC')[source]
Bases:
BaseTriggerTrigger for scheduled events (cron-like)
- class modules.connector_triggers.TimerTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>, interval_seconds=60)[source]
Bases:
BaseTriggerTrigger for timer-based events
- class modules.connector_triggers.TwitchBitsTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch bits/cheers events
- class modules.connector_triggers.TwitchChatMessageTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch chat message events
- class modules.connector_triggers.TwitchFollowTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch follow events
- class modules.connector_triggers.TwitchGiftSubTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch gift subscription events
- class modules.connector_triggers.TwitchHypeTrainEndTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch hype train end events
- class modules.connector_triggers.TwitchHypeTrainStartTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch hype train start events
- class modules.connector_triggers.TwitchPointsTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch channel points redemption events
- class modules.connector_triggers.TwitchRaidTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch raid events
- class modules.connector_triggers.TwitchResubTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch resubscription events
- class modules.connector_triggers.TwitchSubTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>)[source]
Bases:
BaseTriggerTrigger for Twitch subscription events
- class modules.connector_triggers.WebhookTrigger(trigger_id, trigger_type, name, description='', enabled=True, conditions=<factory>, cooldown_seconds=0, last_triggered=0, metadata=<factory>, webhook_url='', secret_key='')[source]
Bases:
BaseTriggerTrigger for webhook events
Action System
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.connector_actions.AddGreetingAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, user_id='', username='', greeting_text='')[source]
Bases:
BaseActionAction to add a new greeting for a user
- class modules.connector_actions.ApiCallAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, url='', method='GET', headers=None, body=None)[source]
Bases:
BaseActionAction to make an HTTP API call
- class modules.connector_actions.AudioChangeEntry(original_values, current_values, remaining_duration, restoration_task=None, task_id='', last_update=0.0)[source]
Bases:
objectEntry for tracking active audio changes in the global registry
- class modules.connector_actions.AudioControlAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, control_type='device', action_mode='set', volume_level=50.0, volume_step=10.0, target_application='', target_device='', device_name='', duration=0.0, _active_restoration_tasks=None, _audio_change_registry=None)[source]
Bases:
BaseActionAction to control system audio (volume, microphone, etc.)
- get_audio_source_key(target_app, target_device, device_name)[source]
Generate a unique key for the audio source
- Return type:
- async get_or_create_registry_entry(source_key, target_app, target_device, device_name)[source]
Get existing registry entry or create a new one
- Return type:
- class modules.connector_actions.ExecuteCommandAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, command='', working_directory='', timeout_seconds=30)[source]
Bases:
BaseActionAction to execute a system command
- class modules.connector_actions.KeyPressAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, input_type='key', action_mode='press', key_sequence='', repeat_count=1, repeat_interval=0.1, hold_duration=0.5, macro_sequence='')[source]
Bases:
BaseActionAction to simulate keyboard and mouse input
- class modules.connector_actions.SendChatMessageAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, message='')[source]
Bases:
BaseActionAction to send a message to Twitch chat
- class modules.connector_actions.SendGreetingAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, user_id='', username='', force_send=True)[source]
Bases:
BaseActionAction to send a greeting to a user (even if already sent)
- class modules.connector_actions.TemplateControlAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, template_name='', control_action='', control_data=None)[source]
Bases:
BaseActionAction to control template elements via WebSocket
- class modules.connector_actions.TriggerAlertAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, alert_type='', alert_id='', alert_data=None)[source]
Bases:
BaseActionAction to trigger an alert through the alert system
- class modules.connector_actions.UpdateGreetingAction(action_id, action_type, name, description='', enabled=None, parameters=<factory>, metadata=<factory>, greeting_id='', greeting_text='')[source]
Bases:
BaseActionAction to update an existing greeting
- class modules.connector_actions.WebSocketEmitAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, event_name='', event_data=None)[source]
Bases:
BaseActionAction to emit a custom WebSocket event
- class modules.connector_actions.WriteFileAction(action_id, action_type, name, description='', enabled=True, parameters=<factory>, metadata=<factory>, file_path='', content='', append=False)[source]
Bases:
BaseActionAction to write data to a file
Service Integration
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.connector_integration.ConnectorIntegration[source]
Bases:
objectIntegration layer between the connector system and existing Mycelian modules
- async send_hotkey_event(key_code, modifiers=None, is_global=True)[source]
Send a hotkey event to the connector system
Connector Examples
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- modules.connector_examples.create_chat_command_example()[source]
Create an example connector that responds to a chat command
- Return type:
- modules.connector_examples.create_donation_log_example()[source]
Create an example connector that logs donations to a file
- Return type:
- modules.connector_examples.create_example_connectors()[source]
Create example connectors to demonstrate the system
- modules.connector_examples.create_high_bits_counter_example()[source]
Create an example connector that increments counter for high bit amounts
- Return type:
Hotkey System
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.hotkey_listener.HotkeyListener[source]
Bases:
objectGlobal hotkey listener for connector system
Utility Modules
Data Objects
Path Utilities
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- modules.path_utils.ensure_directory_exists(path)[source]
Ensure that a directory exists, creating it if necessary.
- modules.path_utils.get_assets_path(relative_path='')[source]
Get absolute path to assets directory/files.
- modules.path_utils.get_data_path(relative_path)[source]
Get absolute path to data files, works for both development and PyInstaller. Data files are those that should persist and be writable (configs, databases, logs).
- modules.path_utils.get_executable_dir()[source]
Get the directory containing the executable or script.
- Returns:
Directory path
- Return type:
- modules.path_utils.get_resource_path(relative_path)[source]
Get absolute path to resource, works for both development and PyInstaller.
- modules.path_utils.get_static_path(relative_path='')[source]
Get absolute path to static directory/files.
- modules.path_utils.get_template_path(relative_path='')[source]
Get absolute path to template directory/files.
Encryption Utilities
API Credentials Manager
Template Configuration
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.template_config_parser.TemplateConfigParser(config_dir='templates/template_configs')[source]
Bases:
objectParser for template configuration files. Handles reading, editing, and saving JSON configuration files.
Get a list of all non-hidden configuration files
Check if a configuration is marked as hidden
- modules.template_config_parser.resolve_dynamic_control_values_from_elements(config)[source]
Return a deep copy of
dynamic_controlswith displayvaluetaken from the mainelementsentry identified bypersist.target_element_idwhen present, matching whatpersist_template_control_changewrites. Then, whenpersistincludesruntime_database_pathandruntime_state_key, overlayvaluefrom that database document (see_overlay_source_control_runtime_state). Otherwise each control keeps its JSON defaults.
Preview Mappings
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- modules.preview_mappings.get_builtin_variable_mappings()[source]
Get the comprehensive mapping of built-in variables to example values.
This mapping is used by the chatbot preview functionality to replace variables in command/event responses with realistic example values.
Migration and Maintenance
Database Migration
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.alert_database_migration.MigrationResult(total_alerts=0, successful_migrations=0, failed_migrations=0, skipped_alerts=0, alert_type_counts=None, errors=None)[source]
Bases:
objectResult of an alert migration operation
- modules.alert_database_migration.migrate_alerts_from_file(file_path, overwrite_existing=False)[source]
Migrate alerts from an external JSON file.
- Parameters:
- Returns:
Detailed results of the migration
- Return type:
- modules.alert_database_migration.preview_migration(file_path)[source]
Preview what would be migrated from a file without actually migrating.
MIT License
Copyright (c) 2024 Mycelian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class modules.alerts_migration.AlertMigrationResult[source]
Bases:
objectResults of an alert migration operation
- class modules.alerts_migration.AlertsMigrator[source]
Bases:
objectMigrates alerts from external JSON files to Mycelian’s alert system
Updater
Build System
Improved PyInstaller build script for Mycelian Balances size optimization with proper NiceGUI and web engine support
- class build.BuildProgress(total_steps=5)[source]
Bases:
objectSimple progress tracking for the build process
- build.get_excluded_modules()[source]
Get list of modules to exclude from build (conservative exclusions only)
Get list of hidden imports that PyInstaller might miss, filtered by OS