pyremoteplay.profile module

Collections for User Profiles.

These classes shouldn’t be created manually. Use the helper methods such as: pyremoteplay.profile.Profiles.load() and pyremoteplay.device.RPDevice.get_profiles()

pyremoteplay.profile.format_user_account(user_data)

Format account data to user profile. Return user profile.

Parameters

user_data (dict) – User data. See pyremoteplay.oauth.get_user_account()

Return type

UserProfile

class pyremoteplay.profile.HostProfile(name, data)

Bases: UserDict

Host Profile for User.

property name: str

Return Name / Mac Address.

Return type

str

property type: str

Return type.

Return type

str

property regist_key: str

Return Regist Key.

Return type

str

property rp_key: str

Return RP Key.

Return type

str

class pyremoteplay.profile.UserProfile(name, data)

Bases: UserDict

PSN User Profile. Stores Host Profiles for user.

update_host(host_profile)

Update host profile.

Param

host_profile: Host Profile

add_regist_data(host_status, data)

Add regist data to user profile.

Parameters
property name: str

Return PSN Username.

Return type

str

property id: str

Return Base64 encoded User ID.

Return type

str

property hosts: list[HostProfile]

Return Host profiles.

class pyremoteplay.profile.Profiles(dict=None, /, **kwargs)

Bases: UserDict

Collection of User Profiles.

classmethod set_default_path(path)

Set default path for loading and saving.

Parameters

path (str) – Path to file.

classmethod default_path()

Return default path.

Return type

str

classmethod load(path='')

Load profiles from file.

Parameters

path (str) – Path to file. If not given will use default_path(). File will be created automatically if it does not exist.

Return type

Profiles

new_user(redirect_url, save=True)

Create New PSN user.

See pyremoteplay.oauth.get_login_url().

Parameters
  • redirect_url (str) – URL from signing in with PSN account at the login url

  • save – Save profiles to file if True

Return type

UserProfile

update_user(user_profile)

Update stored User Profile.

Parameters

user_profile (UserProfile) – User Profile

update_host(user_profile, host_profile)

Update host in User Profile.

Parameters
remove_user(user)

Remove user.

Parameters

user (Union[str, UserProfile]) – User profile or user name to remove

save(path='')

Save profiles to file.

Parameters

path (str) – Path to file. If not given will use default path.

get_users(device_id)

Return all users that are registered with a device.

Parameters

device_id – Device ID / Device Mac Address

get_user_profile(user)

Return User Profile for user.

Parameters

user (str) – PSN ID / Username

Return type

UserProfile

property usernames: list[str]

Return list of user names.

property users: list[UserProfile]

Return User Profiles.