Spaces:
Running
Running
# config.py | |
""" | |
Global configuration constants for the LinkedIn Organization Dashboard. | |
""" | |
# --- LinkedIn Post Constants --- | |
DEFAULT_INITIAL_FETCH_COUNT = 10 | |
DEFAULT_POSTS_UPDATE_FETCH_COUNT = 10 | |
LINKEDIN_POST_URN_KEY = 'id' # Key for post URN in LinkedIn API response | |
BUBBLE_POST_URN_COLUMN_NAME = 'id' # Column name for unique post ID in Bubble 'LI_posts' table | |
BUBBLE_POST_DATE_COLUMN_NAME = 'published_at' # Column name for post publication date in Bubble 'LI_posts' table | |
BUBBLE_POSTS_TABLE_NAME = "LI_posts" | |
BUBBLE_POST_STATS_TABLE_NAME = "LI_post_stats" | |
BUBBLE_POST_COMMENTS_TABLE_NAME = "LI_post_comments" | |
# --- LinkedIn Mentions Constants --- | |
BUBBLE_MENTIONS_TABLE_NAME = "LI_mentions" | |
BUBBLE_MENTIONS_ID_COLUMN_NAME = "id" # Column name for unique mention ID in Bubble | |
BUBBLE_MENTIONS_DATE_COLUMN_NAME = "date" # Column name for mention date in Bubble | |
DEFAULT_MENTIONS_INITIAL_FETCH_COUNT = 20 | |
DEFAULT_MENTIONS_UPDATE_FETCH_COUNT = 10 | |
# --- LinkedIn Follower Stats Constants --- | |
BUBBLE_FOLLOWER_STATS_TABLE_NAME = "LI_follower_stats" | |
FOLLOWER_STATS_CATEGORY_COLUMN = "category_name" # For demographics: name (e.g., "Engineering"), for monthly gains: date string 'YYYY-MM-DD' | |
FOLLOWER_STATS_TYPE_COLUMN = "follower_count_type" # e.g., "follower_seniority", "follower_gains_monthly" | |
FOLLOWER_STATS_ORG_URN_COLUMN = "organization_urn" # URN of the organization | |
FOLLOWER_STATS_ORGANIC_COLUMN = "follower_count_organic" | |
FOLLOWER_STATS_PAID_COLUMN = "follower_count_paid" | |
FOLLOWER_STATS_CATEGORY_COLUMN_DT = 'category_name_dt' # Temporary column for datetime conversion | |
# --- Environment Variable Names (Optional, for consistency if checking elsewhere) --- | |
LINKEDIN_CLIENT_ID_ENV_VAR = "Linkedin_client_id" | |
BUBBLE_APP_NAME_ENV_VAR = "BUBBLE_APP_NAME" | |
BUBBLE_API_KEY_PRIVATE_ENV_VAR = "BUBBLE_API_KEY_PRIVATE" | |
BUBBLE_API_ENDPOINT_ENV_VAR = "BUBBLE_API_ENDPOINT" | |
# --- UI Constants --- | |
UI_DATE_FORMAT = '%Y-%m-%d %H:%M' | |
UI_MONTH_FORMAT = '%Y-%m' | |
# --- NEW CONSTANTS for LinkedIn Data Operations Log --- | |
BUBBLE_OPERATIONS_LOG_TABLE_NAME = "linkedin_data_operations_log" | |
# Column names in the 'linkedin_data_operations_log' table in Bubble: | |
BUBBLE_OPERATIONS_LOG_DATE_COLUMN = "data" # Stores the timestamp of the sync attempt | |
BUBBLE_OPERATIONS_LOG_SUBJECT_COLUMN = "linkedin_data_operation_subject" # e.g., "post", "mention", "follower_stats" | |
BUBBLE_OPERATIONS_LOG_ORG_URN_COLUMN = "organization_urn" # Stores the org URN | |
# Standardized subject names for the operations log | |
LOG_SUBJECT_POSTS = "post" | |
LOG_SUBJECT_MENTIONS = "mention" | |
LOG_SUBJECT_FOLLOWER_STATS = "followers_stats" | |
BUBBLE_UNIQUE_ID_COLUMN_NAME = "_id" |