Skip to content

Commit

Permalink
release v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
petabite committed Aug 22, 2020
1 parent c2e662e commit 0071040
Show file tree
Hide file tree
Showing 9 changed files with 344 additions and 305 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 尸廾工L工尸 乙
Copyright (c) 2020 Philip Zhang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
# libsonyapi
python binding for the [Sony Camera API](https://developer.sony.com/develop/cameras/)

Python binding for the [Sony Camera API](https://developer.sony.com/develop/cameras/)

---

# REQUIREMENTS

- a compatible Sony camera (find your camera [here](https://developer.sony.com/develop/cameras/api-information/supported-devices))
- wifi connection

# INSTALLATION

1. `git clone https://github.com/BugsForDays/libsonyapi.git`
## `pip install libsonyapi`

**OR FROM SOURCE:**

1. `git clone https://github.com/petabite/libsonyapi.git` or download the [latest release](https://github.com/petabite/libsonyapi/releases)
2. `cd libsonyapi`
3. `python setup.py install`

Requires:

- [requests](https://requests.readthedocs.io/en/master/user/install/#install)

# QUICKSTART
``` python
import libsonyapi
from libsonyapi import Actions
import requests

camera = libsonyapi.Camera() # create camera instance
camera_info = camera.info() # get camera camera_info
```python
from libsonyapi.camera import Camera
from libsonyapi.actions import Actions

camera = Camera() # create camera instance
camera_info = camera.info() # get camera camera_info
print(camera_info)

print(camera.name) # print name of camera
print(camera.api_version) # print api version of camera
print(camera.name) # print name of camera
print(camera.api_version) # print api version of camera

camera.do(Actions.actTakePicture) # take a picture
camera.do(Actions.actTakePicture) # take a picture

fNumber = camera.do(Actions.getFNumber)
print(fNumber) # prints response from camera, which includes f-number

camera.do(Actions.setFNumber, '5') # set fnumber to 5
print(fNumber) # prints fnumber

camera.do(Actions.setFNumber, "5") # set aperture to 5
```

# CHANGELOG

- **v1.0 - 8/22/20**
- first official release

# HOW IT WORKS

1. establishes connection with camera thru upnp ssdp protocol
Expand All @@ -44,6 +58,7 @@ camera.do(Actions.setFNumber, '5') # set fnumber to 5
# DOCS

##### Objects

- libsonyapi.Camera()
- init a Camera object
- libsonyapi.Actions()
Expand Down Expand Up @@ -73,14 +88,15 @@ camera.do(Actions.setFNumber, '5') # set fnumber to 5
- Refer to [Sony Camera API](https://developer.sony.com/develop/cameras/) docs for function of method and supported params

# EXAMPLES
- [**pylapse**](https://github.com/BugsForDays/pylapse) - uses libsonyapi to automatically capture pictures for a timelapse

- [**pylapse**](https://github.com/petabite/pylapse) - uses libsonyapi to automatically capture pictures for a timelapse

# API LIST

###### The table below shows the name of variables in the libsonyapi Actions class and its corresponding Sony Camera API method name

| libsonyapi Variable Name | Sony API Method Name |
|----------------------------------|------------------------------------|
| -------------------------------- | ---------------------------------- |
| setShootMode | 'setShootMode' |
| getShootMode | 'getShootMode' |
| getSupportedShootMode | 'getSupportedShootMode' |
Expand Down
16 changes: 16 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from libsonyapi.camera import Camera
from libsonyapi.actions import Actions

camera = Camera() # create camera instance
camera_info = camera.info() # get camera camera_info
print(camera_info)

print(camera.name) # print name of camera
print(camera.api_version) # print api version of camera

camera.do(Actions.actTakePicture) # take a picture

fNumber = camera.do(Actions.getFNumber)
print(fNumber) # prints fnumber

camera.do(Actions.setFNumber, "5") # set aperture to 5
262 changes: 0 additions & 262 deletions libsonyapi.py

This file was deleted.

Empty file added libsonyapi/__init__.py
Empty file.
Loading

0 comments on commit 0071040

Please sign in to comment.