Welcome to friendlypins’ documentation!

License Test Coverage Documentation Status Requirements Status Python Versions Format Latest Version Build status

friendlypins

friendlypins package

Subpackages

friendlypins.scripts package
Submodules
friendlypins.scripts.fpins module
friendlypins.scripts.webp2jpeg module

Command line tool for converting webp images into jpegs

WARNING This is a prototype, that needs to be more fully tested before it should be considered production ready.

friendlypins.scripts.webp2jpeg.configure_logging(verbosity)[source]

Configures the global logger for the application

Parameters:verbosity (int) – numeric value for the verbosity level for the log the larger the number, the more verbose the output
friendlypins.scripts.webp2jpeg.get_args(args)[source]

Helper method used to parse command line parameters

Parameters:args (str) – optional command line arguements to be parsed if not provided, args will be parsed from the console
Returns:parsed arguments
Return type:argparse.Namespace
friendlypins.scripts.webp2jpeg.main(args=None)[source]

Entry point function

Params str args:
 sample command line parameters to use when launching the tool used for debug and testing purposes only When not provided, arguments will be parsed from the command line
Returns:error code produced by completing the given operation
Return type:int
Module contents

Command line interfaces for interacting with project APIs

friendlypins.utils package
Submodules
friendlypins.utils.console_actions module
friendlypins.utils.rest_io module
Module contents

Helper scripts used by various parts of the API

Submodules

friendlypins.api module
friendlypins.board module

Primitives for interacting with Pinterest boards

class friendlypins.board.Board(data, rest_io)[source]

Bases: object

Abstraction around a Pinterest board

Parameters:
  • data (dict) – Raw Pinterest API data describing the board
  • rest_io (friendlypins.utils.rest_io.RestIO) – reference to the Pinterest REST API
delete()[source]

Removes this board and all pins attached to it

description

Gets the descriptive text associated with this board

Return type:str
name

The name of the board

Return type:str
num_pins

Gets the total number of pins linked to this board

Return type:int
pins

Generator for iterating over the pins linked to this board

Return type:Generator of friendlypins.pin.Pin
unique_id

The unique identifier associated with this board

Return type:int
url

Web address for the UI associated with the dashboard

Return type:str
friendlypins.headers module
friendlypins.pin module

Primitives for operating on Pinterest pins

class friendlypins.pin.Pin(data, rest_io)[source]

Bases: object

Abstraction around a Pinterest pin

Parameters:
  • data (dict) – Raw Pinterest API data describing a pin
  • rest_io (friendlypins.utils.rest_io.RestIO) – reference to the Pinterest REST API
delete()[source]

Removes this pin from it’s respective board

Source URL containing the original data for the pin

Return type:str
media_type

Gets descriptor for the type of data stored in the pin’s link

Returns None if the type of data associated with the Pin is unknown

Return type:str
note

Descriptive text associated with pin

Return type:str
thumbnail

Gets the thumbnail image associated with this pin

Return type:friendlypins.thumbnail.Thumbnail
unique_id

The unique identifier associated with this pin

Return type:int
url

Web address for the UI associated with the pin

Return type:str
friendlypins.thumbnail module

Primitives for operating on Pinterest pins

class friendlypins.thumbnail.Thumbnail(data)[source]

Bases: object

Abstraction around a Pin’s thumbnail

Parameters:
  • data (dict) – Raw Pinterest API data describing a thumbnail
  • root_url (str) – URL of the Pinterest REST API
  • token (str) – Authentication token for interacting with the API
height

The height of the thumbnail image, in pixels

Return type:int
url

Source URL where the thumbnail image can be found

Return type:str
width

The width of the thumbnail image, in pixels

Return type:int
friendlypins.user module

Interfaces for interacting with Pinterest users

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

Bases: object

Abstraction around a Pinterest user and their associated data

Parameters:
  • data (dict) – JSON data parsed from the API
  • rest_io (friendlypins.utils.rest_io.RestIO) – reference to the Pinterest REST API
boards

Generator for iterating over the boards owned by this user

Return type:Generator of friendlypins.board.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:

friendlypins.board.Board

first_name

Gets the first name of the user

Return type:str
last_name

Gets the last name of the user

Return type:str
name

Gets the name of the user

alias for first_name + last_name

Return type:str
num_boards

Gets the total number of boards owned by this user

Return type:int
num_pins

Gets the total number of pins owned by this user

Return type:int
unique_id

Gets the internal unique ID associated with the user

Return type:int
url

Gets the URL of the users profile

Return type:str
friendlypins.version module

Module contents

Package definition for the project

Overview

User friendly Python wrapper for the Pinterest developer APIs. This project is currently in very early development, with only a bare minimum of functionality, intended for some of my personal projects. I’m sharing it here in case someone finds the implementation helpful for their projects. Also, if anyone would like to contribute to this pet project feel free to fork it and send me pull requests for any changes you may like.

Comments, suggestions and bugs may be reported to the project maintainer

Indices and tables