fipe-python-sdk 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fipe_python_sdk-1.0.0/LICENSE +5 -0
- fipe_python_sdk-1.0.0/PKG-INFO +21 -0
- fipe_python_sdk-1.0.0/README.md +0 -0
- fipe_python_sdk-1.0.0/pyproject.toml +26 -0
- fipe_python_sdk-1.0.0/setup.cfg +4 -0
- fipe_python_sdk-1.0.0/src/__init__.py +0 -0
- fipe_python_sdk-1.0.0/src/fipe/__init__.py +0 -0
- fipe_python_sdk-1.0.0/src/fipe/api.py +35 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/__init__.py +0 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/anos_modelo.py +22 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/marcas.py +22 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/modelos.py +22 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/tabelas_referencia.py +21 -0
- fipe_python_sdk-1.0.0/src/fipe/apis/valor_parametros.py +22 -0
- fipe_python_sdk-1.0.0/src/fipe_python_sdk.egg-info/PKG-INFO +21 -0
- fipe_python_sdk-1.0.0/src/fipe_python_sdk.egg-info/SOURCES.txt +16 -0
- fipe_python_sdk-1.0.0/src/fipe_python_sdk.egg-info/dependency_links.txt +1 -0
- fipe_python_sdk-1.0.0/src/fipe_python_sdk.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fipe-python-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Client de comunicaçao c/ API da Fipe
|
|
5
|
+
Author-email: Filipe Coelho <filipe@fmconsult.com.br>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Seu Nome
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy...
|
|
11
|
+
|
|
12
|
+
Project-URL: Homepage, https://github.com/seuuser/minha-biblioteca
|
|
13
|
+
Project-URL: Bug Tracker, https://github.com/seuuser/minha-biblioteca/issues
|
|
14
|
+
Keywords: sdk,api,fipe,fmconsult
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fipe-python-sdk"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Client de comunicaçao c/ API da Fipe"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Filipe Coelho", email = "filipe@fmconsult.com.br"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["sdk", "api", "fipe", "fmconsult"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
dependencies = []
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
"Homepage" = "https://github.com/seuuser/minha-biblioteca"
|
|
26
|
+
"Bug Tracker" = "https://github.com/seuuser/minha-biblioteca/issues"
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from fmconsult.http.api import ApiBase
|
|
3
|
+
|
|
4
|
+
class FipeApi(ApiBase):
|
|
5
|
+
|
|
6
|
+
def __init__(self):
|
|
7
|
+
try:
|
|
8
|
+
self.base_url = 'https://veiculos.fipe.org.br/api/veiculos'
|
|
9
|
+
self.headers = {}
|
|
10
|
+
except:
|
|
11
|
+
raise
|
|
12
|
+
|
|
13
|
+
def create_payload(self, codigoTabelaReferencia=None, codigotTipoVeiculo=None, codigoMarca=None, codigoModelo=None, anoModelo=None):
|
|
14
|
+
payload = {}
|
|
15
|
+
|
|
16
|
+
if not(codigoTabelaReferencia is None):
|
|
17
|
+
payload['codigoTabelaReferencia'] = int(codigoTabelaReferencia)
|
|
18
|
+
|
|
19
|
+
if not(codigotTipoVeiculo is None):
|
|
20
|
+
payload['codigoTipoVeiculo'] = int(codigotTipoVeiculo)
|
|
21
|
+
|
|
22
|
+
if not(codigoMarca is None):
|
|
23
|
+
payload['codigoMarca'] = int(codigoMarca)
|
|
24
|
+
|
|
25
|
+
if not(codigoModelo is None):
|
|
26
|
+
payload['codigoModelo'] = int(codigoModelo)
|
|
27
|
+
|
|
28
|
+
if not(anoModelo is None):
|
|
29
|
+
payload['ano'] = str(anoModelo)
|
|
30
|
+
split = anoModelo.split('-')
|
|
31
|
+
payload['anoModelo'] = int(split[0])
|
|
32
|
+
payload['codigoTipoCombustivel'] = int(split[1])
|
|
33
|
+
payload['tipoConsulta'] = str('tradicional')
|
|
34
|
+
|
|
35
|
+
return payload
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from fipe.api import FipeApi
|
|
5
|
+
|
|
6
|
+
class AnosModelo(FipeApi):
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['ConsultarAnoModelo'])
|
|
11
|
+
|
|
12
|
+
def get_anos_by_modelo(self, codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca, codigoModelo):
|
|
13
|
+
try:
|
|
14
|
+
logging.info(f'listing FIPE Years by Model {str(codigoModelo)}...')
|
|
15
|
+
res = self.call_request(
|
|
16
|
+
http_method=HTTPMethod.POST,
|
|
17
|
+
request_url=self.endpoint_url,
|
|
18
|
+
payload=self.create_payload(codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca, codigoModelo)
|
|
19
|
+
)
|
|
20
|
+
return jsonpickle.decode(res)
|
|
21
|
+
except:
|
|
22
|
+
raise
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from fipe.api import FipeApi
|
|
5
|
+
|
|
6
|
+
class Marcas(FipeApi):
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['ConsultarMarcas'])
|
|
11
|
+
|
|
12
|
+
def get_marcas(self, codigoTabelaReferencia, codigoTipoVeiculo):
|
|
13
|
+
try:
|
|
14
|
+
logging.info('listing FIPE Brands...')
|
|
15
|
+
res = self.call_request(
|
|
16
|
+
http_method=HTTPMethod.POST,
|
|
17
|
+
request_url=self.endpoint_url,
|
|
18
|
+
payload=self.create_payload(codigoTabelaReferencia, codigoTipoVeiculo)
|
|
19
|
+
)
|
|
20
|
+
return jsonpickle.decode(res)
|
|
21
|
+
except:
|
|
22
|
+
raise
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from fipe.api import FipeApi
|
|
5
|
+
|
|
6
|
+
class Modelos(FipeApi):
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['ConsultarModelos'])
|
|
11
|
+
|
|
12
|
+
def get_modelos_by_marca(self, codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca):
|
|
13
|
+
try:
|
|
14
|
+
logging.info(f'listing FIPE Models by Brand {str(codigoMarca)}...')
|
|
15
|
+
res = self.call_request(
|
|
16
|
+
http_method=HTTPMethod.POST,
|
|
17
|
+
request_url=self.endpoint_url,
|
|
18
|
+
payload=self.create_payload(codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca)
|
|
19
|
+
)
|
|
20
|
+
return jsonpickle.decode(res)
|
|
21
|
+
except:
|
|
22
|
+
raise
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from fipe.api import FipeApi
|
|
5
|
+
|
|
6
|
+
class TabelasReferencia(FipeApi):
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['ConsultarTabelaDeReferencia'])
|
|
11
|
+
|
|
12
|
+
def get_tabelas_referencia(self):
|
|
13
|
+
try:
|
|
14
|
+
logging.info('listing FIPE reference tables...')
|
|
15
|
+
res = self.call_request(
|
|
16
|
+
http_method=HTTPMethod.POST,
|
|
17
|
+
request_url=self.endpoint_url
|
|
18
|
+
)
|
|
19
|
+
return jsonpickle.decode(res)
|
|
20
|
+
except:
|
|
21
|
+
raise
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging, jsonpickle
|
|
2
|
+
from http import HTTPMethod
|
|
3
|
+
from fmconsult.utils.url import UrlUtil
|
|
4
|
+
from fipe.api import FipeApi
|
|
5
|
+
|
|
6
|
+
class ValorParametros(FipeApi):
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
self.endpoint_url = UrlUtil().make_url(self.base_url, ['ConsultarValorComTodosParametros'])
|
|
11
|
+
|
|
12
|
+
def get_valor_by_parametros(self, codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca, codigoModelo, anoModelo):
|
|
13
|
+
try:
|
|
14
|
+
logging.info(f'get Valor by parameters...')
|
|
15
|
+
res = self.call_request(
|
|
16
|
+
http_method=HTTPMethod.POST,
|
|
17
|
+
request_url=self.endpoint_url,
|
|
18
|
+
payload=self.create_payload(codigoTabelaReferencia, codigoTipoVeiculo, codigoMarca, codigoModelo, anoModelo)
|
|
19
|
+
)
|
|
20
|
+
return jsonpickle.decode(res)
|
|
21
|
+
except:
|
|
22
|
+
raise
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fipe-python-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Client de comunicaçao c/ API da Fipe
|
|
5
|
+
Author-email: Filipe Coelho <filipe@fmconsult.com.br>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Seu Nome
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy...
|
|
11
|
+
|
|
12
|
+
Project-URL: Homepage, https://github.com/seuuser/minha-biblioteca
|
|
13
|
+
Project-URL: Bug Tracker, https://github.com/seuuser/minha-biblioteca/issues
|
|
14
|
+
Keywords: sdk,api,fipe,fmconsult
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/__init__.py
|
|
5
|
+
src/fipe/__init__.py
|
|
6
|
+
src/fipe/api.py
|
|
7
|
+
src/fipe/apis/__init__.py
|
|
8
|
+
src/fipe/apis/anos_modelo.py
|
|
9
|
+
src/fipe/apis/marcas.py
|
|
10
|
+
src/fipe/apis/modelos.py
|
|
11
|
+
src/fipe/apis/tabelas_referencia.py
|
|
12
|
+
src/fipe/apis/valor_parametros.py
|
|
13
|
+
src/fipe_python_sdk.egg-info/PKG-INFO
|
|
14
|
+
src/fipe_python_sdk.egg-info/SOURCES.txt
|
|
15
|
+
src/fipe_python_sdk.egg-info/dependency_links.txt
|
|
16
|
+
src/fipe_python_sdk.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|