Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featuring pip installation #20

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build
/*.egg-info
__pycache__

*.pyc
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Python implementation of the SDK of SIYI camera-gimbal systems.
# Usage
* Check the scripts in the `siyi_sdk/tests` directory to learn how to use the SDK

* To import this module in your code, copy the `siyi_sdk.py` `siyi_message.py` `utility.py` `crc16_python.py` scripts in your code directory, and import as follows, and then follow the test examples
* To import this module in your code, install the sdk with:
```bash
pip install git+https://github.com/mzahana/siyi_sdk.git
```
* And import as follows, and then follow the test examples
```python
from siyi_sdk import SIYISDK
```
Expand Down
2 changes: 1 addition & 1 deletion gui/tkgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

# create the window window
window = tk.Tk()
Expand Down
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from setuptools import find_packages, setup

setup(
name="siyi_sdk",
version="0.1.0",
description="Python package implementation for Siyi SDK.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Mohamed Abdelkader",
author_email="[email protected]",
packages=find_packages(exclude=["*/test",".github"]),
install_requires=["opencv-python>=4.0.0", "imutils", "ffmpeg-python"],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
)
File renamed without changes.
Binary file added siyi_sdk/__pycache__/siyi_sdk.cpython-310.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions siyi_message.py → siyi_sdk/siyi_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

"""
from os import stat
from crc16_python import crc16_str_swap
from siyi_sdk.crc16_python import crc16_str_swap
import logging
from utils import toHex
from siyi_sdk.utils import toHex

class FirmwareMsg:
seq=0
Expand Down
6 changes: 3 additions & 3 deletions siyi_sdk.bak.py → siyi_sdk/siyi_sdk.bak.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

"""
import socket
from siyi_message import *
from siyi_sdk.siyi_message import *
from time import sleep, time
import logging
from utils import toInt
from siyi_sdk.utils import toInt
import threading
import cameras
import siyi_sdk.cameras as cameras


class SIYISDK:
Expand Down
6 changes: 3 additions & 3 deletions siyi_sdk.py → siyi_sdk/siyi_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

"""
import socket
from siyi_message import *
from siyi_sdk.siyi_message import *
from time import sleep, time
import logging
from utils import toInt
from siyi_sdk.utils import toInt
import threading
import cameras
import siyi_sdk.cameras as cameras


class SIYISDK:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_absolute_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_center_gimbal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_follow_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fpv_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_from_rtsp_to_rtmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

sys.path.append(parent_directory)

from stream import SIYIRTSP, RTMPSender
from siyi_sdk.stream import SIYIRTSP, RTMPSender

def test():
rtsp = SIYIRTSP(rtsp_url="rtsp://192.168.144.25:8554/main.264",debug=False)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_get_fw_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_get_gimbal_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_get_hw_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gimbal_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lock_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_print_attitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_record_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rtmp_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

sys.path.append(parent_directory)

from stream import RTMPSender
from siyi_sdk.stream import RTMPSender

def test():
# Webcam
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rtsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

sys.path.append(parent_directory)

from stream import SIYIRTSP
from siyi_sdk import SIYISDK
from siyi_sdk.stream import SIYIRTSP
from siyi_sdk.siyi_sdk import SIYISDK

def test():

Expand Down
2 changes: 1 addition & 1 deletion tests/test_set_angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

sys.path.append(parent_directory)

from siyi_sdk import SIYISDK
from siyi_sdk.siyi_sdk import SIYISDK

def test():
cam = SIYISDK(server_ip="192.168.144.25", port=37260)
Expand Down