API Reference

The following section outlines the API of imvu.py.

Note

This module uses the Python logging module to log diagnostic and errors in an output independent way. If the logging module is not configured, these logs will not be output anywhere. See Setting Up Logging for more information on how to set up and use the logging module with imvu.py.

Client

class imvu.Client(username=None, password=None, loop=None)

Represents a client connection that connects to IMVU. This class is used to interact with the IMVU API.

Parameters:
  • username – Login username to IMVU.
  • password – Login password to IMVU.
  • loop – Optional event loop to use.
get_avatar(id) → typing.Union[imvu.avatar.Avatar, NoneType]

Lookup and retrieve an avatar.

Parameters:id – The ID of the avatar to retrieve.
Returns:A Avatar if found, else None.
get_product(id, hidden=False) → typing.Union[imvu.product.Product, NoneType]

Lookup and retrieve a product.

Parameters:
  • id – The ID of the product to retrieve.
  • hidden – Attempt to retrieve the product even if hidden.
Returns:

A Product if found, else None.

get_raw(path, id: int = 0) → typing.Union[dict, NoneType]

Returns the raw JSON data for a given Route and ID.

Parameters:
  • path (str) – API path to lookup.
  • id (int) – ID to inject into the API path.
Returns:

Raw dictionary of data retrieved. If not found, returns None.

Return type:

dict or None

get_user(id: int = None, username: str = None) → typing.Union[imvu.user.User, NoneType]

Lookup and retrieve a user

Parameters:
  • id – The ID of the user to retrieve.
  • username – Username to lookup and retrieve.
Returns:

A User if found, else None.

Enumerations

The API provides some enumerations for certain types of strings to avoid the API from being stringly typed in case the strings change in the future.

All enumerations are subclasses of enum.

class imvu.Availability

Specifies the availability of a User.

ONLINE

User is online.

AVAILABLE

User is online and available.

AWAY

User is online but away.

DND

User is online but chooses to ignore notifications.

DO_NOT_DISTURB

An alias for DND.

OFFLINE

User is completely offline.

class imvu.Visibility

Specifies the visibility of a Product.

VISIBLE

Product is visible from the shop and purchasable.

DISPLAY_ONLY

Product is visible from the shop but not purchasable.

HIDDEN

Product is not visible in the shop and may only be obtained through the creator.

REMOVED

Product is hidden but cannot be obtained through any means.

class imvu.Gender

Specifies the gender of a User or Product.

MALE

Male sex.

FEMALE

Female sex.

HIDDEN

Gender is hidden or unavailable.

class imvu.RelationshipStatus

Specifies a User’s relationship status.

PREFER_NOT_TO_SAY

User declined to state their relationship status.

SINGLE

User is single.

SEEING_SOMEONE

User is seeing someone.

RELATIONSHIP

User is in a relationship.

MARRIED

User is married.

DIVORCED

User is divorced (was married).

OTHER

Similar to prefer not to say, but indecisive.

class imvu.Orientation

Specifies a User ‘s orientation.

PREFER_NOT_TO_SAY

User declined to state their orientation.

STRAIGHT

User identifies as straight (heterosexual).

GAY

User identifies as gay/lesbian (homosexual).

LESBIAN

An alias for GAY.

BISEXUAL

User identifies as bisexual.

QUESTIONING

User is questioning their orientation.

OTHER

User is some other unlisted orientation.

Data Classes

Some classes are just there to be data containers, this lists them.

Note

The data classes listed below are not intended to be created by users and are also read-only.

For example, this means that you should not make your own User instances nor should you modify the User instance yourself.

If you want to get one of these data classes instances they’d have to be through the client, and a common way of doing so is through the Client.get_user() and other function or attributes of data classes that you receive from the events specified in Client.

Warning

Nearly all data classes here have __slots__ defined which means that it is impossible to have dynamic attributes to the data classes.

More information about __slots__ can be found in the official python documentation.

IMVUObject

class imvu.IMVUObject
id

Get the unique ID of the object.

Returns:The unique integer ID given by IMVU

User

class imvu.User

Represents an IMVU user.

username

Username of a user.

created

The date and time a user registered their account.

Returns:Datetime that the user registered.
Return type:datetime.datetime
id

Get the unique ID of the object.

Returns:The unique integer ID given by IMVU

Avatar

class imvu.Avatar

Represents an IMVU avatar.

created

The date and time a user registered their account.

Returns:Datetime that the user registered.
Return type:datetime.datetime
id

Get the unique ID of the object.

Returns:The unique integer ID given by IMVU
look_url

Get the look URL for an avatar.

Returns:The API URL to the look.
Return type:str
products

Get a list of products that the avatar is wearing.

Returns:A list containing each Product an avatar is wearing.
Return type:list

Product

class imvu.Product

Represents an IMVU product.

creator

The creator of a Product.

Returns:The User that created the product.
Return type:User
download(output=None, full=False)

Download a Product.

Parameters:
  • output (str or None) – The path to output the files.
  • full (bool or None) – Download the entire derivation tree of a product.
id

Get the unique ID of the object.

Returns:The unique integer ID given by IMVU

Exceptions

The following exceptions are thrown by the library.

exception imvu.IMVUException
exception imvu.DownloadError