Welcome to yumpu-sdk’s documentation!¶
This SDK will help you to upload and manage your publications on Yumpu - a service for converting PDFs in web optimized e-Papers. For begin working with this SDK you will need to register on Yumpu and obtain the access token in your profile (https://www.yumpu.com/en/account/profile/api).
Install¶
The simplest way to install this SDK is by using PyPi.
pip install yumpu-sdk
or you can clone and install the version from our repo on github:
git clone https://github.com/gnunixon/python-yumpu-sdk.git
cd python-yumpu-sdk
python setup.py install
Using¶
from yumpu_sdk.api import Yumpu
yumpu = Yumpu('YOUR_TOKEN_HERE')
new_document = yumpu.document_post_file(
'My new document',
'/home/user/Documents/doc.pdf'
)
Contents:
-
class
yumpu_sdk.api.
Yumpu
(token)[source]¶ This is an SDK for working with Yumpu.com. It’s usefull for converting pdf documents to web optimized e-Papers.
For start working you need to register on Yumpu.com and get the token by accessing https://www.yumpu.com/en/account/profile/api.
If you have a free account, then you will have some limitations. The most important of them is that you can upload only one PDF every 15 minutes.
-
categories_get
()[source]¶ Get the list of categories.
Returns: a list of categories with their details Return type: json
-
collection_delete
(id)[source]¶ This method will delete a collection with given id.
Parameters: id (str) – the id of collection to delete Returns: the state of operation Return type: json >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.collection_delete('omkYGduXowlyx9WF') {"state":"success"}
-
collection_post
(name)[source]¶ Create a collection.
Parameters: name (str) – the name of new collection Returns: the details of new created collection Return type: json
-
collection_put
(id, name)[source]¶ Update a collection with given id.
Parameters: Returns: the status of operation and the edited collection
Return type: >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.collection_put('omkYGduXowlyx9WF', 'Holidays 2013') { "collection": [ { "id": "omkYGduXowlyx9WF", "create_date": "2013-09-23 09:05:47", "update_date": "2013-09-23 09:11:45", "name": "Holidays 2013", "order": 0, "sections": [ { "id": "omkYGduXowlyx9WF_stVFPUYW3kHX07B6", "name": "", "description": "", "sorting": "manually", "order": 0 } ] } ], "state": "success" }
-
collections_get
(offset=0, limit=10, return_fields=[])[source]¶ Retrieve a list of your collections.
Parameters:
-
countries_get
()[source]¶ Get the list of countries.
Returns: a list of supporting countries Return type: json
-
do_delete
(entry_point, id, uri='http://api.yumpu.com/2.0')[source]¶ This is a general function for deleting things on Yumpu.
Parameters: Returns: the result of deleting action
Return type:
-
do_get
(entry_point, params={}, uri='http://api.yumpu.com/2.0')[source]¶ This function is for getting information from API. It’s a general function and you can use it for make strange things like send very customized requests to API, but in general case you don’t need to use this method ever.
Parameters: Returns: the result of request
Return type:
-
do_post
(entry_point, params={}, filename=None, uri='http://api.yumpu.com/2.0')[source]¶ This is a general function for post something to Yumpu API. It’s a very general function, and is better to use somthing more specific.
Parameters: Returns: a response with detailed data of resulted action
Return type:
-
do_put
(entry_point, params={}, uri='http://api.yumpu.com/2.0')[source]¶ This is a general function for send PUT requests to Yumpu API. Is used by other functions for update things on Yumpu.
Parameters: Returns: the result of request
Return type:
-
document_delete
(id)[source]¶ This function will delete the document on Yumpu.
Parameters: id (int) – the id of document to delete Returns: the result of deleting action Return type: json
-
document_get
(id, return_fields=[])[source]¶ Retrieve one document.
Parameters: Returns: datas about one specific document
Return type: >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.document_get(53312964) { u'completed_in': u'0.0771', u'state': u'success', u'document': [ { u'update_date': u'2015-08-30 19:02:16', u'embed_code': u'<iframe width="512px" height="384px" src="https://www.yumpu.com/en/embed/view/0XDrujBssWG7uUQN" frameborder="0" allowfullscreen="true" allowtransparency="true"></iframe>', u'create_date': u'2015-08-30 19:01:11', u'description': u'', u'language': u'en', u'title': u'ACTIV-rom-22(78)-tipar.pdf', u'url': u'http://www.yumpu.com/en/document/view/53312964/activ-rom-2278-tiparpdf', u'short_url': u'http://www.yumpu.com/s/KAZWUpZLoZxNQZd0', u'image': { u'small': u'http://img.yumpu.com/53312964/1/115x163/activ-rom-2278-tiparpdf.jpg', u'big': u'http://img.yumpu.com/53312964/1/1129x1600/activ-rom-2278-tiparpdf.jpg', u'medium': u'http://img.yumpu.com/53312964/1/452x640/activ-rom-2278-tiparpdf.jpg' }, u'tags': False, u'access_tags': False, u'subscriptions': False, u'pages': u'1', u'width': u'452', u'height': u'640', u'id': u'53312964', u'settings': { u'magazine_page_teaser_url': u'', u'privacy_mode': u'public', u'player_branding': True, u'site_recommended_magazines': True, u'site_download_pdf': False, u'player_download_pdf': False, u'player_google_analytics_code': u'', u'player_inner_shadow': True, u'appkiosk_iap_sale_item': False, u'appkiosk_itc_product_id': u'', u'player_outer_shadow': True, u'player_social_sharing': True, u'magazine_page_teaser': False, u'player_html5_c2r': True, u'date_validity_until': u'', u'magazine_premium_blurred_page_range': u'', u'site_social_sharing': True, u'player_sidebar': False, u'player_print_page': False, u'date_validity_from': u'', u'magazine_premium_blurred': False, u'magazine_page_teaser_page_range': u'', u'magazine_page_teaser_image_url': u'' } } ] }
-
document_hotspot_delete
(id)[source]¶ Delete one document hotspot.
Parameters: id (str) – One of your document hotspot ids Return type: json
-
document_hotspot_get
(id, return_fields=['id', 'document_id', 'page', 'type', 'settings', 'create_date', 'update_date'])[source]¶ Retrieve a document hotspot
Parameters: - id (str) – One of your document hotspot ids
- return_fields (list) – Customize the responses by setting the return fields (id, document_id, page, type, settings, create_date, update_date)Customize the responses by setting the return fields (id, document_id, page, type, settings, create_date, update_date)
Return type:
-
document_hotspots_get
(id, page=None, offset=0, limit=10, sort='page_asc', return_fields=[])[source]¶ Retrieve a list of your document hotspots.
Parameters: - id (int) – the id of one of your documents
- page (int) – filter the results by page number (1-X)
- offset (int) – Retrieve rows at position X (min. 0)
- limit (int) – Retrieve X rows (min. 0 and max. 100)
- sort (str) – Sort results by create_date_desc, create_date_asc, page_desc, page_asc
- return_fields (list) – Customize the responses by setting the return fields (id, page, type, settings, create_date, update_date)
Return type:
-
document_post_file
(**kwargs)[source]¶ Create a new document from PDF.
Parameters: - title (str) – A title for your document. Min. length 5 characters, max. length 255 characters
- file (str) – The full path to pdf for converting
- description (str) – A description for your document. Min. length 5 characters, max. length 2500 characters
- category (int) – 1, 2 or … (A list of valid category ids: Document categories)
- language (str) – en, de or … (A list of valid languages: Document languages)
- tags (str) – A list of words seperated by comma (house,garden,balcony). Min. length 3 characters, max. length 30 characters. Allowed characters a-z and a space.
- visibility (str) – public, private, rprotected, pprotected, dprotected, webkiosk, appkiosk or webappkiosk (rprotected = protected by referrer, pprotected = protected by password, dprotected = protected by domain(s))
- domains (str) – A list of domains seperated by a comma (Note: Visibility must be set to dprotected) Examples: yumpu.com,blog.yumpu.com,developers.yumpu.com yumpu.com
- validity (str) – Valid from and / or valid until Examples: 2013-10-01T00:00:00-2013-10-30T23:59:59 (valid from 2013-10-01 00:00:00, valid until 2013-10-30 23:59:59) 2013-10-01T00:00:00- (valid from 2013-10-01 00:00:00-) -2013-10-30T23:59:59 (valid until -2013-10-30 23:59:59)
- blurred (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_image (str) – Image data The image must be less than 2 MB in size. Allowed mime types are image/gif, image/jpeg, image/pjpeg, image/png and image/x-png. The image will be resized to fit in the page dimensions (of your magazine). Note: If you use page_teaser_image, the parameters page_teaser_page_range and page_teaser_url are required.
- page_teaser_page_range (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_url (str) – A valid URL. Examples: http://www.yumpu.com/en
- downloadable (str) – Allow users to download your source pdf file. y or n
- detect_elements (str) – Detect elements automatically? y or n
- recommended_magazines (str) – Show recommended magazines on Yumpu? y or n
- social_sharing (str) – Show social sharing buttons on Yumpu. y or n
- player_social_sharing (str) – Show social sharing buttons in Yumpu Player. y or n
- player_download_pdf (str) – Show button „download pdf“ in Yumpu Player. y or n
- player_print_page (str) – Show button „print page“ in Yumpu Player. y or n
- player_branding (str) – Show Yumpu branding in Yumpu Player. y or n
- player_sidebar (str) – Show a list of recommended documents in Yumpu Player. y or n
- player_html5_c2r (str) – Activate HTML5 full screen on Yumpu. y or n
- player_outer_shadow (str) – Drop shadow in Yumpu player. y or n
- player_inner_shadow (str) – Shadow effects on pages. y or n
- player_ga (str) – Activate Google Analytics tracking. A valid UA code from Google Analytics.
- access_tags (str) – One or multiple access_tag ids (myid1 or myid1,myid2)
- subscriptions (str) – One or multiple subscription ids (myid1 or myid1,myid2)
- iap (str) – Enable In-App Purchase (y or n)
- itc_product_id (str) – iTunes Product ID
-
document_post_url
(**kwargs)[source]¶ Create a new document from PDF placed on given URL.
Parameters: - title (str) – A title for your document. Min. length 5 characters, max. length 255 characters
- url (str) – The URL of PDF
- description (str) – A description for your document. Min. length 5 characters, max. length 2500 characters
- category (int) – 1, 2 or … (A list of valid category ids: Document categories)
- language (str) – en, de or … (A list of valid languages: Document languages)
- tags (str) – A list of words seperated by comma (house,garden,balcony). Min. length 3 characters, max. length 30 characters. Allowed characters a-z and a space.
- visibility (str) – public, private, rprotected, pprotected, dprotected, webkiosk, appkiosk or webappkiosk (rprotected = protected by referrer, pprotected = protected by password, dprotected = protected by domain(s))
- domains (str) – A list of domains seperated by a comma (Note: Visibility must be set to dprotected) Examples: yumpu.com,blog.yumpu.com,developers.yumpu.com yumpu.com
- validity (str) – Valid from and / or valid until Examples: 2013-10-01T00:00:00-2013-10-30T23:59:59 (valid from 2013-10-01 00:00:00, valid until 2013-10-30 23:59:59) 2013-10-01T00:00:00- (valid from 2013-10-01 00:00:00-) -2013-10-30T23:59:59 (valid until -2013-10-30 23:59:59)
- blurred (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_image (str) – Image data The image must be less than 2 MB in size. Allowed mime types are image/gif, image/jpeg, image/pjpeg, image/png and image/x-png. The image will be resized to fit in the page dimensions (of your magazine). Note: If you use page_teaser_image, the parameters page_teaser_page_range and page_teaser_url are required.
- page_teaser_page_range (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_url (str) – A valid URL. Examples: http://www.yumpu.com/en
- downloadable (str) – Allow users to download your source pdf file. y or n
- detect_elements (str) – Detect elements automatically? y or n
- recommended_magazines (str) – Show recommended magazines on Yumpu? y or n
- social_sharing (str) – Show social sharing buttons on Yumpu. y or n
- player_social_sharing (str) – Show social sharing buttons in Yumpu Player. y or n
- player_download_pdf (str) – Show button „download pdf“ in Yumpu Player. y or n
- player_print_page (str) – Show button „print page“ in Yumpu Player. y or n
- player_branding (str) – Show Yumpu branding in Yumpu Player. y or n
- player_sidebar (str) – Show a list of recommended documents in Yumpu Player. y or n
- player_html5_c2r (str) – Activate HTML5 full screen on Yumpu. y or n
- player_outer_shadow (str) – Drop shadow in Yumpu player. y or n
- player_inner_shadow (str) – Shadow effects on pages. y or n
- player_ga (str) – Activate Google Analytics tracking. A valid UA code from Google Analytics.
- access_tags (str) – One or multiple access_tag ids (myid1 or myid1,myid2)
- subscriptions (str) – One or multiple subscription ids (myid1 or myid1,myid2)
- iap (str) – Enable In-App Purchase (y or n)
- itc_product_id (str) – iTunes Product ID
-
document_put
(**kwargs)[source]¶ Update document on Yumpu.
Parameters: - id (int) – The id of document to update.
- title (str) – A title for your document. Min. length 5 characters, max. length 255 characters
- description (str) – A description for your document. Min. length 5 characters, max. length 2500 characters
- category (int) – 1, 2 or … (A list of valid category ids: Document categories)
- language (str) – en, de or … (A list of valid languages: Document languages)
- tags (str) – A list of words seperated by comma (house,garden,balcony). Min. length 3 characters, max. length 30 characters. Allowed characters a-z and a space.
- visibility (str) – public, private, rprotected, pprotected, dprotected, webkiosk, appkiosk or webappkiosk (rprotected = protected by referrer, pprotected = protected by password, dprotected = protected by domain(s))
- domains (str) – A list of domains seperated by a comma (Note: Visibility must be set to dprotected) Examples: yumpu.com,blog.yumpu.com,developers.yumpu.com yumpu.com
- validity (str) – Valid from and / or valid until Examples: 2013-10-01T00:00:00-2013-10-30T23:59:59 (valid from 2013-10-01 00:00:00, valid until 2013-10-30 23:59:59) 2013-10-01T00:00:00- (valid from 2013-10-01 00:00:00-) -2013-10-30T23:59:59 (valid until -2013-10-30 23:59:59)
- blurred (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_image (str) – Image data The image must be less than 2 MB in size. Allowed mime types are image/gif, image/jpeg, image/pjpeg, image/png and image/x-png. The image will be resized to fit in the page dimensions (of your magazine). Note: If you use page_teaser_image, the parameters page_teaser_page_range and page_teaser_url are required.
- page_teaser_page_range (str) – Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
- page_teaser_url (str) – A valid URL. Examples: http://www.yumpu.com/en
- downloadable (str) – Allow users to download your source pdf file. y or n
- detect_elements (str) – Detect elements automatically? y or n
- recommended_magazines (str) – Show recommended magazines on Yumpu? y or n
- social_sharing (str) – Show social sharing buttons on Yumpu. y or n
- player_social_sharing (str) – Show social sharing buttons in Yumpu Player. y or n
- player_download_pdf (str) – Show button „download pdf“ in Yumpu Player. y or n
- player_print_page (str) – Show button „print page“ in Yumpu Player. y or n
- player_branding (str) – Show Yumpu branding in Yumpu Player. y or n
- player_sidebar (str) – Show a list of recommended documents in Yumpu Player. y or n
- player_html5_c2r (str) – Activate HTML5 full screen on Yumpu. y or n
- player_outer_shadow (str) – Drop shadow in Yumpu player. y or n
- player_inner_shadow (str) – Shadow effects on pages. y or n
- player_ga (str) – Activate Google Analytics tracking. A valid UA code from Google Analytics.
- access_tags (str) – One or multiple access_tag ids (myid1 or myid1,myid2)
- subscriptions (str) – One or multiple subscription ids (myid1 or myid1,myid2)
- iap (str) – Enable In-App Purchase (y or n)
- itc_product_id (str) – iTunes Product ID
-
documents_get
(offset=0, limit=10, sort='desc', return_fields=[])[source]¶ Retrieve a list of your documents.
Parameters: - offset (int) – Retrieve rows at position X (min. 0). Default is 0.
- limit (int) – Retrieve X rows (min. 0 and max. 100). Default is 10.
- sort (str) – Sort results ascending or descendening (asc or desc). Default is desc.
- return_fields (list) – Customize the responses by setting the return fields (id, create_date, update_date, url, short_url, image_small, image_medium, image_big, language, title, description, tags, embed_code, settings)
Returns: list of documents
Return type: >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.documents_get() { u'completed_in': u'0.0584', u'state': u'success', u'total': u'2', u'documents': [ { u'embed_code': u'<iframe width="512px" height="384px" src="https://www.yumpu.com/en/embed/view/lgjvMHH2ugIUSzdL" frameborder="0" allowfullscreen="true" allowtransparency="true"></iframe>', u'description': u'', u'language': u'en', u'title': u'Test file', u'url': u'http://www.yumpu.com/en/document/view/53486950/test-file', u'short_url': u'http://www.yumpu.com/s/jl0EutaH0Z7UI3KP', u'image': { u'small': u'http://img.yumpu.com/53486950/1/117x156/test-file.jpg', u'big': u'http://img.yumpu.com/53486950/1/1200x1600/test-file.jpg', u'medium': u'http://img.yumpu.com/53486950/1/480x640/test-file.jpg' }, u'tags': False, u'id': u'53486950' }, { u'embed_code': u'<iframe width="512px" height="384px" src="https://www.yumpu.com/en/embed/view/0XDrujBssWG7uUQN" frameborder="0" allowfullscreen="true" allowtransparency="true"></iframe>', u'description': u'', u'language': u'en', u'title': u'ACTIV-rom-22(78)-tipar.pdf', u'url': u'http://www.yumpu.com/en/document/view/53312964/activ-rom-2278-tiparpdf', u'short_url': u'http://www.yumpu.com/s/KAZWUpZLoZxNQZd0', u'image': { u'small': u'http://img.yumpu.com/53312964/1/115x163/activ-rom-2278-tiparpdf.jpg', u'big': u'http://img.yumpu.com/53312964/1/1129x1600/activ-rom-2278-tiparpdf.jpg', u'medium': u'http://img.yumpu.com/53312964/1/452x640/activ-rom-2278-tiparpdf.jpg' }, u'tags': False, u'id': u'53312964' } ] }
-
languages_get
()[source]¶ Get list of supporting languages.
Returns: a list of languages Return type: json >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.documents_get() {u'completed_in': u'0.0104', u'languages': [ {u'iso': u'en', u'name': u'english'}, {u'iso': u'de', u'name': u'german'}, {u'iso': u'fr', u'name': u'french'}, {u'iso': u'it', u'name': u'italian'}, {u'iso': u'es', u'name': u'spanish'}, {u'iso': u'nl', u'name': u'dutch'}, {u'iso': u'pt', u'name': u'portuguese'}, {u'iso': u'sv', u'name': u'swedish'}, {u'iso': u'da', u'name': u'danish'}, {u'iso': u'no', u'name': u'norwegian'}, {u'iso': u'gl', u'name': u'galician'}, {u'iso': u'ro', u'name': u'romanian'}, {u'iso': u'ca', u'name': u'catalan'}, {u'iso': u'pl', u'name': u'polish'}, {u'iso': u'id', u'name': u'indonesian'}, {u'iso': u'af', u'name': u'afrikaans'}, {u'iso': u'ru', u'name': u'russian'}, {u'iso': u'cs', u'name': u'czech'}, {u'iso': u'hu', u'name': u'hungarian'}, {u'iso': u'sl', u'name': u'slovene'}, {u'iso': u'et', u'name': u'estonian'}, {u'iso': u'tr', u'name': u'turkish'}, {u'iso': u'eo', u'name': u'esperanto'}, {u'iso': u'ht', u'name': u'haitian'}, {u'iso': u'eu', u'name': u'basque'}, {u'iso': u'cy', u'name': u'welsh'}, {u'iso': u'mt', u'name': u'maltese'}, {u'iso': u'sk', u'name': u'slovak'}, {u'iso': u'bs', u'name': u'bosnian'}, {u'iso': u'el', u'name': u'greek'}, {u'iso': u'tl', u'name': u'tagalog'}, {u'iso': u'hr', u'name': u'croatian'}, {u'iso': u'fi', u'name': u'finnish'}, {u'iso': u'xx', u'name': u'unknown'}, {u'iso': u'sw', u'name': u'swahili'}, {u'iso': u'lt', u'name': u'lithuanian'}, {u'iso': u'lv', u'name': u'latvian'}, {u'iso': u'zh', u'name': u'chinese'}, {u'iso': u'ga', u'name': u'irish'}, {u'iso': u'is', u'name': u'icelandic'}, {u'iso': u'th', u'name': u'thai'}, {u'iso': u'sq', u'name': u'albanian'}, {u'iso': u'ja', u'name': u'japanese'}, {u'iso': u'ms', u'name': u'malay'}, {u'iso': u'la', u'name': u'latin'}, {u'iso': u'ko', u'name': u'korean'}, {u'iso': u'mk', u'name': u'macedonian'}, {u'iso': u'ar', u'name': u'arabic'}, {u'iso': u'vi', u'name': u'vietnamese'}, {u'iso': u'mn', u'name': u'mongolian'}, {u'iso': u'uk', u'name': u'ukrainian'}, {u'iso': u'iw', u'name': u'hebrew'}, {u'iso': u'wa', u'name': u'walloon'}, {u'iso': u'sr', u'name': u'serbian'}, {u'iso': u'be', u'name': u'belarusian'}, {u'iso': u'ta', u'name': u'tamil'}, {u'iso': u'fa', u'name': u'persian'}, {u'iso': u'bn', u'name': u'bengali'}, {u'iso': u'ka', u'name': u'georgian'}, {u'iso': u'te', u'name': u'telugu'}, {u'iso': u'hy', u'name': u'armenian'}, {u'iso': u'ps', u'name': u'pashto'}, {u'iso': u'kn', u'name': u'kannada'}, {u'iso': u'aa', u'name': u'afar'}, {u'iso': u'ab', u'name': u'abkhaz'}, {u'iso': u'am', u'name': u'amharic'}, {u'iso': u'dz', u'name': u'dzongkha'}, {u'iso': u'gn', u'name': u'guarani'}, {u'iso': u'gu', u'name': u'gujarati'}, {u'iso': u'ha', u'name': u'hausa'}, {u'iso': u'hb', u'name': u'hb'}, {u'iso': u'az', u'name': u'azerbaijani'}, {u'iso': u'bg', u'name': u'bulgarian'}, {u'iso': u'hi', u'name': u'hindi'}, {u'iso': u'kk', u'name': u'kazakh'}, {u'iso': u'kl', u'name': u'kalaallisut'}, {u'iso': u'ku', u'name': u'kurdish'}, {u'iso': u'ky', u'name': u'kyrgyz'}, {u'iso': u'ml', u'name': u'malayalam'}, {u'iso': u'mr', u'name': u'marathi'}, {u'iso': u'my', u'name': u'burmese'}, {u'iso': u'ne', u'name': u'nepali'}, {u'iso': u'pa', u'name': u'panjabi'}, {u'iso': u'sh', u'name': u'serbo-croatian'}, {u'iso': u'si', u'name': u'sinhala'}, {u'iso': u'so', u'name': u'somali'}, {u'iso': u'su', u'name': u'sundanese'}, {u'iso': u'tk', u'name': u'turkmen'}, {u'iso': u'tt', u'name': u'tatar'}, {u'iso': u'ur', u'name': u'urdu'}, {u'iso': u'uz', u'name': u'uzbek'}, {u'iso': u'yi', u'name': u'yiddish'}, {u'iso': u'zu', u'name': u'zulu'} ], u'state': u'success', u'total': 93}
-
progess_get
(id)[source]¶ Show the progress of uploading and converting of document.
Parameters: id (str) – id of progress object Returns: the details of uploading and coverting process Return type: json
-
search
(q, in_=['author', 'title', 'description', 'tags'], op='or', offset=0, limit=10, return_fields=['id', 'url', 'short_url', 'image_small', 'image_medium', 'image_big', 'language', 'title', 'description', 'tags', 'embed_code'], sort=None, language=None, pages=None, heat_rank=None, views=None, create_date=None, category=None)[source]¶ Search documents
Parameters: - q (str) – A keyword to search for
- in (list) – Search keyword in fields author, title, description or tags
- op (str) – Search keyword with „and“ or „or“ operator
- offset (int) – Retrieve rows at position X (min. 0)
- limit (int) – Retrieve X rows (min. 0 and max. 100)
- return_fields (list) – Customize the responses by setting the return fields (id, url, short_url, image_small, image_medium, image_big, language, title, description, tags, embed_code)
- sort (str) – Sort results (views_desc, views_asc, create_date_desc, create_date_asc, heat_rank_desc, heat_rank_asc, pages_desc, pages_asc)
- language (str) – Filter result (de, en, …)
- pages (str) – Filter result from 10 to 20 pages (10-20) or exact 30 pages (30)
- heat_rank (str) – Filter result from 50 to 100 heat_rank (50-100) or exact 80 heat_rank (80)
- views (str) – Filter result with 500 to 1000 views (500-1000) or exact 800 views (800)
- create_date (str) – Filter result which got created from 2013-09-01 between 2013-09-30 (2013-09-01-2013-09-30) or on an exact date 2013-09-01 (2013-09-01)
- category (int) – Filter result (1, 2, …)
Return type:
-
section_delete
(id)[source]¶ Delete one of your sections
Parameters: id (str) – The id of one of your sections Returns: the status of operation Return type: json >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.section_delete('omkYGduXowlyx9WF') {"state":"success"}
-
section_document_delete
(id, documents)[source]¶ Remove documents from section.
Parameters: Returns: the content of section object
-
section_document_post
(id, documents)[source]¶ Create a new document in section.
Parameters: Returns: the content of section object
-
section_post
(id, name, description=None, sorting='manually')[source]¶ Create a new section for given category.
Parameters: Returns: the datas of new created section
Return type: >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.section_post('iMWWKoMS76pjqMoO', 'Sports', 'Sports') { "section": [ { "id": "F54wo1ijuIzhbSfK", "create_date": "2013-09-23 10:46:53", "update_date": "0000-00-00 00:00:00", "name": "Sports", "description": "Sports", "sorting": "manually", "order": 2, "documents": "" } ], "state": "success" }
-
section_put
(id, name, description=None, sorting='manually')[source]¶ Create a new section for given category.
Parameters: Returns: the datas of new created section
Return type: >>> from yumpu_sdk.api import Yumpu >>> yumpu = Yumpu('YOUR_TOKEN_HERE') >>> yumpu.section_put('F54wo1ijuIzhbSfK', 'Sports 2013') { "section": [ { "id": "F54wo1ijuIzhbSfK", "create_date": "2013-09-23 10:46:53", "update_date": "2013-09-23 11:11:35", "name": "Sports 2013", "description": "Sports", "sorting": "create_date_desc", "order": 2, "documents": "" } ], "state": "success" }
-
user_get
(return_fields=[])[source]¶ Retrieve your user profile data.
Parameters: return_fields (list) – Customize the responses by setting the return fields (id, create_date, activate_date, last_login_date, username, email, gender, name, firstname, lastname, birth_date, address, zip_code, city, country, description, website, blog, language) Return type: json
-
user_post
(**kwargs)[source]¶ Create a new user profile.
Parameters: - email (str) – Your email address (valid email address)
- username (str) – Your username (Allowed characters a-z, A-Z, 0-9 and a dot, min. length 5 characters, max. length 30 characters)
- password (str) – Your password (min. length 6 characters)
- gender (str) – Your gender (male or female)
- firstname (str) – Your firstname (min. length 2 characters, max. length 100 characters)
- lastname (str) – Your lastname (min. length 2 characters, max. length 100 characters)
- birth_date (str) – Your birth_date (YYYY-MM-DD)
- address (str) – Your address (max. length 255 characters)
- zip_code (str) – Your zip code (max. length 10 characters)
- city (str) – Your city (max. length 50 characters)
- country (str) – Your country (DE, GB, FR, …)
- description (str) – Your address (max. length 255 characters)
- website (str) – Your website (max. length 255 characters, valid URL)
- blog (str) – Your blog (max. length 255 characters, valid URL)
- language (str) – Your language (de, en, fr, …)
Return type:
-
user_put
(**kwargs)[source]¶ Update your profile.
Parameters: - gender (str) – Your gender (male or female)
- firstname (str) – Your firstname (min. length 2 characters, max. length 100 characters)
- lastname (str) – Your lastname (min. length 2 characters, max. length 100 characters)
- birth_date (str) – Your birth_date (YYYY-MM-DD)
- address (str) – Your address (max. length 255 characters)
- zip_code (str) – Your zip code (max. length 10 characters)
- city (str) – Your city (max. length 50 characters)
- country (str) – Your country (DE, GB, FR, …)
- description (str) – Your address (max. length 255 characters)
- website (str) – Your website (max. length 255 characters, valid URL)
- blog (str) – Your blog (max. length 255 characters, valid URL)
- language (str) – Your language (de, en, fr, …)
Return type:
-