Skip to content

Commit

Permalink
fix version and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jhowbhz committed May 31, 2023
1 parent 12723c0 commit e79d58e
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -48,13 +48,13 @@ def main():
sendText = Service.whatsapp(json.dumps({
"action": "sendText",
"credentials": {
"SecretKey": "SEU_SECRET_KEY"
"SecretKey": "SEU_SECRET_KEY",
"PublicToken": "SEU_PUBLIC_TOKEN",
"DeviceToken": "SEU_DEVICE_TOKEN",
"BearerToken": "SEU_BEARER_TOKEN",
},
"body": {
"message": "Hello World por Python",
"message": "Hello World for Python",
"phone": "5531994359434",
"time_typing": 1
}
Expand All @@ -64,4 +64,4 @@ def main():

if __name__ == "__main__":
main()
```
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():
"BearerToken": "SEU_BEARER_TOKEN",
},
"body": {
"message": "Hello World por Python",
"message": "Hello World for Python",
"phone": "5531994359434",
"time_typing": 1
}
Expand Down
File renamed without changes.
File renamed without changes.
79 changes: 79 additions & 0 deletions apigratis_sdk_python.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Metadata-Version: 2.1
Name: apigratis-sdk-python
Version: 1.0.1
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
Author-email: contato@apibrasil.com.br
License: MIT License
Description: # SDK Python - APIGratis by API BRASIL

Conjunto de API, para desenvolvedores.

_Transforme seus projetos em solucoes inteligentes com nossa API. Com recursos como API do WhatsApp, geolocalizacao, rastreamento de encomendas, verificacao de CPF/CNPJ e mais, voce pode criar solucoes eficientes e funcionais._

## Como instalar

```pip install apigratis```
## 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)

## Obtenha suas credenciais
https://apigratis.com.br

## Mais informacoes

https://pypi.org/project/apigratis

## Servicos de API disponiveis

| Up | Services available | Description | Free | Beta | Stable |
------|-------------------------------|-------------------|---------| ------------------------- | ------------------------- |
| O | WhatsAppService | API do WhatsApp Gratuita. | O | O | x |
| x | Receita Data CNPJ | API Dados CNPJ Receita. | x | x | x |
| x | Receita Data CPF | API Dados de CPF Serasa. | x | x | x |
| x | CorreiosService | API Busca encomendas Correios Brazil. | x | x | x |
| x | CEPLocation | API CEP Geolocation + IBGE Brazil. | x | x | x |
| x | VehiclesService | API Placa Dados. | x | x | x |
| x | FipeService | API Placa FIPE. | x | x | x |

## Como utilizar

_Voce pode utilizar todos os endpoints da API do WhatsApp, basta mudar o action e o body_

## Documentacoes
https://apibrasil.com.br/documentacoes


```python

from apigratis.Service import Service
import json

def main():

sendText = Service.whatsapp(json.dumps({
"action": "sendText",
"credentials": {
"SecretKey": "SEU_SECRET_KEY",
"PublicToken": "SEU_PUBLIC_TOKEN",
"DeviceToken": "SEU_DEVICE_TOKEN",
"BearerToken": "SEU_BEARER_TOKEN",
},
"body": {
"message": "Hello World for Python",
"phone": "5531994359434",
"time_typing": 1
}
}))

print(sendText)

if __name__ == "__main__":
main()
```

Keywords: whatsapp api,apibrasil,cnpj,sms,cep,consulta,api,brasil,gratis,free,whatsapp,apiwhatsapp,apigratis,apifree
Platform: UNKNOWN
Description-Content-Type: text/markdown
10 changes: 10 additions & 0 deletions apigratis_sdk_python.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
README
pyproject.toml
setup.py
apigratis-sdk-python/Service.py
apigratis-sdk-python/__init__.py
apigratis_sdk_python.egg-info/PKG-INFO
apigratis_sdk_python.egg-info/SOURCES.txt
apigratis_sdk_python.egg-info/dependency_links.txt
apigratis_sdk_python.egg-info/requires.txt
apigratis_sdk_python.egg-info/top_level.txt
1 change: 1 addition & 0 deletions apigratis_sdk_python.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions apigratis_sdk_python.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests
1 change: 1 addition & 0 deletions apigratis_sdk_python.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apigratis-sdk-python
53 changes: 53 additions & 0 deletions build/lib/apigratis-sdk-python/Service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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)}
Empty file.
Binary file removed dist/apigratis-1.0.0-py3-none-any.whl
Binary file not shown.
Binary file removed dist/apigratis-1.0.0.tar.gz
Binary file not shown.
Binary file added dist/apigratis-sdk-python-1.0.1.tar.gz
Binary file not shown.
Binary file added dist/apigratis_sdk_python-1.0.1-py3-none-any.whl
Binary file not shown.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "apigratis"
description = "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. Comece agora"
version = "1.0.0"
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"
authors = [
{ name="APIBRASIL", email="contato@apibrasil.com.br" },
]
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
with open("README.md", "r") as fh:
readme = fh.read()

setup(name='apigratis',
version='1.0.0',
setup(name='apigratis-sdk-python',
version='1.0.1',
url='https://github.com/APIBrasil/apigratis-sdk-python',
license='MIT License',
author='APIBRASIL',
Expand All @@ -13,5 +13,5 @@
author_email='contato@apibrasil.com.br',
keywords='whatsapp api, apibrasil, cnpj, sms, cep, consulta, api, brasil, gratis, free, whatsapp, apiwhatsapp, apigratis, apifree',
description=u'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',
packages=['apigratis'],
packages=['apigratis-sdk-python'],
install_requires=['requests'])

0 comments on commit e79d58e

Please sign in to comment.