diff --git a/README.md b/README.md index cdb1d04..bd1fa47 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ _Transforme seus projetos em solucoes inteligentes com nossa API. Com recursos c ## Como instalar -```pip install apigratis``` +```pip install apigratis-sdk-python``` ## Canais de suporte (Comunidade) [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/KsxrUGIPWvUBYAjI1ogaGs) [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/apigratisoficial) @@ -16,7 +16,7 @@ https://apigratis.com.br ## Mais informacoes -https://pypi.org/project/apigratis +https://pypi.org/project/apigratis-sdk-python ## Servicos de API disponiveis diff --git a/apigratis_sdk_python.egg-info/PKG-INFO b/apigratis_sdk_python.egg-info/PKG-INFO index 3840016..efb69fc 100644 --- a/apigratis_sdk_python.egg-info/PKG-INFO +++ b/apigratis_sdk_python.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: apigratis-sdk-python -Version: 1.0.1 +Version: 1.0.2 Summary: Transforme seus projetos em soluções inteligentes com nossa API. Com recursos como API do WhatsApp, geolocalização, rastreamento de encomendas, verificação de CPF/CNPJ e mais, você pode criar soluções eficientes e funcionais Home-page: https://github.com/APIBrasil/apigratis-sdk-python Author: APIBRASIL @@ -14,7 +14,7 @@ Description: # SDK Python - APIGratis by API BRASIL ## Como instalar - ```pip install apigratis``` + ```pip install apigratis-sdk-python``` ## Canais de suporte (Comunidade) [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/KsxrUGIPWvUBYAjI1ogaGs) [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/apigratisoficial) @@ -24,7 +24,7 @@ Description: # SDK Python - APIGratis by API BRASIL ## Mais informacoes - https://pypi.org/project/apigratis + https://pypi.org/project/apigratis-sdk-python ## Servicos de API disponiveis diff --git a/build/lib/apigratis/Service.py b/build/lib/apigratis/Service.py deleted file mode 100644 index adb2bff..0000000 --- a/build/lib/apigratis/Service.py +++ /dev/null @@ -1,53 +0,0 @@ -import requests -import json - -class Service: - - def whatsapp(dados): - - try: - server = "https://cluster-01.apigratis.com/api/v1/whatsapp/" - - data = json.loads(dados) - - if not data['action']: - raise Exception('Action não informada, verifique a documentação') - - action = data['action'] - - url = server+str(action) - - if not data['body']: - raise Exception('Body não informado, verifique a documentação') - - payload = json.dumps(data['body']) - - credentials = data['credentials'] - - if not credentials['SecretKey']: - raise Exception('SecretKey não informado') - if not credentials['PublicToken']: - raise Exception('PublicToken não informado') - if not credentials['BearerToken']: - raise Exception('BearerToken não informado') - if not credentials['DeviceToken']: - raise Exception('DeviceToken não informado') - - headers = { - 'Content-Type': 'application/json', - 'SecretKey': credentials['SecretKey'], - 'PublicToken': credentials['PublicToken'], - 'Authorization': 'Bearer ' + credentials['BearerToken'], - 'DeviceToken': credentials['DeviceToken'] - } - - agent = 'APIBRASIL\Whatsapp/1.0.0' - - headers['User-Agent'] = agent - - response = requests.request("POST", url, headers=headers, data=payload, allow_redirects=False, stream=True, proxies=None) - - return json.loads(response.text.encode('utf8')) - - except Exception as e: - return {'error': str(e)} \ No newline at end of file diff --git a/build/lib/apigratis/__init__.py b/build/lib/apigratis/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dist/apigratis-sdk-python-1.0.1.tar.gz b/dist/apigratis-sdk-python-1.0.1.tar.gz deleted file mode 100644 index 9267ff5..0000000 Binary files a/dist/apigratis-sdk-python-1.0.1.tar.gz and /dev/null differ diff --git a/dist/apigratis-sdk-python-1.0.2.tar.gz b/dist/apigratis-sdk-python-1.0.2.tar.gz new file mode 100644 index 0000000..d092a35 Binary files /dev/null and b/dist/apigratis-sdk-python-1.0.2.tar.gz differ diff --git a/dist/apigratis_sdk_python-1.0.1-py3-none-any.whl b/dist/apigratis_sdk_python-1.0.1-py3-none-any.whl deleted file mode 100644 index af72e27..0000000 Binary files a/dist/apigratis_sdk_python-1.0.1-py3-none-any.whl and /dev/null differ diff --git a/dist/apigratis_sdk_python-1.0.2-py3-none-any.whl b/dist/apigratis_sdk_python-1.0.2-py3-none-any.whl new file mode 100644 index 0000000..1300170 Binary files /dev/null and b/dist/apigratis_sdk_python-1.0.2-py3-none-any.whl differ diff --git a/examples/example.py b/examples/example.py index b6b0056..3126c27 100644 --- a/examples/example.py +++ b/examples/example.py @@ -5,7 +5,7 @@ from apigratis.Service import Service import json -def main(): +def sendText(): json_data = { "action": "sendText", @@ -22,9 +22,9 @@ def main(): } } - teste = Service.whatsapp(json.dumps(json_data)) + sendText = Service.whatsapp(json.dumps(json_data)) - print(teste) + print(sendText) if __name__ == "__main__": - main() + sendText() diff --git a/pyproject.toml b/pyproject.toml index fe0bbbc..3bd707f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "apigratis-sdk-python" description = "A ideia desse SDK é otimizar o tempo de código dos usuários auxiliando na integração com a plataforma" -version = "1.0.1" +version = "1.0.2" authors = [ { name="APIBRASIL", email="contato@apibrasil.com.br" }, ] diff --git a/setup.py b/setup.py index f16a0da..0ba5461 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ readme = fh.read() setup(name='apigratis-sdk-python', - version='1.0.1', + version='1.0.2', url='https://github.com/APIBrasil/apigratis-sdk-python', license='MIT License', author='APIBRASIL',