Package: emagisterapi
Emagister API clientemagisterapi is a python client to retrieve information from Emagister API.Table of ContentsInstallationsProject MotivationModulesInstructionsMore InfoLicenseInstallationsDependenciesemagisterapi requires:Python (>=3.6)NumPyrequestsInstallationYou can install emagisterapi usingpippip install emagisterapiThat easy.Project Motivationemagisterapi has been created in order to facilitate access to the Emagister API dataModulesIn this version, emagisterapi has only one module:connectTheconnectmodule includes classes to connect and retrieve resources from Emagister API.TheCoursesclass:These are the constructor parameters of theCoursesclass:parametertypedescriptionvaluescountrystrCountry of the site where the data comes fromes, uk, fr, mxversionstrAPI version. Default: 1.01.0 or 2.0page_sizeintNumber of results per page. Default: 25>= 1silentboolIf it isTrue, you will see the log printed on screen. Default:FalseTrueorFalseTheCoursesclass has one method calledgetand these are his parameters:parametertypedescriptionvaluessubsetdict or listSubset of fields to retrieve. IfNone, all fields will be retrieved. Default:NonefiltersdictDictionary or list of filters to apply. Default:NoneSeedocumentationmax_recordsintMaximum number of records to retrieve. IfNone, all records will be retrieved. Default:None>= 1InstructionsTo retrieve course from Emagister API, run this code:fromemagapi.connectimportCoursescourses_api=Courses(country='uk',page_size=100,silent=False)subset={'course_id':'id','title':'name','description':'description','center':'center_name','type':'type','price':'price','start_date':'start_date','flexible_start':'flexible_start_date'}courses=courses_api.get(subset,max_records=25000)# output (if silent == False)# GET: https://www.emagister.co.uk/api/1.0/courses?page=1&size=100 [200]# Records: 100/25000# GET: https://www.emagister.co.uk/api/1.0/courses?page=2&size=100 [200]# Records: 200/25000# GET: https://www.emagister.co.uk/api/1.0/courses?page=3&size=100 [200]# Records: 300/25000# GET: https://www.emagister.co.uk/api/1.0/courses?page=4&size=100 [200]# Records: 400/25000# ...# GET: https://www.emagister.co.uk/api/1.0/courses?page=249&size=100 [200]# Records: 24900/25000# GET: https://www.emagister.co.uk/api/1.0/courses?page=250&size=100 [200]# Records: 25000/25000The result is a list of dictionaries whose keys are the values ofsubset:print(courses[0])# output# {'course_id': '170648149',#  'title': 'Advanced Sales Management',#  'description': 'Discover new tools for turning the art of management into a reliable science. Strengthen...',#  'center': 'Salessense',#  'type': 'Course',#  'price': '£5,995',#  'start_date': None,#  'flexible_start': True}More infoYou can read the Emagister API documentationhere.LicenseCopyright (c) 2019 Cisco DelgadoPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.