Skip to main content

SolldexAPI Python Client

This repository contains a Python client for interacting with the Solldex API. The client supports making requests to the following endpoints:

  • Recepcionar Lote RPS
  • Consultar Lote
  • Consultar RPS
  • Consultar NFSe
  • Cancelar NFSe
  • URL Visualização

Features

  • Simple and intuitive interface for making requests to the Solldex API.
  • Built-in retry logic using the Tenacity library, with up to 3 retry attempts and a 2 second wait between each attempt.
  • Error logging for better debugging and maintenance.

Installation

You can install the SolldexAPI Python Client via pip:

pip install solldex-api-client

Usage

To use the SolldexAPI client, you'll need to import the SolldexAPI class and initialize it with your API token.

from solldex_api import SolldexAPI
from solldex_api.solldex_models import RecepcionarLoteParams, ConsultaLoteParams, ConsultaRpsParams

api = SolldexAPI('your-token-here')

Once you've done that, you can make requests to the Solldex API using the recepcionar_lote, consultar_lote, and consultar_rps and more methods:

from solldex_api.solldex_models import Prestador, Tomador, Servico, Endereco

# Define data for Recepcionar Lote RPS endpoint
prestador_data = Prestador(cnpj='string', inscricao_municipal='number', codigo_municipio='number')
endereco_data = Endereco(logradouro='string', numero='number', bairro='string', uf='string', cep='number')
tomador_data = Tomador(cpf_cnpj='number', endereco=endereco_data)
servico_data = Servico(aliquota='number', discriminacao='string', iss_retido=True, item_lista_servico='number', codigo_tributario_municipio='number', valor_servicos='number')

request_data = RecepcionarLoteParams(data_emissao='date', prestador=prestador_data, tomador=tomador_data, servico=servico_data)
# Make a request to the Recepcionar Lote RPS endpoint
response = api.recepcionar_lote(request_data)

# Define data for Consultar Lote endpoint
request_data = ConsultaLoteParams(protocolo='number', cnpj='number', inscricao_municipal='number', codigo_municipio='number')
# Make a request to the Consultar Lote endpoint
response = api.consultar_lote(request_data)

# Define data for Consultar RPS endpoint
request_data = ConsultaRpsParams(numero='number', serie='number', tipo='number', cnpj='number', inscricao_municipal='number', codigo_municipio='number')
# Make a request to the Consultar RPS endpoint
response = api.consultar_rps(request_data)

Continue in a similar fashion for the rest of the available methods, such as consultar_nfse, cancela_nfse, and consulta_url_nfse, providing the correct data structure to the method.

from solldex_api.solldex_models import ConsultaNfseParams, Prestador, Tomador, Endereco

# Define data for Consultar NFS-e endpoint
prestador_data = Prestador(cnpj='string', inscricao_municipal='number', codigo_municipio='number')
endereco_data = Endereco(logradouro='string', numero='number', bairro='string', uf='string', cep='number')
tomador_data = Tomador(cpf_cnpj='number', endereco=endereco_data)

request_data = ConsultaNfseParams(numero='number', codigo_municipio='number', data_inicial='date', data_final='date', prestador=prestador_data, tomador=tomador_data)
# Make a request to the Consultar NFS-e endpoint
response = api.consultar_nfse(request_data)

Remember to replace 'number', 'string', and 'date' with actual values before executing the requests.

Errors during the request will be logged, and the methods will automatically retry the request up to

Error Handling

The SolldexAPI client uses the Tenacity library to provide built-in retry logic for requests. If a request fails, the client will automatically retry it up to 3 times, with a 2 second wait between each attempt.

If a request continues to fail after 3 attempts, the client will log the error and raise a requests.RequestException exception.

Release files for solldex-api-client 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solldex-api-client 0.1.18
File Size Uploaded
solldex-api-client-0.1.18.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solldex-api-client 0.1.18
File Interpreter ABI Platform
solldex_api_client-0.1.18-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / solldex-api-client-0.1.18.tar.gz

Download URL solldex-api-client-0.1.18.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a32473c7dd2877564a06d30da77985c146ae74714d4bf2a02f923687e16292ce
BLAKE2b-256 checksum
How to use checksums
7d807b87dc013a0b31fafcd8be15da529abb1eb1c3435252a2afc038d0dc775e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / solldex_api_client-0.1.18-py3-none-any.whl

Download URL solldex_api_client-0.1.18-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50c427bcac07407161f17b892a1aa6aa82687027f9f6bae2bbd78775b8f7e5e7
BLAKE2b-256 checksum
How to use checksums
91a7de02f5c5c663ff15cbbb77be2124f5e91826c8092543393b0b9107c9ae47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.18 This release

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page