Skip to content

Commit 6c33ca4

Browse files
committed
release 0.1.3
1 parent b9404a4 commit 6c33ca4

5 files changed

Lines changed: 57 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# socket-python
2+
3+
Python package for the Socket API (https://viasocket.com/).
4+
5+
6+
## Installation
7+
8+
pip install sokt
9+
10+
11+
## Basic Usage
12+
13+
```python
14+
import sokt
15+
16+
socket = sokt.sokt('my_api_key')
17+
payload = {'first_key' : 'first_value' , 'second_key' : 'second_value'}
18+
response = socket.invoke('flow_identifier',payload)
19+
```

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from setuptools import setup
2+
3+
setup(name='sokt',
4+
version='0.1.3',
5+
description='For invoking Socket flows',
6+
url='https://github.com/viasocket/socket-python',
7+
author='Viasocket',
8+
author_email='[email protected]',
9+
license='MIT',
10+
packages=['sokt'],
11+
zip_safe=False)

sokt/.DS_Store

6 KB
Binary file not shown.

sokt/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from sokt import sokt

sokt/sokt.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import json
2+
import requests
3+
4+
class sokt:
5+
6+
def __init__(self,auth) :
7+
8+
self.baseUrl = "https://sokt.io"
9+
self.authkey = auth
10+
self.headers = {
11+
'authkey': auth,
12+
'content-type': "application/json"
13+
}
14+
15+
def flowURLBuilder(self,flow_id) :
16+
return self.baseUrl + '/' +str(flow_id)
17+
18+
19+
def invoke(self,flow_id,args) :
20+
url = self.flowURLBuilder(flow_id)
21+
payload = json.dumps(args)
22+
23+
response = requests.post(url,data=payload,headers=self.headers, verify=False)
24+
return response.status_code
25+
26+

0 commit comments

Comments
 (0)