### Install Project Dependencies Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Installs the necessary Python packages for the UMAPI SDK from a requirements file. Ensure you have pip and Python installed. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install email2username.py Dependencies Source: https://github.com/adobe-apiplatform/umapi-sdk/blob/master/email2username.py/README.md Installs the necessary Python dependencies for the email2username.py script using pip. This command should be run before executing the script to ensure all requirements are met. ```bash pip -r requirements.txt ``` -------------------------------- ### Configure UMAPI SDK with Credentials Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Sets up the necessary configuration for the UMAPI SDK by defining Adobe API credentials in a YAML file. This includes organization ID, technical account ID, API key, client secret, and private key file path. This configuration is essential for authenticating with Adobe's services. ```bash cat > config.yml << 'EOF' org_id: 'YOUR_ORG_ID@AdobeOrg' tech_acct_id: 'XXXXX@techacct.adobe.com' api_key: 'your_api_key' client_secret: 'your_client_secret' private_key_file: 'private.key' EOF ``` -------------------------------- ### Read and Write CSV Files with CSVAdapter (Python) Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Demonstrates the usage of the `CSVAdapter` utility class for reading and writing CSV and TSV files in Python. It supports automatic delimiter detection, encoding handling, and reading rows as dictionaries. ```python from util import CSVAdapter # Read CSV rows as dictionaries cols = ['Username', 'Email'] for row in CSVAdapter.read_csv_rows('users.csv', recognized_column_names=cols): username = row.get('Username') email = row.get('Email') print(f"Processing: {username} -> {email}") # Read TSV file (auto-detected from .tsv extension) for row in CSVAdapter.read_csv_rows('users.tsv', recognized_column_names=['Name', 'ID']): print(row) # Write CSV output field_names = ['Username', 'Email', 'Status'] rows = [ {'Username': 'user1', 'Email': 'user1@example.com', 'Status': 'converted'}, {'Username': 'user2', 'Email': 'user2@example.com', 'Status': 'converted'} ] CSVAdapter.write_csv_rows('output.csv', field_names, rows) # Custom delimiter and encoding for row in CSVAdapter.read_csv_rows('users.csv', recognized_column_names=cols, encoding='utf-8', delimiter=','): print(row) ``` -------------------------------- ### Prepare User Mapping CSV for UMAPI SDK Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Creates a CSV file to map existing usernames to their corresponding email addresses. This is a crucial step for UMAPI SDK operations that involve user identity conversion, especially after migrating from email-to-username federation. ```bash cat > users.csv << 'EOF' Username,Email jsmith,john.smith@company.com mjones,mary.jones@company.com bwilson,bob.wilson@company.com EOF ``` -------------------------------- ### Configure UMAPI Integration Credentials (YAML) Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Sets up the YAML configuration file with OAuth credentials required for UMAPI integration. This file stores sensitive information like organization ID, technical account ID, API key, client secret, and the private key file path. ```yaml # config.yml org_id: 'YOUR_ORG_ID@AdobeOrg' tech_acct_id: 'XXXXX@techacct.adobe.com' api_key: 'your_api_key_here' client_secret: 'your_client_secret_here' private_key_file: '/path/to/private.key' ``` -------------------------------- ### Run email2username.py Script (Email to Username) Source: https://github.com/adobe-apiplatform/umapi-sdk/blob/master/email2username.py/README.md Executes the email2username.py script to convert Federated ID users from email-based to username-based federation. Requires a configuration file for UMAPI credentials and a CSV file mapping usernames to emails. ```python python email2username.py -c config.yml -u users.csv ``` -------------------------------- ### Run email2username.py Script (Username to Email - Reverse) Source: https://github.com/adobe-apiplatform/umapi-sdk/blob/master/email2username.py/README.md Executes the email2username.py script in reverse mode to convert Federated ID users from username-based to email-based federation. Requires a configuration file for UMAPI credentials and a CSV file mapping emails to usernames. ```python python email2username.py -r -c config.yml -u users.csv ``` -------------------------------- ### Test UMAPI SDK User Conversion Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Executes the UMAPI SDK in test mode to validate the configuration and user mappings without making any actual changes to user accounts. This helps in identifying potential issues before performing live conversions. ```bash python email2username.py -c config.yml -u users.csv -t ``` -------------------------------- ### Process Adobe Admin Console Export File Format Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Illustrates the structure of user export files obtained directly from the Adobe Admin Console. This format includes additional columns beyond 'Username' and 'Email' that are ignored during the conversion process. ```csv Identity Type,Username,Domain,Email,First Name,Last Name,Country Code,Product Configurations,Admin Roles,Product Configurations Administered Federated ID,dbrotsky-test-1,ad.unc.edu,dbrotsky-test-1@ad.unc.edu,Dan Test 1,Brotsky,US,Instructional Faculty/Staff,, Federated ID,dbrotsky-test-2,ad.unc.edu,dbrotsky-test-2@ad.unc.edu,Dan Test 2,Brotsky,US,Student,, Federated ID,918272819,ad.unc.edu,dbrotsky-test-3@ad.unc.edu,Dan Test 3,Brotsky,US,Departmental Faculty/Staff,, ``` -------------------------------- ### Convert Federated ID Usernames (Python CLI) Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Executes the `email2username.py` command-line tool to convert Federated ID usernames. It supports converting from email to username, running in test mode, and reversing the conversion. Requires configuration and user CSV files as input. ```bash # Convert usernames from email to specified username python email2username.py -c config.yml -u users.csv # Run in test mode (no changes made, validates configuration) python email2username.py -c config.yml -u users.csv -t # Reverse conversion (set username back to email) python email2username.py -c config.yml -u users.csv -r # Full command reference python email2username.py --help # usage: email2username.py [-h] -c config.yml -u users.csv [-t] [-r] # # Federated ID Convert from Email to Username Tool # # optional arguments: # -h, --help show this help message and exit # -c config.yml, --config config.yml # path to config file containing integration credentials # -u users.csv, --users users.csv # path to csv spreadsheet with columns Username, Email # -t, --test-mode run updates in test mode (no changes made) # -r, --reverse reverse conversion (set username to email) ``` -------------------------------- ### Reverse UMAPI SDK User Conversion Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Reverses a previously executed user conversion using the UMAPI SDK. This is useful for reverting changes if necessary, by transforming usernames back to their original format. ```bash python email2username.py -c config.yml -u users.csv -r ``` -------------------------------- ### Process Admin Console Export with UMAPI SDK Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Utilizes the UMAPI SDK to process a CSV file exported from the Admin Console. The script processes email-to-username conversions, logging unrecognized columns but ignoring them to ensure smooth operation. ```python python email2username.py -c config.yml -u example-users-export.csv ``` -------------------------------- ### Define User CSV File Format Source: https://context7.com/adobe-apiplatform/umapi-sdk/llms.txt Specifies the required format for the user CSV file used by `email2username.py`. It must contain 'Username' and 'Email' columns to map users for conversion. ```csv Username,Email dbrotsky-test-1,dbrotsky-test-1@ad.unc.edu dbrotsky-test-2,dbrotsky-test-2@ad.unc.edu 918272819,dbrotsky-test-3@ad.unc.edu ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.