Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish DongTak-SDK-Python

on:
release:
types: [ created, edited ]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install setuptools wheel twine

- id: release
run: |
TAG_NAME=${{ github.event.release.tag_name }}
ID=`echo ${TAG_NAME##v}`
echo "::set-output name=VERSION::$ID"

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
sed -i "s/latest/${{ steps.release.outputs.VERSION }}" setup.py
python setup.py sdist bdist_wheel
twine upload dist/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ dmypy.json
.pyre/
# pypi config
.pypirc

# PyCharm
.idea
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,35 @@
* @Description: How to use
-->
# DongTai-SDK-Python
DongTai API SDK

[![license Apache-2.0](https://img.shields.io/github/license/HXSecurity/DongTai-SDK-Python)](https://github.com/HXSecurity/DongTai-SDK-Python/blob/main/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/HXSecurity/DongTai-SDK-Python.svg?label=Stars&logo=github)](https://github.com/HXSecurity/DongTai-SDK-Python)
[![GitHub forks](https://img.shields.io/github/forks/HXSecurity/DongTai-SDK-Python?label=Forks&logo=github)](https://github.com/HXSecurity/DongTai-SDK-Python)
[![GitHub Contributors](https://img.shields.io/github/contributors/HXSecurity/DongTai-SDK-Python?label=Contributors&logo=github)](https://github.com/HXSecurity/DongTai-SDK-Python)


[![CI](https://github.com/HXSecurity/DongTai-SDK-Python/actions/workflows/release.yml/badge.svg)](https://github.com/HXSecurity/DongTai-SDK-Python/actions/workflows/release.yml)
[![Github Version](https://img.shields.io/github/v/release/HXSecurity/DongTai-SDK-Python?display_name=tag&include_prereleases&sort=semver)](https://github.com/HXSecurity/DongTai-SDK-Python/releases)
[![Release downloads](https://shields.io/github/downloads/HXSecurity/DongTai-SDK-Python/total)](https://github.com/HXSecurity/DongTai-SDK-Python/releases)


# Quick start

1.your need a config file

config.json
```json
{
"DongTai":{
"token":"your token",
"url":"http://127.0.0.1:90"
}
}
```

2.how to use:

```python
from dongtai_sdk.DongTai import DongTai
dongTaiSdk = DongTai("config.json")
dongTaiSdk = DongTai("config.json")
```

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="dongtai_sdk",
version="0.0.2",
version="latest",
author="spensercai",
author_email="spensercai@gmail.com",
description="DongTai SDK",
Expand Down