friendlypins.user module

Interfaces for interacting with Pinterest users

class friendlypins.user.User(url, rest_io)[source]

Bases: object

Abstraction around a Pinterest user and their associated data

Parameters
  • url (str) – URL for this user, relative to the API root

  • rest_io (RestIO) – reference to the Pinterest REST API

property account_type

type of Pinterest account (ie: individual / business)

Type

str

property bio

description of who this user is

Type

str

property boards

Generator for iterating over the boards owned by this user

Type

Board

create_board(name, description=None)[source]

Creates a new board for the currently authenticated user

Parameters
  • name (str) – name for the new board

  • description (str) – optional descriptive text for the board

Returns

reference to the newly created board

Return type

Board

property created

when this user’s profile was created

Type

datetime.datetime

static default_fields()[source]

list (str): list of fields we pre-populate when loading user data

property first_name

the first name of the user

Type

str

property last_name

the last name of the user

Type

str

property name

the full name of the user

alias for first_name + last_name

Type

str

property num_boards

the total number of boards owned by this user

Type

int

property num_followers

number of people following this Pinterest user

Type

int

property num_pins

the total number of pins owned by this user

Type

int

refresh()[source]

Updates cached response data describing the state of this user

NOTE: This method simply clears the internal cache, and updated information will automatically be pulled on demand as additional queries are made through the API

property unique_id

Gets the internal unique ID associated with the user

Type

int

property url

the URL of the users profile

Type

str

property username

display name, used for logging in to Pinterest

Type

str