deviantart package¶
Submodules¶
deviantart.api module¶
deviantart.api¶
A Python wrapper for the DeviantArt API
copyright: |
|
---|
-
class
deviantart.api.
Api
(client_id, client_secret, redirect_uri='', standard_grant_type='client_credentials', scope='browse feed message note stash user user.manage comment.post collection')¶ Bases:
object
The API Interface (handles requests to the DeviantArt API)
Parameters: - client_id – client_id provided by DeviantArt
- client_secret – client_secret provided by DeviantArt
- standard_grant_type – The used authorization type | client_credentials (read-only) or authorization_code
- scope – The scope of data the application can access
-
auth
(code='', refresh_token='')¶ Authenticates user and retrieves (and refreshes) access token
Parameters: - code – code provided after redirect (authorization_code only)
- refresh_token – the refresh_token to update access_token without authorization
-
auth_uri
¶ The authorzation URL that should be provided to the user
-
browse
(endpoint='hot', category_path='', seed='', q='', timerange='24hr', tag='', offset=0, limit=10)¶ Fetch deviations from public endpoints
Parameters: - endpoint – The endpoint from which the deviations will be fetched (hot/morelikethis/newest/undiscovered/popular/tags)
- category_path – category path to fetch from
- q – Search query term
- timerange – The timerange
- tag – The tag to browse
- offset – the pagination offset
- limit – the pagination limit
-
browse_dailydeviations
()¶ Retrieves Daily Deviations
-
browse_morelikethis_preview
(seed)¶ Fetch More Like This preview result for a seed deviation
Parameters: seed – The deviationid to fetch more like
-
browse_userjournals
(username, featured=False, offset=0, limit=10)¶ Fetch user journals from user
Parameters: - username – name of user to retrieve journals from
- featured – fetch only featured or not
- offset – the pagination offset
- limit – the pagination limit
-
create_notes_folder
(title, parentid='')¶ Create new folder
Parameters: - title – The title of the folder to create
- parentid – The UUID of the parent folder
-
delete_message
(messageid='', folderid='', stackid='')¶ Delete a message or a message stack
Parameters: - folderid – The folder to delete the message from, defaults to inbox
- messageid – The message to delete
- stackid – The stack to delete
-
delete_notes
(noteids)¶ Delete a note or notes
Parameters: noteids – The noteids to delete
-
delete_notes_folder
(folderid)¶ Delete note folder
Parameters: folderid – The UUID of the folder to delete
-
download_deviation
(deviationid)¶ Get the original file download (if allowed)
Parameters: deviationid – The deviationid you want download info for
-
fave
(deviationid, folderid='')¶ Add deviation to favourites
Parameters: - deviationid – Id of the Deviation to favourite
- folderid – Optional UUID of the Collection folder to add the favourite into
-
get_categories
(catpath='/')¶ Fetch the categorytree
Parameters: catpath – The category to list children of
-
get_collection
(folderid, username='', offset=0, limit=10)¶ Fetch collection folder contents
Parameters: - folderid – UUID of the folder to list
- username – The user to list folders for, if omitted the authenticated user is used
- offset – the pagination offset
- limit – the pagination limit
-
get_collections
(username='', calculate_size=False, ext_preload=False, offset=0, limit=10)¶ Fetch collection folders
Parameters: - username – The user to list folders for, if omitted the authenticated user is used
- calculate_size – The option to include the content count per each collection folder
- ext_preload – Include first 5 deviations from the folder
- offset – the pagination offset
- limit – the pagination limit
-
get_comments
(endpoint='deviation', deviationid='', commentid='', username='', statusid='', ext_item=False, offset=0, limit=10, maxdepth=0)¶ Fetch comments
Parameters: - endpoint – The source/endpoint you want to fetch comments from (deviation/profile/status/siblings)
- deviationid – The deviationid you want to fetch
- commentid – The commentid you want to fetch
- username – The username you want to get a list of status updates from
- statusid – The statusid you want to fetch
- ext_item – the pagination limit
- offset – the pagination offset
- limit – the pagination limit
- maxdepth – Depth to query replies until
-
get_countries
()¶ Get a list of countries
-
get_damntoken
()¶ Retrieve the dAmn auth token required to connect to the dAmn servers
-
get_data
(endpoint='privacy')¶ Returns policies of DeviantArt
-
get_deviation
(deviationid)¶ Fetch a single deviation
Parameters: deviationid – The deviationid you want to fetch
-
get_deviation_content
(deviationid)¶ Fetch full data that is not included in the main devaition object
The endpoint works with journals and literatures. Deviation objects returned from API contain only excerpt of a journal, use this endpoint to load full content. Any custom CSS rules and fonts applied to journal are also returned.
Parameters: deviationid – UUID of the deviation to fetch full data for
-
get_deviation_embeddedcontent
(deviationid, offset_deviationid='', offset=0, limit=10)¶ Fetch content embedded in a deviation
Parameters: - deviationid – The deviationid of container deviation
- offset_deviationid – UUID of embedded deviation to use as an offset
- offset – the pagination offset
- limit – the pagination limit
-
get_deviation_metadata
(deviationids, ext_submission=False, ext_camera=False, ext_stats=False, ext_collection=False)¶ Fetch deviation metadata for a set of deviations
Parameters: - deviationid – The deviationid you want to fetch
- ext_submission – Return extended information - submission information
- ext_camera – Return extended information - EXIF information (if available)
- ext_stats – Return extended information - deviation statistics
- ext_collection – Return extended information - favourited folder information
-
get_feedback
(feedbacktype='comments', folderid='', stack=1, offset=0, limit=10)¶ Fetch feedback messages
Parameters: - feedbacktype – Type of feedback messages to fetch (comments/replies/activity)
- folderid – The folder to fetch messages from, defaults to inbox
- stack – True to use stacked mode, false to use flat mode
- offset – the pagination offset
- limit – the pagination limit
-
get_feedback_in_stack
(stackid, offset=0, limit=10)¶ Fetch feedback messages in a stack
Parameters: - stackid – Id of the stack
- offset – the pagination offset
- limit – the pagination limit
-
get_friends
(username, offset=0, limit=10)¶ Get the users list of friends
Parameters: - username – The username you want to get a list of friends of
- offset – the pagination offset
- limit – the pagination limit
-
get_gallery_folder
(username='', folderid='', mode='popular', offset=0, limit=10)¶ Fetch gallery folder contents
Parameters: - username – The user to query, defaults to current user
- folderid – UUID of the folder to list, if omitted query ALL folders
- mode – Sort results by either newest or popular
- offset – the pagination offset
- limit – the pagination limit
-
get_gallery_folders
(username='', calculate_size=False, ext_preload=False, offset=0, limit=10)¶ Fetch gallery folders
Parameters: - username – The user to list folders for, if omitted the authenticated user is used
- calculate_size – The option to include the content count per each gallery folder
- ext_preload – Include first 5 deviations from the folder
- offset – the pagination offset
- limit – the pagination limit
-
get_mentions
(folderid='', stack=1, offset=0, limit=10)¶ Fetch mention messages
Parameters: - folderid – The folder to fetch messages from, defaults to inbox
- stack – True to use stacked mode, false to use flat mode
- offset – the pagination offset
- limit – the pagination limit
-
get_mentions_in_stack
(stackid, offset=0, limit=10)¶ Fetch mention messages in a stack
Parameters: - stackid – Id of the stack
- offset – the pagination offset
- limit – the pagination limit
-
get_messages
(folderid='', stack=1, cursor='')¶ Feed of all messages
Parameters: - folderid – The folder to fetch messages from, defaults to inbox
- stack – True to use stacked mode, false to use flat mode
-
get_note
(noteid)¶ Fetch a single note
Parameters: folderid – The UUID of the note
-
get_notes
(folderid='', offset=0, limit=10)¶ Fetch notes
Parameters: - folderid – The UUID of the folder to fetch notes from
- offset – the pagination offset
- limit – the pagination limit
-
get_notes_folders
()¶ Fetch note folders
-
get_status
(statusid)¶ Fetch the status
Parameters: statusid – Status uuid
-
get_statuses
(username, offset=0, limit=10)¶ Fetch status updates of a user
Parameters: - username – The username you want to get a list of status updates from
- offset – the pagination offset
- limit – the pagination limit
-
get_user
(username='', ext_collections=False, ext_galleries=False)¶ Get user profile information
Parameters: - username – username to lookup profile of
- ext_collections – Include collection folder info
- ext_galleries – Include gallery folder info
-
get_users
(usernames)¶ Fetch user info for given usernames
Parameters: username – The usernames you want metadata for (max. 50)
-
get_watchers
(username, offset=0, limit=10)¶ Get the user’s list of watchers
Parameters: - username – The username you want to get a list of watchers of
- offset – the pagination offset
- limit – the pagination limit
-
is_watching
(username)¶ Check if user is being watched by the given user
Parameters: username – Check if username is watching you
-
mark_notes
(noteids, mark_as)¶ Mark notes
Parameters: - noteids – The noteids to delete
- mark_as – Mark notes as (read/unread/starred/notstarred/spam)
-
move_notes
(noteids, folderid)¶ Move notes to a folder
Parameters: - noteids – The noteids to move
- folderid – The folderid to move notes to
-
post_comment
(target, body, comment_type='profile', commentid='')¶ Post comment
Parameters: - target – The target you want to post the comment to (username/deviation UUID/status UUID)
- body – The comment text
- comment_type – The type of entry you want to post your comment to
- commentid – The commentid you are replying to
-
post_status
(body='', id='', parentid='', stashid='')¶ Post a status
Parameters: - username – The body of the status
- id – The id of the object you wish to share
- parentid – The parentid of the object you wish to share
- stashid – The stashid of the object you wish to add to the status
-
rename_notes_folder
(title, folderid)¶ Rename a folder
Parameters: - title – New title of the folder
- folderid – The UUID of the folder to rename
Searches for tags
Parameters: tag_name – Partial tag name to get autocomplete suggestions for
-
send_note
(to, subject='', body='', noetid='')¶ Send a note
Parameters: - to – The username(s) that this note is to
- subject – The subject of the note
- body – The body of the note
- noetid – The UUID of the note that is being responded to
-
unfave
(deviationid, folderid='')¶ Remove deviation from favourites
Parameters: - deviationid – Id of the Deviation to unfavourite
- folderid – Optional UUID remove from a single collection folder
-
unwatch
(username)¶ Unwatch a user
Parameters: username – The username you want to unwatch
-
update_user
(user_is_artist='', artist_level='', artist_specialty='', real_name='', tagline='', countryid='', website='', bio='')¶ Update the users profile information
Parameters: - user_is_artist – Is the user an artist?
- artist_level – If the user is an artist, what level are they
- artist_specialty – If the user is an artist, what is their specialty
- real_name – The users real name
- tagline – The users tagline
- countryid – The users location
- website – The users personal website
- bio – The users bio
-
watch
(username, watch={'scraps': True, 'deviations': True, 'collections': True, 'activity': True, 'forum_threads': True, 'critiques': True, 'journals': True, 'friend': True})¶ Watch a user
Parameters: username – The username you want to watch
-
whofaved_deviation
(deviationid, offset=0, limit=10)¶ Fetch a list of users who faved the deviation
Parameters: - deviationid – The deviationid you want to fetch
- offset – the pagination offset
- limit – the pagination limit