Package: libsonyapi
libsonyapiPython binding for theSony Camera APIREQUIREMENTSa compatible Sony camera (find your camerahere)wifi connectionINSTALLATIONpip install libsonyapiOR FROM SOURCE:git clone https://github.com/petabite/libsonyapi.gitor download thelatest releasecd libsonyapipython setup.py installRequired:requestsQUICKSTARTfromlibsonyapi.cameraimportCamerafromlibsonyapi.actionsimportActionscamera=Camera()# create camera instancecamera_info=camera.info()# get camera camera_infoprint(camera_info)print(camera.name)# print name of cameraprint(camera.api_version)# print api version of cameracamera.do(Actions.actTakePicture)# take a picturefNumber=camera.do(Actions.getFNumber)print(fNumber)# prints fnumbercamera.do(Actions.setFNumber,"5")# set aperture to 5HOW IT WORKSestablishes connection with camera thru upnp ssdp protocolmake calls to camera via http post and json bodycamera responds with json w/ info such as status and info if required by http callDOCSObjectslibsonyapi.Camera()init a Camera objectlibsonyapi.Actions()do not need to create instancecontains string literals of sony camera api methods for convenience (auto-complete)ParametersCamera.namename of the cameraCamera.api_versionapi version of cameraCamera.serviceslist of services available on cameraCamera.available_apislist of apis currently available on cameraMethodsCamera.info(self)returns camera info(name, api_version, supported services, available api) in dictCamera.do(self, method, param=[]):METHOD:libsony.Actions.method, where method is one listed in the API LIST belowPARAM(optional):accepts string of param if METHOD is a method that sets a value on the cameraReturns the json response from the camera (for debugging)NOTE: your camera may not support all methods. useCamera.do("getAvailableApiList")['result']to get currently available APIs.Refer toSony Camera APIdocs for function of method and supported paramsEXAMPLESpylapse- uses libsonyapi to automatically capture pictures for a timelapseAPI LISTThe table below shows the name of variables in the libsonyapi Actions class and its corresponding Sony Camera API method namelibsonyapi Variable NameSony API Method NamesetShootMode'setShootMode'getShootMode'getShootMode'getSupportedShootMode'getSupportedShootMode'getAvailableShootMode'getAvailableShootMode'actTakePicture'actTakePicture'awaitTakePicture'awaitTakePicture'startContShooting'startContShooting'stopContShooting'stopContShooting'startMovieRec'startMovieRec'stopMovieRec'stopMovieRec'startAudioRec'startAudioRec'stopAudioRec'stopAudioRec'startIntervalStillRec'startIntervalStillRec'stopIntervalStillRec'stopIntervalStillRec'startLoopRec'startLoopRec'stopLoopRec'stopLoopRec'startLiveview'startLiveview'stopLiveview'stopLiveview'startLiveviewWithSize'startLiveviewWithSize'getLiveviewSize'getLiveviewSize'getSupportedLiveviewSize'getSupportedLiveviewSize'getAvailableLiveviewSize'getAvailableLiveviewSize'setLiveviewFrameInfo'setLiveviewFrameInfo'getLiveviewFrameInfo'getLiveviewFrameInfo'actZoom'actZoom'setZoomSetting'setZoomSetting'getZoomSetting'getZoomSetting'getSupportedZoomSetting'getSupportedZoomSetting'getAvailableZoomSetting'getAvailableZoomSetting'actHalfPressShutter'actHalfPressShutter'cancelHalfPressShutter'cancelHalfPressShutter'setTouchAFPosition'setTouchAFPosition'getTouchAFPosition'getTouchAFPosition'cancelTouchAFPosition'cancelTouchAFPosition'actTrackingFocus'actTrackingFocus'cancelTrackingFocus'cancelTrackingFocus'setTrackingFocus'setTrackingFocus'getTrackingFocus'getTrackingFocus'getSupportedTrackingFocus'getSupportedTrackingFocus'getAvailableTrackingFocus'getAvailableTrackingFocus'setContShootingMode'setContShootingMode'getContShootingMode'getContShootingMode'getSupportedContShootingMode'getSupportedContShootingMode'getAvailableContShootingMode'getAvailableContShootingMode'setContShootingSpeed'setContShootingSpeed'getContShootingSpeed'getContShootingSpeed'getSupportedContShootingSpeed'getSupportedContShootingSpeed'getAvailableContShootingSpeed'getAvailableContShootingSpeed'setSelfTimer'setSelfTimer'getSelfTimer'getSelfTimer'getSupportedSelfTimer'getSupportedSelfTimer'getAvailableSelfTimer'getAvailableSelfTimer'setExposureMode'setExposureMode'getExposureMode'getExposureMode'getSupportedExposureMode'getSupportedExposureMode'getAvailableExposureMode'getAvailableExposureMode'setFocusMode'setFocusMode'getFocusMode'getFocusMode'getSupportedFocusMode'getSupportedFocusMode'getAvailableFocusMode'getAvailableFocusMode'setExposureCompensation'setExposureCompensation'getExposureCompensation'getExposureCompensation'getSupportedExposureCompensation'getSupportedExposureCompensation'getAvailableExposureCompensation'getAvailableExposureCompensation'setFNumber'setFNumber'getFNumber'getFNumber'getSupportedFNumber'getSupportedFNumber'getAvailableFNumber'getAvailableFNumber'setShutterSpeed'setShutterSpeed'getShutterSpeed'getShutterSpeed'getSupportedShutterSpeed'getSupportedShutterSpeed'getAvailableShutterSpeed'getAvailableShutterSpeed'setIsoSpeedRate'setIsoSpeedRate'getIsoSpeedRate'getIsoSpeedRate'getSupportedIsoSpeedRate'getSupportedIsoSpeedRate'getAvailableIsoSpeedRate'getAvailableIsoSpeedRate'setWhiteBalance'setWhiteBalance'getWhiteBalance'getWhiteBalance'getSupportedWhiteBalance'getSupportedWhiteBalance'getAvailableWhiteBalance'getAvailableWhiteBalance'actWhiteBalanceOnePushCustom'actWhiteBalanceOnePushCustom'setProgramShift'setProgramShift'getSupportedProgramShift'getSupportedProgramShift'setFlashMode'setFlashMode'getFlashMode'getFlashMode'getSupportedFlashMode'getSupportedFlashMode'getAvailableFlashMode'getAvailableFlashMode'setStillSize'setStillSize'getStillSize'getStillSize'getSupportedStillSize'getSupportedStillSize'getAvailableStillSize'getAvailableStillSize'setStillQuality'setStillQuality'getStillQuality'getStillQuality'getSupportedStillQuality'getSupportedStillQuality'getAvailableStillQuality'getAvailableStillQuality'setPostviewImageSize'setPostviewImageSize'getPostviewImageSize'getPostviewImageSize'getSupportedPostviewImageSize'getSupportedPostviewImageSize'getAvailablePostviewImageSize'getAvailablePostviewImageSize'setMovieFileFormat'setMovieFileFormat'getMovieFileFormat'getMovieFileFormat'getSupportedMovieFileFormat'getSupportedMovieFileFormat'getAvailableMovieFileFormat'getAvailableMovieFileFormat'setMovieQuality'setMovieQuality'getMovieQuality'getMovieQuality'getSupportedMovieQuality'getSupportedMovieQuality'getAvailableMovieQuality'getAvailableMovieQuality'setSteadyMode'setSteadyMode'getSteadyMode'getSteadyMode'getSupportedSteadyMode'getSupportedSteadyMode'getAvailableSteadyMode'getAvailableSteadyMode'setViewAngle'setViewAngle'getViewAngle'getViewAngle'getSupportedViewAngle'getSupportedViewAngle'getAvailableViewAngle'getAvailableViewAngle'setSceneSelection'setSceneSelection'getSceneSelection'getSceneSelection'getSupportedSceneSelection'getSupportedSceneSelection'getAvailableSceneSelection'getAvailableSceneSelection'setColorSetting'setColorSetting'getColorSetting'getColorSetting'getSupportedColorSetting'getSupportedColorSetting'getAvailableColorSetting'getAvailableColorSetting'setIntervalTime'setIntervalTime'getIntervalTime'getIntervalTime'getSupportedIntervalTime'getSupportedIntervalTime'getAvailableIntervalTime'getAvailableIntervalTime'setLoopRecTime'setLoopRecTime'getLoopRecTime'getLoopRecTime'getSupportedLoopRecTime'getSupportedLoopRecTime'getAvailableLoopRecTime'getAvailableLoopRecTime'setWindNoiseReduction'setWindNoiseReduction'getWindNoiseReduction'getWindNoiseReduction'getSupportedWindNoiseReduction'getSupportedWindNoiseReduction'getAvailableWindNoiseReduction'getAvailableWindNoiseReduction'setAudioRecording'setAudioRecording'getAudioRecording'getAudioRecording'getSupportedAudioRecording'getSupportedAudioRecording'getAvailableAudioRecording'getAvailableAudioRecording'setFlipSetting'setFlipSetting'getFlipSetting'getFlipSetting'getSupportedFlipSetting'getSupportedFlipSetting'getAvailableFlipSetting'getAvailableFlipSetting'setTvColorSystem'setTvColorSystem'getTvColorSystem'getTvColorSystem'getSupportedTvColorSystem'getSupportedTvColorSystem'getAvailableTvColorSystem'getAvailableTvColorSystem'startRecMode'startRecMode'stopRecMo'stopRecMo'