index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
48,994 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/generators/genkit/v1.py | '''
Created on 11. 5. 2014
@author: casey
'''
import os, sys
from collections import OrderedDict
from ner import dates
features_code = {}
def generate(proc_res, kb, include_all_senses = False):
'''
Bake output with KB config and KB data. Pair KB column names from KB config and row data from KB.
@proc_res - raw data from processing tools
@kb - instance of KB class
'''
global features_code
if not features_code:
with open(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),"api","NER","geoData.all"),"r") as f:
data = f.read()
for row in data.split("\n"):
items = row.split("\t")
if len(items) >=2:
features_code[items[0]] = items[1]
result = groupResultItems(proc_res,include_all_senses)
splitter = kb.config["value_splitter"] if kb.config["value_splitter"] is not None else ""
splitter = splitter.encode("utf-8")
result_kb = []
for key,data in result.items():
if str(key) in ["dates", "intervals"]:
result_kb.append({key:data})
else:
if(include_all_senses):
senses = data[0][-1]
[item.pop() for item in data]
kb_row = [bakeKBrow(sense,kb, splitter) for sense in senses]
kb_row = kb_row if len(kb_row) > 1 else kb_row[0]
else:
kb_row = bakeKBrow(key, kb, splitter)
result_kb.append({
"kb_row":kb_row,
"items":data
})
return result_kb
def bakeKBrow(key, kb, splitter):
global features_code
kb_data = OrderedDict()
item_type = kb.get_field(key, 0)[0]
if item_type in kb.header:
columns = kb.header[item_type]
else:
columns = kb.header["generic"]
for a in range(len(columns)):
colname = columns[a];
field_data = kb.get_field(key,a)
if colname.startswith('*'):
field_data = field_data.split(splitter) if len(field_data) > 0 else ""
colname = colname[1:]
elif colname == "feature code":
field_data = [field_data, features_code[field_data]] if field_data in features_code else field_data
kb_data[colname] = field_data
return kb_data
def groupResultItems(result, include_all_senses=False):
'''
Group the same entities items into one container - saving bandwith data.
'''
results_group = {}
for item in result:
if isinstance(item, dates.Date):
if item.class_type == item.Type.DATE:
item_id = "dates"
item_data= [item.s_offset, item.end_offset, item.source, str(item.iso8601)]
elif item.class_type == item.Type.INTERVAL:
item_id = "intervals"
item_data= [item.s_offset, item.end_offset, item.source, str(item.date_from), str(item.date_to) ]
else:
continue
else:
if item.preferred_sense:
item_id = item.preferred_sense
item_data = [item.begin, item.end, item.source, item.is_coreference()]
if include_all_senses:
senses = list(item.senses)
if item.preferred_sense in senses:
senses.remove(item.preferred_sense)
senses.insert(0,item.preferred_sense)
else:
senses.insert(0,item.preferred_sense)
item_data.append(senses)
else:
continue
if item_id not in results_group.keys():
results_group[item_id] = [item_data]
else:
data = results_group.get(item_id)
data.append(item_data)
results_group[item_id] = data
return results_group | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
48,995 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/core.py | '''
Created on 16. 4. 2014
@author: casey
'''
import cherrypy
from annotation.annotator import Annotator
from assets.manager import AssetManager
from annotation.toolkit import Toolkit
from assets.adapters.factory import AdapterFactory
class AppCore(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.annotator = None
self.assetManager = None
self.appConfig = None
def inito(self):
app = cherrypy.tree.apps['']
self.appConfig = app.config
AdapterFactory.loadAdapters()
self.toolkit = Toolkit(app.config["pipelines"])
#self.resultFactory = ResultGenerator()
self.assetManager = AssetManager()
self.assetManager.start()
self.assetManager.loadAssetsForTools(self.toolkit.getTools())
self.assetManager.autoload()
self.annotator = Annotator()
self.annotator.generate_toolkit(self.toolkit, app.config["annotator"],)
#self.annotator.createPipeline(self.toolkit + self.resultFactory)
def destroy(self):
cherrypy.log.error("CORE Stopped")
self.assetManager.stop()
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
48,996 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/tools/_abstract.py | '''
Created on 24. 4. 2014
@author: casey
'''
from core.pipeline import Pipeline
class AbstractTool(Pipeline):
'''
classdocs
'''
def __init__(self, config = None):
'''
Constructor
'''
super(AbstractTool, self).__init__()
self.config = config
def call(self, tool, input_data, params):
raise Exception("Do not call, abstract class!")
@classmethod
def testAssetCompatibility(self, asset):
return True | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
48,997 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/web/parser.py | '''
Created on 10.3.2013
@author: xjerab13
'''
import cherrypy
import json
import os
class Parser():
'''
Parser class, handling requests for "/parser"
'''
def __init__(self):
pass
@cherrypy.expose
def testFilesList(self):
'''Retrun json of aviable text files for quick testing'''
#print os.listdir(os.path.join(os.getcwd(),'test'))
folder = cherrypy.request.app.config['core']['text_examples']
files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder,f))]
cherrypy.response.headers['Content-Type'] = "application/json"
return json.dumps(files)
@cherrypy.expose
def testFileContent(self, filename):
'''
Return content of texting file.
@filename - name of testing file for load
@return - content of filename
'''
filename = os.path.basename(filename)
path = os.path.join(cherrypy.request.app.config['core']['text_examples'],filename)
with open(path,'r') as f:
text = f.read()
return text | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
48,998 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/annotator.py | # -*- coding: utf-8 -*-
'''
Created on 17. 4. 2014
@author: casey
'''
class Annotator(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.pipeline = None
self.toolkit = {}
def createPipeline(self, pipeline):
self.pipeline = pipeline
def annotate(self, request):
self.toolkit[request.tool].process(request)
#return self.pipeline.process(request)
def generate_toolkit(self, toolkit, config):
tools = config["enabled"]
for ckey, value in config.iteritems():
if ckey.startswith("tool"):
key,tool_name,what = ckey.split(".")
if key == "tool" and tool_name in tools and what =="pipeline":
self.toolkit[tool_name] = toolkit.createPipeline(value.split("+"))
def getTools(self):
return self.toolkit.keys()
def getPipeline(self, tool):
return self.toolkit[tool]
class AnnotationRequest():
def __init__(self, text = "", tool = "", asset = "", version = -1):
self.input_data = text
self.ongoing_data = None
self.output_data = None
self.tool = tool
self.tool_params = {}
self.assetName = asset
self.asset = None
self.version = version
self.filter = None
#self.nameRecog = ""
def parseRPC(self, rpcData):
self.input_data = rpcData["text"]
self.tool = rpcData["tool"]
self.assetName = rpcData["assetName"]
self.tool_params = rpcData["toolParams"]
def getResult(self):
return self.result
def final_init(self, core):
self.asset = core.assetManager.getAsset(self.assetName)
def test_integrity(self):
pass
def __tool_available(self):
pass
def __asset_available(self):
pass
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
48,999 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/pipeline.py | '''
Created on 24. 4. 2014
@author: casey
'''
class Pipeline(object):
'''
classdocs
'''
def __init__(self):
self.data = {}
self.nextHandler = None
def __add__(self, newHandler):
"""Used to append handlers to each other"""
if not isinstance(newHandler, Pipeline):
raise TypeError('Handler.__add__() expects Pipeline')
if self.nextHandler:
self.nextHandler + newHandler
else:
self.nextHandler = newHandler
while newHandler:
newHandler.data = self.data
newHandler = newHandler.nextHandler
return self
def process(self, request):
"""Wrapper around the internal _hook method"""
self._hook(request)
if self.nextHandler:
return self.nextHandler.process(request)
else:
self.data.clear( )
return
def _hook(self, request):
"""Default hook method to be overridden in subclasses"""
return True
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,000 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/generators/genkit/v2.py | # -*- coding: utf-8 -*-
'''
Created on 22. 5. 2014
@author: casey
'''
import os, sys
from collections import OrderedDict
from ner import dates
kb_records = {"kbID":{"entry"}}
entities = {
"groupID":{
"type":"entity",#date, interval
"preferred":0,
"others":[1,2,3,4],
"items":[2,4,5,9]
}
}
items = [[0,14,"text",False, "groupID" ],[],[],[]]
features_code = {}
def generate(request):
global features_code
if not features_code:
with open(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),"api","NER","geoData.all"),"r") as f:
data = f.read()
for row in data.split("\n"):
items = row.split("\t")
if len(items) >=2:
features_code[items[0]] = items[1]
kb = request.asset.getPart("kb")
itemID = 0;
entityID= 0;
kb_records = set([])
tmp_entities = {}
items = []
groups = generateGroups(kb)
result = request.ongoing_data
for a in range(len(result)):
item = result[a]
item_id = None
item_data = None
tags = []
group = None
if isinstance(item, dates.Date):
senses = None
if item.class_type == item.Type.DATE:
item_id = str(item.iso8601)
item_data= [tags,item.start_offset, item.end_offset, item.source, str(item.iso8601)]
group = "cd"
elif item.class_type == item.Type.INTERVAL:
item_id = str(item.date_from)+str(item.date_to)
item_data= [tags,item.start_offset, item.end_offset, item.source, str(item.date_from), str(item.date_to)]
group = "ci"
else:
continue
elif item.get_preferred_sense():
item_id = item.get_preferred_sense()
if item.is_coreference:
tags.append("cf")
if item.is_name:
tags.append("name")
item_data = [tags, item.start_offset, item.end_offset, item.source]
senses = list(item.senses)
kb_records.update(senses)
kb_records.add(item_id)
else:
print "noname!"
group = "unkn"
item_id = item.source
tags = ["nr"]
item_data= [tags,item.start_offset, item.end_offset, item.source]
if item_id and item_data:
if item_id in tmp_entities:
group = tmp_entities[item_id]
groupid = group.keys()[0]
groupdata = group.values()[0]
groupdata["items"].append(itemID)
item_data.insert(0,groupid)
else:
groupid = entityID
entityID += 1
groupdata = {
"preferred":item_id if type(item_id) is int else None,
"others":senses,
"items":[itemID],
"group":group
}
item_data.insert(0,groupid)
tmp_entities[item_id] = {groupid:groupdata}
items.append(item_data)
itemID += 1
kb_rec = generateKBRecords(kb_records, kb)
entities = {}
for ent in tmp_entities.values():
eid, data = ent.items()[0]
if not data["group"]:
if "generic" in kb.header:
data["group"] = "generic"
else:
prefix = kb_rec[data["preferred"]]["id"].split(":")[0]
data["group"] = prefix if prefix in groups else None
entities[eid]=data
return {
"kb_records":kb_rec,
"entities":entities,
"items":items,
"groups":groups
}
def generateKBRecords(idSet, kb):
global features_code
splitter = kb.config["value_splitter"] if kb.config["value_splitter"] is not None else ""
splitter = splitter.encode("utf-8")
kb_records = {}
for key in idSet:
kb_data = OrderedDict()
item_type = kb.get_data_at(key, int(0+1))[0]
#print item_type,
if item_type in kb.header:
columns = kb.header[item_type]
else:
columns = kb.header["generic"]
for a in range(len(columns)):
colname = columns[a];
field_data = kb.get_data_at(key,int(a+1))
#print field_data,
if colname.startswith('*'):
field_data = field_data.split(splitter) if len(field_data) > 0 else ""
colname = colname[1:]
elif colname == "feature code":
field_data = [field_data, features_code[field_data]] if field_data in features_code else field_data
kb_data[colname] = field_data
kb_records[int(key)] = kb_data
#print "----"
return kb_records
def generateGroups(kb):
groups = kb.groups
groups["cd"] = {"name":"date","dataPlus":None}
groups["ci"] = {"name":"interval","dataPlus":None}
groups["unkn"] = {"name":"unknown","dataPlus":None}
return groups
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,001 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/toolkit.py | '''
Created on 17. 4. 2014
@author: casey
'''
import os
from core.pipeline import Pipeline
from core.loader import loadClasses
from tools._abstract import AbstractTool
from filters._abstract import AbstractFilter
from generators._abstract import AbstractGenerator
class Toolkit():
conf = {
"tools":[os.path.join(os.path.dirname(os.path.abspath(__file__)),'tools'), AbstractTool, "AbstractTool"],
"filters":[os.path.join(os.path.dirname(os.path.abspath(__file__)),'filters'), AbstractFilter, "AbstractFilter"],
"generators":[os.path.join(os.path.dirname(os.path.abspath(__file__)),'generators'), AbstractGenerator, "Generator"]
}
blocks = {
"f":"filters",
"t":"tools",
"g":"generators",
"p":"shared_pipelines"
}
def __init__(self, pipelines):
self.filters = {}
self.generators = {}
self.tools = {}
self.namedTools = {}
self.initialize()
self.shared_pipelines = {}
self.pregenerate_pipelines(pipelines)
def initialize(self):
for key, conf in Toolkit.conf.iteritems():
classes = loadClasses(*conf)
block = getattr(self, key)
for c in classes:
block[c.__name__]=c
print c
def pregenerate_pipelines(self, pipelines):
for key, value in pipelines.iteritems():
self.shared_pipelines[key] = [self.getBlock(*block.split(".")) for block in value.split("+")]
def getBlock(self, block, name):
group = getattr(self, Toolkit.blocks[block])
if name in group:
return group[name]
else:
pass
def getBlockInstance(self, block, name):
sup = self.getBlock(block, name)
if isinstance(sup, list):
ret = sup[0]()
for r in sup[1:]:
ret + r()
return ret
else:
return sup()
def createPipeline(self, pipeline):
result = None
for block in pipeline:
if result is None:
result = self.getBlockInstance(*block.split("."))
else:
result + self.getBlockInstance(*block.split("."))
return result
def getTools(self):
return self.tools
def getTool(self, tool):
print tool, self.tools
return self.tools[tool] if tool in self.tools else None
class Toolkito(Pipeline):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
Pipeline.__init__(self)
self.tools = {}
self.loadTools(Tool)
def _hook(self, request):
tool, args = self.prepareToolArgumens(request)
request.ongoing_data = self.callTool(tool, args)
def callTool(self, tool, args):
return self.tools[tool].call(**args)
def prepareToolArgumens(self, request):
tool = self.tools[request.tool]
args = {}
for r in tool.require:
args[r] = getattr(request,r)
return request.tool, args
def loadTools(self, base_class):
classes = loadClasses(os.path.join(os.path.dirname(os.path.abspath(__file__)),'tools'), base_class, "Tool")
for c in classes:
self.tools[c.toolName]=c()
def getTools(self):
return self.tools
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,002 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/filters/inputFilters.py | # -*- coding: utf-8 -*-
'''
Created on 12. 5. 2014
@author: casey
'''
from ner import remove_accent
from core.annotation.filters._abstract import AbstractFilter
class UTFEncode(AbstractFilter):
def _hook(self, request):
request.input_data = self.encode(request.input_data)
def encode(self, text):
tmptext = self.safe_str(text.encode("utf-8"))
return tmptext
def safe_unicode(self, obj, *args):
""" return the unicode representation of obj """
try:
return unicode(obj, *args)
except UnicodeDecodeError:
# obj is byte string
ascii_text = str(obj).encode('string_escape')
return unicode(ascii_text)
def safe_str(self, obj):
""" return the byte string representation of obj """
try:
return str(obj)
except UnicodeEncodeError:
# obj is unicode
return unicode(obj).encode('unicode_escape')
class CharFilter(AbstractFilter):
def _hook(self, request):
request.input_data = self.filter(request.input_data)
def filter(self, text):
tmptext = text.rstrip() + "\n"
return tmptext.replace(u"–",u"-").replace(u"“",u' ').replace(u"”",u' ').replace(u"’",u' ').replace(u"‘",u' ').replace(u";",u" ").replace(";"," ")
class RemoveAccent(AbstractFilter):
def _hook(self, request):
request.input_data = self.filter(request.input_data)
def filter(self, text):
return remove_accent(text)
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,003 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/__init__.py | '''
Created on 25. 11. 2013
@author: xjerab13
'''
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,004 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/_adapters/functions.py | '''
Created on 13. 5. 2014
@author: casey
'''
import re
def loadHeaderFromFile(filename):
column_ext_def = {"g":{"type":"image"},
"u":{"type":"url"}
}
col_prefix = {
"person":"p",
"artist":"a",
"location":"l",
"artwork":"w",
"museum":"c",
"event":"e",
"visual_art_form":"f",
"visual_art_medium":"d",
"art_period_movement":"m",
"visual_art_genre":"g",
"nationality":"n",
"mythology":"y",
"family":"i",
"group":"r"
}
regex = re.compile('(?u)^(?:<([^:>]+)(?:[:]([^>]+))?>)?(?:\{((?:\w|[ ])*)(?:\[([^\]]+)\])?\})?((?:\w|[ ])+)$')
columns = {}
groups = {}
with open(filename,'r') as f:
raw_colums = f.read().strip()
for row in raw_colums.split("\n"):
column = []
dataPlus = {}
row_split = row.split("\t")
row_head = row_split.pop(0)
item_type, item_subtype, item_flags, item_prefix, item_name = regex.search(row_head).groups()
print item_type, item_subtype, item_flags, item_prefix, item_name
row_prefix = col_prefix[item_type]
groups[row_prefix]= {"name": item_type.lower()}
column.append(item_name.lower())
for col_name in row_split:
item_type, item_subtype, item_flags, item_prefix, item_name = regex.search(col_name).groups()
if item_flags is not None:
for k in item_flags:
if k in column_ext_def:
dataPlus[item_name.lower()] = {"type":column_ext_def[k]["type"],
"data":item_prefix if item_prefix else ""
}
if item_flags is not None and "m" in item_flags:
item_name = "*" + item_name
column.append(item_name.lower())
groups[row_prefix]["dataPlus"] = dataPlus
columns[row_prefix] = column
return columns, groups
def loadHeaderFromFile2(filename):
column_ext_def = {"g":{"type":"image"},
"u":{"type":"url"}
}
columns = {}
groups = {}
with open(filename,'r') as f:
raw_colums = f.read().strip()
for row in raw_colums.split("\n"):
column = []
dataPlus = {}
row_split = row.split("\t")
row_head = row_split.pop(0)
row_prefix, row_head, row_id = row_head.split(":")
groups[row_prefix]= {"name": row_head.lower()}
column.append(row_id.lower())
for col_name in row_split:
prefix = ""
url = ""
if ':' in col_name:
col_split = col_name.split(":")
prefix = ":".join(col_split[:-1])
if "[" in prefix:
prefix,url = prefix.split("[")
col_name = col_split[-1]
for k in prefix:
if k in column_ext_def:
dataPlus[col_name.lower()] = {"type":column_ext_def[k]["type"],
"data":url[:-1]
}
if "m" in prefix:
col_name = "*" + col_name
column.append(col_name.lower())
groups[row_prefix]["dataPlus"] = dataPlus
columns[row_prefix] = column
return columns, groups
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,005 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/__init__.py | '''
Created on 15. 4. 2014
@author: casey
'''
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,006 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /webapiner.py | import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import cherrypy
import os
from core.web import Root
from core.core import AppCore
from core.api.WebSocket import WebsocketHandler
from core.api.REST import RESTHandler
from core.api.HTTP import HTTPHandler
from core.api.JSONRPC import JSONRPCHanlder
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
from cherrypy.process.plugins import PIDFile
current_dir = os.path.dirname(os.path.abspath(__file__))
def main():
#cherrypy.config.update({'error_page.404': error_page_404})
cherrypy.config.update('webapiner.ini')
print cherrypy.__version__
core = AppCore()
WebSocketPlugin(cherrypy.engine).subscribe()
cherrypy.engine.json_rpc = JSONRPCHanlder(cherrypy.engine, core)
cherrypy.engine.json_rpc.subscribe()
cherrypy.tools.websocket = WebSocketTool()
http_conf = {
'/':{'tools.staticdir.on':False}
}
rest_conf = {
'/':{'request.dispatch':cherrypy.dispatch.MethodDispatcher()}
}
cherrypy.tree.mount(RESTHandler(), "/api/REST/", config = rest_conf)
cherrypy.tree.mount(HTTPHandler(), "/api/HTTP/", config = http_conf)
PIDFile(cherrypy.engine, os.path.join(current_dir, "webapiner.pid")).subscribe()
cherrypy.engine.subscribe("start", core.inito)
cherrypy.engine.subscribe("stop", core.destroy)
cherrypy.quickstart(Root(),'/','webapiner.ini')
if __name__ == '__main__':
main()
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,007 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/web/__init__.py | '''
Pakage contains group of class for handling webpage requests.
'''
from core.web.parser import Parser
import cherrypy
class Root():
'''
Root page, handling all request for "/" path.
'''
def __init__(self):
'''
@core - instance of main core class.
'''
self.parser = Parser()
@cherrypy.expose
def ws(self):
print "new ws handler!!"
@cherrypy.expose
def api(self):
pass
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,008 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/WebSocket.py | import cherrypy
from ws4py.websocket import WebSocket
class WebsocketHandler(WebSocket):
def __init__(self, sock, protocols=None, extensions=None, environ=None, heartbeat_freq=None):
WebSocket.__init__(self, sock, protocols, extensions, environ, heartbeat_freq)
self.json_rpc = cherrypy.engine.json_rpc
def received_message(self, message):
"""
Automatically sends back the provided ``message`` to
its originating endpoint.
"""
print "ws message accepted"
print cherrypy.tree.apps[''].config['global']['tools.staticdir.root']
self.send("accepted", message.is_binary)
print self.json_rpc.callRPC("websocket")
def propagate(self, msg):
cherrypy.engine.publish('websocket-broadcast', str(msg))
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,009 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/generators/gFigaNer.py | '''
Created on 11. 5. 2014
@author: casey
'''
from core.annotation.generators._abstract import AbstractGenerator
import genkit.v1
import genkit.v2
class FigaNer(AbstractGenerator):
def _hook(self, request):
request.output_data = self.generate(request, request.version)
def generate(self, request, version):
return getattr(self, '_' + self.__class__.__name__+"__genV"+str(version))(request)
def __genV1(self, request):
return genkit.v1.generate(request.ongoing_data, request.asset.getPart("kb"), True)
def __genV2(self, request):
return genkit.v2.generate(request) | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,010 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/REST.py | '''
Created on 13. 4. 2014
@author: casey
'''
import cherrypy
from _REST.restV1 import RESTService
class RESTHandler():
def __init__(self):
self.v1 = RESTService()
def GET(self):
raise cherrypy.HTTPError(404)
def POST(self):
raise cherrypy.HTTPError(404)
def PUT(self):
raise cherrypy.HTTPError(404)
def DELETE(self):
raise cherrypy.HTTPError(404) | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,011 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/_JSONRPC/rpcV2.py | # -*- coding: utf-8 -*-
'''
Created on 24. 4. 2014
@author: casey
'''
import os
from core.api._JSONRPC.protocol import AProtocol
from core.annotation.generators.genkit.v2 import generateKBRecords, generateGroups
from core.annotation.filters.inputFilters import UTFEncode
from collections import OrderedDict
#from nameRecog import process_outputs as po
from name_recognizer import process_outputs as po
toolsParams = {"ner":["lower","remove accent","name_recognize"],
"figa":["overlapping","boundary"]
}
class Protocol(AProtocol):
def __init__(self, core):
super(Protocol, self).__init__(core)
self.version = 2
def RPC_getWebapiInitPack(self):
assets = self.core.assetManager.getAssets()
assets_data = {}
tools = {}
for tool in self.core.annotator.getTools():
tools[tool] = { "name":tool,
"params":toolsParams[tool] if tool in toolsParams else [],
"version" : " 2f034e96d0e31deb01b49725f5878c6d0a629bd2"
}
for asset in assets:
assets_data[asset.id_name] = {
"name":asset.name,
"description":"",
"version":asset.version,
"type":"",
#"tools":asset.tools if len(asset.tools) > 1 else asset.tools[0],
"tools":asset.tools,
"state":asset.state.value -1
}
pack = {
#"tools":self.core.annotator.getTools(),
"tools":tools,
"assets":assets_data,
"example_files":self.nextChainItem.process("listExampleFiles", 1, {}),
"configs":[]
}
return pack
def RPC_getFile(self, filename):
return self.nextChainItem.process("getFileContent", 1, {"filename":filename})
def RPC_getConfig(self, filename):
pass
def RPC_loadAsset(self, assetName):
print "Request to load asset", assetName
self.core.assetManager.loadAsset(assetName)
def RPC_dropAsset(self, assetName):
print "Request to drop asset", assetName
self.core.assetManager.dropAsset(assetName)
def RPC_annotate(self, request):
request.final_init(self.core)
#if "name_recognize" in request.tool_params and request.tool_params["name_recognize"] and False:
# folder = self.core.appConfig['namerecog']["n.folder"]
# asset = self.core.appConfig['namerecog']["n.asset"]
# utffilter = UTFEncode()
# request.nameRecog = self.core.toolkit.getTool('Figa')().call_raw(utffilter.encode(request.input_data), os.path.join(folder,asset))
self.core.annotator.annotate(request)
request.output_data["header"] = {}
return request.output_data
def RPC_autocomplete(self, inputData, automat):
kb = self.core.assetManager.getAsset("KBstatsMetrics").getPart("kb")
if not kb.isLoaded():
return {}
folder = self.core.appConfig['autocomplete']["ac.folder"]
utffilter = UTFEncode()
partialResult = self.core.toolkit.getTool('Figa')().autocomplete(utffilter.encode(inputData), os.path.join(folder,automat), 5)
kb_records = generateKBRecords(partialResult, kb)
partialMatch = []
others = []
inputTextRaw = inputData.lower().strip()
# for entity in partialResult:
# kb_records.add(entity.preferred_sense)
# kb_records.update(entity.senses)
# item={"name":entity.source,
# "preffered":entity.preferred_sense,
# "others": entity.senses[1:] if entity.preferred_sense in entity.senses else entity.senses
# }
# entities[cnt] = item
# cnt+=1
for key,data in kb_records.items():
Ename = [data.get(column) for column in ['name','display term'] if data.get(column, None) is not None][0].lower()
#print Ename,inputTextRaw,inputTextRaw in Ename
if inputTextRaw in Ename:
partialMatch.append((key,data))
else:
others.append((key,data))
partialMatch = sorted(partialMatch, key=lambda x: x[1]["confidence"], reverse=True)
others = sorted(others, key=lambda x: x[1]["confidence"], reverse=True)
final = partialMatch + others
finalslice = {a:b for a,b in final[:10]}
return {
"kb_records":finalslice,
"entities":None,
"items":None,
"groups":generateGroups(kb)
}
def RPC_getAutocompleteInitPack(self):
folder = self.core.appConfig['autocomplete']["ac.folder"]
extension = self.core.appConfig['autocomplete']["ac.extension"].encode("utf-8")
ignore = self.core.appConfig['autocomplete']["ac.ignore"]
print extension
files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder,f)) and os.path.splitext(f)[1]==extension and f not in ignore]
print [os.path.isfile(os.path.join(folder,f)) for f in os.listdir(folder) ]
return {"automats":files}
def RPC_nameRecognition(self, inputData):
result = []
folder = self.core.appConfig['namerecog']["n.folder"]
asset = self.core.appConfig['namerecog']["n.asset"]
utffilter = UTFEncode()
partialResult = self.core.toolkit.getTool('Figa')().call_raw(utffilter.encode(inputData), os.path.join(folder,asset))
figaready = []
for line in partialResult.split("\n"):
x = "\t".join(line.split("\t")[:4])
figaready.append(x)
figaready = ("\n").join(sorted(figaready))
if len(figaready) > 0:
d = po.Document(figaready, inputData, False, po.OUT_FILTERED, po.OUT_LEARNED , po.TOLERANCE, False)
d.analyze()
if d.name_list != []:
tlist = sorted(d.name_list)
for d in tlist:
result.append([d.type, d.start_offset, d.end_offset, d.value])
return result
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,012 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/_REST/_v1/__init__.py | '''
Created on 14. 4. 2014
@author: casey
'''
__all__ = ['figa', 'hner', 'kb']
from figa import *
from hner import *
from kb import * | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,013 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/JSONRPC.py | '''
Created on 13. 4. 2014
@author: casey
'''
import os
import json
import cherrypy
from cherrypy.process import plugins
from core.loader import loadClasses
from core.api._JSONRPC.protocol import AProtocol, ProtocolEndPoint
from core.chain import ChainOfResponsibility
class JSONRPCHanlder(plugins.SimplePlugin):
def __init__(self, bus, core):
plugins.SimplePlugin.__init__(self, bus)
self.core = core
self.protocol = None
self.generateProtocolChain()
def start(self):
cherrypy.log.error("JSON-RPC Started")
def stop(self):
cherrypy.log.error("JSON-RPC Stopped")
def callRPC(self, action, version=-1, rpc_args = {}):
return self.protocol.process(action, version, rpc_args)
def generateProtocolChain(self):
classes = loadClasses(os.path.join(os.path.dirname(os.path.abspath(__file__)),'_JSONRPC'), AProtocol, "AProtocol")
self.protocol = ChainOfResponsibility.generate(classes, ProtocolEndPoint, {'core':self.core})
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,014 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/_abstract.py | '''
Created on 9. 5. 2014
@author: casey
'''
import os, sys
class AbstractAdapter(object):
'''
classdocs
'''
def __init__(self, target, asset_folder, config):
'''
Constructor
'''
self.target = target
self.asset_folder = asset_folder #relative to target path
self.base_folder = os.path.dirname(os.path.realpath(sys.argv[0]))
self.config = config
#self.custom_init()
def preload_init(self):
#only for local path - remote target will be memory name = exception
abs_path = self.getNormalizedPath(self.asset_folder, self.target)
if not os.path.exists(abs_path):
raise Exception(("Asset part not found no selected path {0}").format(abs_path))
def getNormalizedPath(self, base, path):
if os.path.isabs(path):
return path
else:
return os.path.normpath(os.path.join(base, path))
def getTargetPath(self):
return self.getNormalizedPath(self.asset_folder, self.target)
class AbstractDynamicAdapter(AbstractAdapter):
def load(self):
pass
def drop(self):
pass
def postload_init(self):
pass
def isLoaded(self):
return False
def isLoadable(self):
return True
class AbstractStaticAdapter(AbstractAdapter):
def isLoadable(self):
return False | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,015 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/asset.py | '''
Created on 25. 4. 2014
@author: casey
'''
import logging
import os
import json
from enum import Enum
from core.assets.adapters.factory import AdapterFactory
AssetStates = Enum('AssetState','OFFLINE, QUEUED, LOADING, UNLOADING, ONLINE')
class Asset(object):
'''
classdocs
'''
def __init__(self, config, assetFolder, isLocal=True):
'''
Constructor
'''
self.asset_folder = assetFolder
self.config_name = config
self.id_name = config.split(".")[0]
self.config = {}
self.isLocal = isLocal
self.name = None
self.version = "N/A"
self.tools = []
self.parts = {}
self.state = AssetStates.OFFLINE
self.loadConfig()
def loadConfig(self):
conf = self.__loadKBJson()
self.config = conf
self.name = conf["asset"]["name"]
self.version = conf["asset"]["version"]
self.tools = conf["configuration"]["tools"] if isinstance(conf["configuration"]["tools"], list) else [conf["configuration"]["tools"]]
self.__loadParts(conf["configuration"]["parts"])
def __getPath(self, path):
if os.path.isabs(path):
return path
else:
return os.path.normpath(os.path.join(self.asset_folder, path))
def __loadParts(self, conf):
for pname, pconfig in conf.iteritems():
self.parts[pname] = AdapterFactory.make(self.asset_folder, pconfig)
def __loadKBJson(self):
'''
Load config json from KB confign, parse it and return as dict
@return - loaded config as dict
'''
f = open(self.__getPath(self.config_name))
data = json.loads(f.read())
f.close()
return data
def getPart(self, partName):
return self.parts[partName]
def autoload(self, loadQueue):
if "configuration" in self.config and "auto-load" in self.config["configuration"]:
if self.config["configuration"]["auto-load"]:
self.load(loadQueue)
def drop(self):
for part in self.parts.values():
if part.isLoadable() and part.isLoaded():
self.state = AssetStates.QUEUED
part.drop()
def load(self, load_qeue):
loadable = []
for part in self.parts.values():
if part.isLoadable() and not part.isLoaded():
self.state = AssetStates.QUEUED
loadable.append(part)
load_qeue.append([self, loadable])
def isLoaded(self):
status = True
for part in self.parts.values():
if part.isLoadable():
status = status and part.isLoaded()
logging.error("status of {0} is {1}".format(self.name, status))
return status
def changeState(self, state):
self.state = state
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,016 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/_adapters/kblocal.py | # -*- coding: utf-8 -*-
'''
Created on 9. 5. 2014
@author: casey
'''
import os, re
import gc
import commands
from ctypes import cdll, POINTER, c_char_p, c_int, c_void_p
from core.assets.adapters._abstract import AbstractDynamicAdapter
from core.assets.adapters._adapters.functions import loadHeaderFromFile
class KBgeneric(AbstractDynamicAdapter):
def __init__(self, target, base_folder, config):
super(KBgeneric, self).__init__(target, base_folder, config)
self.lines = None
self.items_number = None
self.header = {}
self.groups = {}
self.groupsData = {}
self.preload_init()
def preload_init(self):
AbstractDynamicAdapter.preload_init(self)
config_header = self.config["header"]
if config_header["external_file"]:
self.header, self.groups = loadHeaderFromFile(self.getNormalizedPath(self.asset_folder, config_header["external_file"]))
elif config_header["custom"]:
self.header = {"generic":config_header["custom"]["generic"]}
self.groups = {"generic":config_header["custom"]["data"]}
def load(self):
'''
Load KB from file via kb_loader.so.
'''
target_path = self.getNormalizedPath(self.asset_folder, self.target)
count = commands.getoutput('wc -l ' + target_path + ' | cut -d" " -f1')
self.items_number = int(count)
maxitem = 33
lib = cdll.LoadLibrary( os.path.join(self.base_folder, "api","NER","figa","sources","kb_loader.so"))
lib.queryTree.restype = POINTER(POINTER(c_char_p))
lib.queryTree.argtypes = [c_char_p,c_int,c_int]
self.lines = lib.queryTree(target_path, self.items_number, maxitem);
def _drop(self):
'''
Dealoc KB from memory via kb_loader.so
'''
target_path = self.getNormalizedPath(self.asset_folder, self.target)
maxitem = 33
lib = cdll.LoadLibrary(os.path.join(self.base_folder, "api","NER","figa","sources","kb_loader.so"))
lib.queryTree.restype = c_void_p
lib.queryTree.argtypes = [POINTER(POINTER(c_char_p)),c_int,c_int]
lib.freeTree(self.lines, target_path, self.items_number, maxitem);
del(self.lines)
self.lines = None
gc.collect()
def get_field(self, line, column):
"""Returns a column of a line in the knowledge base"""
#KB lines are indexed from one
return self.lines[int(line) - 1][column] if (self.items_number >= int(line)) else None
def get_row(self, line):
'''
@return - list of KB row data
'''
return self.lines[int(line) -1]
def isLoaded(self):
'''
Return True if KB is loaded into memory or False.
'''
return True if self.lines else False
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,017 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/_REST/restV1.py | '''
Pakage contains group of class for handling REST API requests.
'''
import cherrypy
from core.api._REST._v1 import FigaHandler, NERHandler, KBHandler
class RESTService():
'''
Core class for handling http request and building substructure of REST API.
'''
exposed = True
def __init__(self):
'''
Inintialize class.
@core - insgtance of main Core class
'''
#self.base_folder = core.base_folder
#self.kbmanager = core.getManager("kb")
self.kb = KBHandler()
self.figa = FigaHandler()
self.ner = NERHandler()
@cherrypy.tools.json_out()
def GET(self, *flags, **kw):
raise cherrypy.HTTPError(404)
@cherrypy.tools.json_out()
def POST(self, *flags, **kw):
raise cherrypy.HTTPError(404)
def PUT(self):
raise cherrypy.HTTPError(404)
def DELETE(self):
raise cherrypy.HTTPError(404)
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,018 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/__init__.py | '''
Created on 13. 4. 2014
@author: casey
'''
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,019 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/output.py | '''
Created on 17. 4. 2014
@author: casey
'''
import os
from core.pipeline import Pipeline
from core.loader import loadClasses
from core.annotation.generators._abstract import AbstractGenerator
class ResultGenerator(Pipeline):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
Pipeline.__init__(self)
self.generators = {}
self.loadGenerators()
def _hook(self, request):
self.generateOutput(request)
def generateOutput(self, request):
request.result = self.generators[request.tool].generate(request.ongoing_data, request.asset, request.version)
del(request.ongoing_data)
def loadGenerators(self):
classes = loadClasses(os.path.dirname(os.path.abspath(__file__))+"/generators/", AbstractGenerator, "AbstractGenerator")
for c in classes:
self.generators[c.forTool] = c()
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,020 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/generators/_abstract.py | '''
Created on 11. 5. 2014
@author: casey
'''
from core.pipeline import Pipeline
class AbstractGenerator(Pipeline):
'''
classdocs
'''
def generate(self, tool_output, asset, version):
pass | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,021 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/HTTP.py | '''
Created on 13. 4. 2014
@author: casey
'''
import cherrypy
import json
from core.annotation.annotator import AnnotationRequest
class HTTPHandler(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.json_rpc = cherrypy.engine.json_rpc
@cherrypy.expose
def default(self):
return "QQ"
@cherrypy.expose
@cherrypy.tools.json_out()
def files(self, func=None):
return self.json_rpc.callRPC(action = "getAutocompleteInitPack", version = 2, rpc_args = None)
@cherrypy.expose
@cherrypy.tools.json_out()
def jsonrpc(self):
cl = cherrypy.request.headers['Content-Length']
rawbody = cherrypy.request.body.read(int(cl))
body = json.loads(rawbody)
if body["method"] == "annotate":
request = AnnotationRequest(version=2)
request.parseRPC(body["params"])
result = self.json_rpc.callRPC(action = "annotate", version = 2, rpc_args = {"request":request})
else:
result = self.json_rpc.callRPC(action = body["method"], version = -1, rpc_args = body["params"])
resp = {"jsonrpc": "2.0", "result": result, "id": body["id"], "source":body["method"], "mods":{}}
if "offset" in body.get("mods",{}):
resp["mods"]["offset"]=body["mods"]["offset"]
return resp
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,022 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/manager.py | '''
Created on 17. 4. 2014
@author: casey
'''
import os
import cherrypy
import time
import sys
from threading import Thread, Event
from collections import deque
from core.assets.asset import Asset, AssetStates
import traceback
class AssetManager(Thread):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
Thread.__init__(self)
app = cherrypy.tree.apps['']
self.base_folder = app.config["global"]["tools.staticdir.root"]
asset_folder = app.config["assets"]["asset.folder"]
self.asset_folder = asset_folder if os.path.isabs(asset_folder) else os.path.join(self.base_folder, asset_folder)
self.asset_extension = app.config["assets"]["asset.extension"]
self.assets = {} # new !
self.assets_online = []
self.do = Event()
self.quit = Event()
self.load_qeue = deque()
def loadLocalAssets(self, folder):
assets = []
files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))]
for filename in set(files):
if os.path.splitext(filename)[1] == self.asset_extension:
try:
asset = Asset(filename, self.asset_folder)
# assets[asset.name] = asset
assets.append(asset)
except IOError, e:
print "IOerror", e
except TypeError, e:
print "Type error", e
except Exception, e:
traceback.print_tb(sys.exc_info()[2])
print "general error", e
finally:
pass
return assets
def loadSharedAssets(self):
pass
def loadAssetsForTools(self, tools):
assets = self.loadLocalAssets(self.asset_folder)
toolList = tools.keys()
for asset in assets:
isCompatible = [tools[tool].testAssetCompatibility(asset) for tool in toolList]
if not False in isCompatible:
#self.assets[asset.name] = asset
self.assets[asset.id_name] = asset
def run(self):
self.quit.clear()
self.do.clear()
while not self.quit.isSet():
if self.do.isSet():
while len(self.load_qeue) > 0:
asset, loadable = self.load_qeue.pop()
print asset.id_name
asset.changeState(AssetStates.LOADING)
for part in loadable:
part.load()
if asset.isLoaded():
asset.changeState(AssetStates.ONLINE)
self.do.clear()
time.sleep(0.1)
def stop(self):
for asset in self.assets.values():
asset.drop()
self.quit.set()
self.join()
def getAssets(self, tool = None, in_state=None):
subset = self.assets.values()
if tool is not None:
subset = [asset for asset in subset if tool in asset.tools]
if in_state in AssetStates:
subset = [asset for asset in subset if asset.state == in_state]
return subset
def getAsset(self, a_name):
'''
@a_name - name of asset
@return asset instance container or None
'''
return self.assets[a_name]
def getLoaded(self):
'''
@return - list of names of loaded KB
'''
return [k for k in self.loaded if self.kb_list[k].status == 4]
def loadAsset(self, asset_name):
if asset_name in self.assets.keys():
self.assets[asset_name].load(self.load_qeue)
self.do.set()
def dropAsset(self, asset_name):
pass
def autoload(self):
'''
Add all KB marked for autoload to load queue.
'''
for asset in self.assets.values():
asset.autoload(self.load_qeue)
self.do.set()
def loadColumsFromFile(self, filename):
column_ext_def = {"g": {"type": "image"},
"u": {"type": "url"}
}
columns = {}
columns_ext = {}
prefix_desc = {}
with open(filename, 'r') as f:
raw_colums = f.read().strip()
for row in raw_colums.split("\n"):
column = []
row_split = row.split("\t")
row_head = row_split.pop(0)
row_prefix, row_head, row_id = row_head.split(":")
prefix_desc[row_prefix] = row_head.lower()
column.append(row_id.lower())
for col_name in row_split:
prefix = ""
url = ""
if ':' in col_name:
col_split = col_name.split(":")
prefix = ":".join(col_split[:-1])
if "[" in prefix:
prefix, url = prefix.split("[")
col_name = col_split[-1]
for k in prefix:
if k in column_ext_def:
if row_prefix not in columns_ext:
columns_ext[row_prefix] = {}
columns_ext[row_prefix][col_name.lower()] = {
"type": column_ext_def[k]["type"],
"data": url[:-1]
}
if "m" in prefix:
col_name = "*" + col_name
column.append(col_name.lower())
columns[row_prefix] = column
columns["prefix_desc"] = prefix_desc
columns["columns_ext"] = columns_ext
return columns
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,023 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/_adapters/kbshared.py | # -*- coding: utf-8 -*-
'''
Created on 13. 5. 2014
@author: casey
'''
import os, re
import gc
import commands
from ctypes import cdll, POINTER, c_char_p, c_int, c_void_p
from core.assets.adapters._abstract import AbstractDynamicAdapter
from collections import OrderedDict
import logging
from core.assets.adapters._adapters.functions import loadHeaderFromFile
import ner_knowledge_base
class KBnerFakeShared(AbstractDynamicAdapter):
def __init__(self, target, base_folder, config):
super(KBnerFakeShared, self).__init__(target, base_folder, config)
self.header = OrderedDict()
self.groups = {}
self.clean_header = OrderedDict()
self.value_splitter = ""
self.lines = None
self.name_dict = {}
self.items_number = 0
self.preload_init()
def preload_init(self):
AbstractDynamicAdapter.preload_init(self)
config_header = self.config["header"]
if config_header["external_file"]:
self.header, self.groups = loadHeaderFromFile(self.getNormalizedPath(self.asset_folder, config_header["external_file"]))
elif config_header["custom"]:
self.header = {"generic":config_header["custom"]["generic"]}
self.groups = {"generic":config_header["custom"]["data"]}
if "value_splitter" in self.config:
self.value_splitter = self.config["value_splitter"].encode("utf-8") if self.config["value_splitter"] is not None else "".encode("utf-8")
for prefix, columns in self.header.iteritems():
self.clean_header[prefix] = [col.upper() if not col.startswith("*") else col[1:].upper() for col in columns]
def load(self):
'''
Load KB from file via kb_loader.so.
'''
logging.error("LOADING+++++++++ " + self.value_splitter)
target_path = self.getNormalizedPath(self.asset_folder, self.target)
count = commands.getoutput('wc -l ' + target_path + ' | cut -d" " -f1')
self.items_number = int(count)
maxitem = 33
lib = cdll.LoadLibrary( os.path.join(self.base_folder, "api","NER","figav08","figa","kb_loader.so"))
lib.queryTree.restype = POINTER(POINTER(c_char_p))
lib.queryTree.argtypes = [c_char_p,c_int,c_int]
logging.error("+++++++++++loading")
self.lines = lib.queryTree(target_path, self.items_number, maxitem);
self.initName_dict()
def drop(self):
'''
Dealocate KB from memory.
'''
target_path = self.getNormalizedPath(self.asset_folder, self.target)
maxitem = 33
lib = cdll.LoadLibrary(os.path.join(self.base_folder, "api","NER","figav08","figa","kb_loader.so"))
lib.queryTree.restype = c_void_p
lib.queryTree.argtypes = [POINTER(POINTER(c_char_p)),c_int,c_int]
lib.freeTree(self._kb.lines, target_path, self._kb.items_number, maxitem);
del(self.lines)
self.lines = None
gc.collect()
def isLoaded(self):
'''
Return True if KB is loaded into memory or False.
'''
return True if (self.lines is not None) else False
def initName_dict(self):
'''
Dictionary asociates people names with items of knowledge base.
'''
p_alias = self.get_head_col('p', "ALIAS")
p_name = self.get_head_col('p', "NAME")
a_other = self.get_head_col('a', "OTHER TERM")
a_preferred = self.get_head_col('a', "PREFERRED TERM")
a_display = self.get_head_col('a', "DISPLAY TERM")
regex_place = re.compile(" of .*")
self.name_dict = {}
line = 1
str = self.get_data_at(line, 1)
while str != None:
ent_prefix = self.get_ent_prefix(line)
# PERSON nebo ARTIST
if ent_prefix == 'p' or ent_prefix == 'a':
# PERSON
if ent_prefix == 'p':
whole_names = self.get_data_at(line, p_alias).split(self.value_splitter)
whole_names.append( self.get_data_at(line, p_name) )
# ARTIST
elif ent_prefix == 'a':
whole_names = self.get_data_at(line, a_other).split(self.value_splitter)
whole_names.append( self.get_data_at(line, a_preferred) )
whole_names.append( self.get_data_at(line, a_display) )
names = set()
for whole_name in whole_names:
whole_name = regex_place.sub("", whole_name)
divided = whole_name.split(' ')
names |= set(divided)
for name in names:
if name not in self.name_dict:
self.name_dict[name] = set([line])
else:
self.name_dict[name].add(line)
line += 1
str = self.get_data_at(line, 1)
def get_field(self, line, column):
'''
original method
'''
return self.lines[int(line) - 1][column] if (self.items_number >= int(line)) else None
def get_data_at(self, line, col):
'''
cislování řádků i sloupců od 1.
'''
return self.get_field(line, col-1)
def get_data_for(self, line, col_name):
'''
1) zjistit pozici sloupce
2) dle pozcie zavolat get_field()
'''
prefix = self.get_field(line, 0).split(":")[0]
header_line = self.clean_header[prefix]
col_position = header_line.index(col_name)
return self.get_field(line, col_position)
def get_head_at(self, line, col):
'''
Číslování řádků i sloupců od 1.
'''
key = self.clean_header.keys()[line-1]
return self.clean_header[key][col-1]
def get_head_for(self, prefix, col):
'''
Číslování sloupců od 1.
'''
return self.clean_header[prefix][col-1]
def get_head_col(self, prefix, col_name):
'''
Vrátí číslo sloupce pro požadovaný prefix a jméno sloupce.
'''
line = self.clean_header[prefix]
return line.index(col_name)+1
def get_complete_data(self, line, delim='\t'):
'''
Vrátí tuple(počet sloupců, celý řádek), kde v jednom řetězci je celý řádek pro požadovaný line, tak jak je v "KB.all".
Parametr delim umožňuje změnit oddělovač sloupců.
'''
text_line = ""
col = 1
str = self.get_data_at(line, col)
if str != None:
text_line += str
col += 1
str = self.get_data_at(line, col)
while str != None:
text_line += delim
text_line += str
col += 1
str = self.get_data_at(line, col)
return (col-1, text_line)
def get_complete_head(self, prefix, delim='\t'):
'''
Vrátí tuple(počet sloupců, celý řádek), kde v jednom řetězci je celý řádek pro požadovaný line, tak jak je v "KB.all".
Parametr delim umožňuje změnit oddělovač sloupců.
'''
text_line = ""
col = 1
str = self.get_head_for(prefix, col)
if str != None:
text_line += str
col += 1
str = self.get_head_for(prefix, col)
while str != None:
text_line += delim
text_line += str
col += 1
str = self.get_head_for(prefix, col)
return (col-1, text_line)
def get_ent_prefix(self, line):
return self.get_field(line, 0).split(":")[0]
def get_ent_type(self, line):
"""Returns a type of an entity at the line of the knowledge base"""
return self.get_data_for(line, "TYPE")
def get_dates(self, line):
ent_prefix = self.get_ent_prefix(line)
if ent_prefix == 'p' or ent_prefix == 'a': # PERSON nebo ARTIST
dates = set([self.get_data_for(line, "DATE OF BIRTH"), self.get_data_for(line, "DATE OF DEATH")])
return dates
def get_location_code(self, line):
return self.get_data_for(line, "FEATURE CODE")[0:3]
def get_nationalities(self, line):
ent_prefix = self.get_ent_prefix(line)
if ent_prefix == 'n': # NATIONALITY
nation = self.get_data_for(line, "ALIAS").split(self.value_splitter)
nation.extend(self.get_data_for(line, "ADJECTIVAL FORM").split(self.value_splitter))
nation.append(self.get_data_for(line, "NAME"))
nation.append(self.get_data_for(line, "COUNTRY NAME"))
elif ent_prefix == 'p': # PERSON
nation = self.get_data_for(line, "NATIONALITY").split(self.value_splitter)
elif ent_prefix == 'a': # ARTIST
nation = self.get_data_for(line, "OTHER NATIONALITY").split(self.value_splitter)
nation.append(self.get_data_for(line, "PREFERRED NATIONALITY"))
new_nation = []
for nat in nation:
new_nation.append(nat.lower())
nation = new_nation
nation = set(nation)
return nation
def get_score(self, line, wiki):
"""
If wiki is true, returns disambiguation score based on Wikipedia
statistics, if not score based on other metrics.
"""
result = ""
if wiki:
result = self.get_data_for(line, "SCORE WIKI")
else:
result = self.get_data_for(line, "SCORE METRICS")
try:
return int(result)
except:
err_prefix = self.get_ent_prefix(line)
if err_prefix == None:
err_head = (None, None)
err_data = (None, None)
else:
err_head = self.get_complete_head(err_prefix)
err_data = self.get_complete_data(line)
raise
def get_wiki_value(self, line, column_name):
"""
Return a link to Wikipedia or a statistc value identified
by column_name from knowledge base line.
"""
column_rename = {'backlinks':"WIKI BACKLINKS", 'hits':"WIKI HITS", 'ps':"WIKI PRIMARY SENSE"}
if column_name == 'link':
return self.get_data_for(line, "WIKIPEDIA URL")
else:
return self.get_data_for(line, column_rename[column_name])
def people_named(self, name):
split_name = name.split(' ')
result = self.name_dict.get(split_name[0], set())
for name_part in split_name:
if name_part in self.name_dict:
result &= self.name_dict[name_part]
return result
class KBnerShared(AbstractDynamicAdapter):
#kbd_dir, kbd_path, kb_path,
def __init__(self, target, base_folder, config):
super(KBnerShared, self).__init__(target, base_folder, config)
ner_knowledge_base.update_globals(os.path.join(self.base_folder,"api","SharedKB","var2"),self.getTargetPath())
self._kb = ner_knowledge_base.KnowledgeBase("kbstatsshm")
self.groups = {}
self.groupsData = {}
self.isOnline = False
self.preload_init()
def preload_init(self):
AbstractDynamicAdapter.preload_init(self)
config_header = self.config["header"]
if config_header["external_file"]:
self.header, self.groups = loadHeaderFromFile(self.getNormalizedPath(self.asset_folder, config_header["external_file"]))
elif config_header["custom"]:
self.header = {"generic":config_header["custom"]["generic"]}
self.groups = {"generic":config_header["custom"]["data"]}
if "value_splitter" in self.config:
self.value_splitter = self.config["value_splitter"].encode("utf-8") if self.config["value_splitter"] is not None else "".encode("utf-8")
def load(self):
'''
Load KB into memory.
'''
try:
self._kb.start()
self._kb.initName_dict()
self.isOnline = True
except:
self.isOnline = False
raise
def drop(self):
'''
Dealocate KB from memory.
'''
try:
self._kb.end()
self.isOnline = False
except:
self.isOnline = False
raise
def __getattr__(self, attr):
'''
Pass all method calls or variable requests to instance of NER KnowledgeBase class.
'''
attribute = getattr(self._kb, attr)
if callable(attribute):
def wrapper(*args, **kw):
return attribute(*args, **kw)
return wrapper
else:
return attribute
def isLoaded(self):
return self.isOnline
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,024 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/loader.py | '''
Created on 8. 5. 2014
@author: casey
'''
import inspect
import sys
import pkgutil
def loadClasses(mod_path, base_class, class_name_filter, skip_private_mod = True):
result = []
if not mod_path in sys.path:
sys.path.append(mod_path)
modules = pkgutil.iter_modules(path=[mod_path])
for loader, mod_name, ispkg in modules:
if skip_private_mod and mod_name.startswith("_"):
continue
__import__(mod_name)
class_name = filterClasses(mod_name, base_class, class_name_filter)
if class_name:
result.extend(class_name)
#self.tools.append(loaded_class)
return result
def filterClasses(mod_name, base, class_name_filter):
class_name_filter = class_name_filter if isinstance(class_name_filter, list) else [class_name_filter]
result = []
for name, obj in inspect.getmembers(sys.modules[mod_name], inspect.isclass):
parents = [c.__name__ for c in inspect.getmro(obj)[1:]]
if inspect.isclass(obj) and base.__name__ in parents and name not in class_name_filter:
result.append(obj)
return result
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,025 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/_REST/_v1/figa.py | # -*- coding: utf-8 -*-
'''
Created on 23. 10. 2013
@author: xjerab13
'''
import cherrypy
from core.annotation.annotator import AnnotationRequest
class FigaHandler():
'''
Figa handler server data about aviable FSA automas and parse text via figa tool.
'''
exposed = True
def __init__(self):
'''
@core - instance of main Core class
'''
self.json_rpc = cherrypy.engine.json_rpc
@cherrypy.tools.json_out()
def GET(self, *flags, **kw):
'''
On GET request return json with info about available FSA automats for use.
@return - JSON to client
'''
return self.json_rpc.callRPC(action = "getAssetList", rpc_args = {"toolType" : "figa"})
@cherrypy.tools.json_out()
def POST(self, *flags, **kw):
'''
Performin text parsing via figa tool.
'''
txt = kw.get("text")
asset_name = flags[0] if len(flags) > 0 else None
return self.json_rpc.callRPC(action = "annotate", rpc_args = {"request" : AnnotationRequest(txt, "figa", asset_name, 1)}, version = 1)
@cherrypy.tools.json_out()
def PUT(self, kbname):
'''
Unused.
'''
pass
@cherrypy.tools.json_out()
def DELETE(self, kbname):
'''
Unused
'''
pass
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,026 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/kb_old/_basic.py | import gc
import commands
import os
from ctypes import cdll, POINTER, c_char_p, c_int, c_void_p
from abstract import KnowledgeBaseAdapter
class KB_Basic(KnowledgeBaseAdapter):
'''
Simple KB container for NON NER USAGE!
'''
def __init__(self, base_folder, kb_path):
super(KB_Basic, self).__init__(base_folder, kb_path)
self.lines = None
def _load(self):
'''
Load KB from file via kb_loader.so.
'''
count = commands.getoutput('wc -l ' + self.kb_path + ' | cut -d" " -f1')
print self.kb_path, self.base_folder
self.items_number = int(count)
maxitem = 33
lib = cdll.LoadLibrary( os.path.join(self.base_folder, "api","NER","figav08","figa","kb_loader.so"))
lib.queryTree.restype = POINTER(POINTER(c_char_p))
lib.queryTree.argtypes = [c_char_p,c_int,c_int]
self.lines = lib.queryTree(self.kb_path, self.items_number, maxitem);
#time.sleep(5)
self.status = KB_Basic.LOADED
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,027 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/api/_JSONRPC/rpcV1.py | '''
Created on 24. 4. 2014
@author: casey
'''
import os
import cherrypy
from core.api._JSONRPC.protocol import AProtocol
from core.assets.asset import AssetStates
class Protocol(AProtocol):
def __init__(self, core):
super(Protocol, self).__init__(core)
self.version = 1
def RPC_getAssetList(self, toolType):
assets = self.core.assetManager.getAssets(toolType)
out = []
for asset in assets:
data = {}
data["status"] = AssetStates.OFFLINE.value-1 if asset.state != AssetStates.ONLINE else AssetStates.ONLINE.value-1
data["name"] = asset.id_name
out.append(data)
return out
def RPC_getStatus(self, toolType=None):
assets = self.core.assetManager.getAssets(toolType)
out = []
for asset in assets:
data = self.__get_stats()
data["status"] = asset.state.value -1
data["processor"] = asset.tools if len(asset.tools) > 1 else asset.tools[0]
data["name"] = asset.id_name
out.append(data)
return out
def RPC_loadAsset(self, assetName):
return self.core.assetManager.loadAsset(assetName)
def RPC_dropAsset(self, assetName):
return self.core.assetManager.dropAsset(assetName)
def RPC_listExampleFiles(self):
#folder = cherrypy.request.apps[''].config['core']['text_examples']
folder = self.core.appConfig['core']['text_examples']
files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder,f))]
cherrypy.response.headers['Content-Type'] = "application/json"
return files
def RPC_getFileContent(self, filename):
filename = os.path.basename(filename)
path = os.path.join(self.core.appConfig['core']['text_examples'],filename)
with open(path,'r') as f:
text = f.read()
return text
def RPC_annotate(self, request):
request.final_init(self.core)
self.core.annotator.annotate(request)
kb = request.asset.getPart("kb")
groups = {}
groupsData = {}
for key, data in kb.groups.iteritems():
groups[key] = data["name"]
groupsData[key] = data["dataPlus"]
return {"header":{"status":0,
"msg":"",
"processor":request.tool,
"groups": groups,
"groups_ext": groupsData,
"version":self.core.appConfig["versions"]["global"]
},
"result":request.output_data
}
def __get_stats(self):
return {
"size":-1,
"load_time":-1,
"status":0,
"processor":None
}
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,028 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/tools/tfiga.py | import subprocess, os, re
import figa.sources.marker as figa
from core.annotation.tools._abstract import AbstractTool
from core.annotation.tools.tfiga08 import SimpleEntity
from figa.autocomplete import autocomplete
class Figa(AbstractTool):
toolName = "figa"
params=["lower", "remove_accent"]
def __init__(self):
super(Figa, self).__init__()
self.require = ['asset','input_data']
self.assetPart = "fsa"
def _hook(self, request):
request.ongoing_data = self.call(request.input_data, request.asset, request.tool_params)
def call(self, input_data, asset, params, parse=True):
fsa = asset.getPart(self.assetPart)
dictionary = figa.myList()
lang_file = None
dictionary.insert(fsa.getTargetPath().encode("utf-8"))
seek_names = figa.marker(dictionary, lang_file, False, params["overlapping"], params["boundary"])
output = seek_names.lookup_string(input_data.encode("utf-8"))
if parse:
return self.parse(output)
else:
return output
def call_raw(self, input_data, asset_path):
dictionary = figa.myList()
lang_file = None
dictionary.insert(asset_path.encode("utf-8"))
seek_names = figa.marker(dictionary, lang_file, False, False, False)
output = seek_names.lookup_string(input_data.encode("utf-8"))
return output
def autocomplete(self, input_data,automat, lines):
#input_data=remove_accent(input_data.lower())
dictionary = figa.myList()
lang_file = None
return_all = True if len(input_data.strip()) >= 3 else False
dictionary.insert(automat.encode("utf-8"))
output = autocomplete(dictionary, input_data, 10, True, True, lang_file, return_all)
#seek_names = figa.marker(dictionary, lang_file)
#output = seek_names.auto_lookup_string(input_data.encode("utf-8"), lines)
return self.parseAutocomplete(output)
def parse(self, output):
entities = []
for line in output.split("\n")[:-1]:
se = SimpleEntity(line)
if se.preferred_sense is not None:
entities.append(se)
if len(entities) > 0:
new_entities = [entities[0]]
for ent in entities:
if ent.mutual_position(new_entities[-1].begin,
new_entities[-1].end_offset) != 0:
new_entities.append(ent)
else:
pass
entities = new_entities
return entities
def parseAutocomplete(self, output):
entities = set([])
for line in output.split("\n")[:-1]:
#se = AutocompleteEntity(line)
entities.update([int(a) for a in line.split('\t')[1].split(';')])
#if se.preferred_sense is not None:
# entities.append(se)
return entities
class AutocompleteEntity:
def __init__(self, entity_str):
entity_attributes = entity_str.split('\t')
self.senses = []
for sense in entity_attributes[1].split(';'):
#sense 0 marks a coreference
if sense != '0':
self.senses.append(int(sense))
self.source = entity_attributes[0]
#convert utf codes
self.source = re.sub("&#x([A-F0-9]{2});","\\x\g<1>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>\\x\g<5>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>\\x\g<5>\\x\g<6>", self.source)
self.source = eval("\"" + self.source + "\"")
self.preferred_sense = self.senses[0] if len(self.senses)> 0 else None | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,029 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/factory.py | '''
Created on 9. 5. 2014
@author: casey
'''
import os
from core.loader import loadClasses
from core.assets.adapters._abstract import AbstractAdapter
class AdapterFactory(object):
adapters = {}
@classmethod
def make(cls, base_folder, config):
path = config["target"]
adapter = config["adapter"]
adapter_configuration = config["adapter_configuration"]
if adapter in cls.adapters:
return cls.adapters[adapter](path, base_folder, adapter_configuration)
else:
raise AttributeError("Asset adapter not found: " + adapter)
@classmethod
def loadAdapters(cls):
classes = loadClasses(os.path.dirname(os.path.abspath(__file__))+"/_adapters",
AbstractAdapter, ["AbstractAdapter", "AbstractStaticAdapter", "AbstractDynamicAdapter"], False)
for c in classes:
cls.adapters[c.__name__] = c | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,030 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/tools/tfiga08.py | import re
#import figa.sources.marker as figa
try:
import figav08.figa.marker as figa
except:
pass
from core.annotation.tools._abstract import AbstractTool
class Figa08(AbstractTool):
toolName = "figa08"
def __init__(self):
super(Figa08, self).__init__()
self.require = ['asset','input_data']
self.assetPart = "fsa"
def _hook(self, request):
request.ongoing_data = self.call(request.input_data, request.asset)
def call(self, input_data, asset):
fsa = asset.getPart(self.assetPart)
dictionary = figa.myList()
lang_file = None
dictionary.insert(fsa.getTargetPath().encode("utf-8"))
seek_names = figa.marker(dictionary, lang_file)
output = seek_names.lookup_string(input_data.encode("utf-8"))
return self.parse(output)
def parse(self, output):
entities = []
for line in output.split("\n")[:-1]:
se = SimpleEntity(line)
if se.preferred_sense is not None:
entities.append(se)
if len(entities) > 0:
new_entities = [entities[0]]
for ent in entities:
if ent.mutual_position(new_entities[-1].begin,
new_entities[-1].end) != 0:
new_entities.append(ent)
else:
pass
entities = new_entities
return entities
class SimpleEntity():
"""A text entity refering to a knowledge base item."""
def __init__(self, entity_str):
"""
Create an entity by parsing a line of figa output from entity_str.
Entity will be referring to an item of an knowledge base object kb.
"""
entity_attributes = entity_str.split('\t')
self.senses = []
for sense in entity_attributes[0].split(';'):
#sense 0 marks a coreference
if sense != '0':
self.senses.append(int(sense))
#start offset is indexed differntly from figa
self.begin = int(entity_attributes[1]) - 1
self.start_offset = self.begin
self.end_offset = int(entity_attributes[2])
self.source = entity_attributes[3]
#convert utf codes
self.source = re.sub("&#x([A-F0-9]{2});","\\x\g<1>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>\\x\g<5>", self.source)
self.source = re.sub("&#x([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2});","\\x\g<1>\\x\g<2>\\x\g<3>\\x\g<4>\\x\g<5>\\x\g<6>", self.source)
self.source = eval("\"" + self.source + "\"")
self.preferred_sense = self.senses[0] if len(self.senses)> 0 else None
def mutual_position (self, begin_offset, end_offset):
"""
Evaluates mutual position in a source text of self and a entity starting
at begin_offset and ending at end_offset. If self stands entirely before
the other entity returns -1. If entities overlap, returns 0. If self
stands entirely after the other entity, returns 1.
"""
if int(self.end_offset) < int(begin_offset):
return -1
elif int(self.begin) > int(end_offset):
return 1
else:
return 0
def is_coreference(self):
return False
def get_preferred_sense(self):
return self.senses[0] | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,031 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/assets/adapters/_adapters/generic.py | '''
Created on 9. 5. 2014
@author: casey
'''
from core.assets.adapters._abstract import AbstractStaticAdapter
class GenericAsset(AbstractStaticAdapter):
def __init__(self, target, base_folder, config):
super(GenericAsset, self).__init__(target, base_folder, config)
| {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,032 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/chain.py | '''
Created on 1. 5. 2014
@author: casey
'''
class ChainItem(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.nextChainItem = None
def registerNextChainItem(self, item):
self.nextChainItem = item
def process(self):
"""Wrapper around the internal _hook method"""
def _hook(self):
"""Default hook method to be overridden in subclasses"""
class ChainTerminator(ChainItem):
def process(self, **kwargs):
return self._hook()
def _hook(self):
return None
class ChainOfResponsibility(object):
@classmethod
def generate(cls, chainList, endClass, chainParams):
firstItem = endClass()
for chainItem in chainList:
newChain = chainItem(**chainParams) if chainParams else chainItem()
newChain.registerNextChainItem(firstItem)
firstItem = newChain
return firstItem | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,033 | KNOT-FIT-BUT/webapi-server | refs/heads/master | /core/annotation/filters/_abstract.py | '''
Created on 12. 5. 2014
@author: casey
'''
from core.pipeline import Pipeline
class AbstractFilter(Pipeline):
'''
classdocs
'''
def filter(self):
pass | {"/core/api/_JSONRPC/protocol.py": ["/core/chain.py"], "/core/api/_REST/_v1/hner.py": ["/core/annotation/annotator.py"], "/core/annotation/tools/tner.py": ["/core/annotation/tools/_abstract.py"], "/core/annotation/tools/_abstract.py": ["/core/pipeline.py"], "/core/annotation/filters/inputFilters.py": ["/core/annotation/filters/_abstract.py"], "/core/annotation/generators/gFigaNer.py": ["/core/annotation/generators/_abstract.py"], "/core/api/JSONRPC.py": ["/core/loader.py", "/core/api/_JSONRPC/protocol.py", "/core/chain.py"], "/core/assets/adapters/_adapters/kblocal.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/restV1.py": ["/core/api/_REST/_v1/__init__.py"], "/core/annotation/output.py": ["/core/pipeline.py", "/core/loader.py", "/core/annotation/generators/_abstract.py"], "/core/annotation/generators/_abstract.py": ["/core/pipeline.py"], "/core/api/HTTP.py": ["/core/annotation/annotator.py"], "/core/assets/adapters/_adapters/kbshared.py": ["/core/assets/adapters/_abstract.py", "/core/assets/adapters/_adapters/functions.py"], "/core/api/_REST/_v1/figa.py": ["/core/annotation/annotator.py"], "/core/api/_JSONRPC/rpcV1.py": ["/core/api/_JSONRPC/protocol.py", "/core/assets/asset.py"], "/core/annotation/tools/tfiga.py": ["/core/annotation/tools/_abstract.py", "/core/annotation/tools/tfiga08.py"], "/core/assets/adapters/factory.py": ["/core/loader.py", "/core/assets/adapters/_abstract.py"], "/core/annotation/tools/tfiga08.py": ["/core/annotation/tools/_abstract.py"], "/core/assets/adapters/_adapters/generic.py": ["/core/assets/adapters/_abstract.py"], "/core/annotation/filters/_abstract.py": ["/core/pipeline.py"]} |
49,037 | Kirito0918/seq2seq-tf2 | refs/heads/master | /module/model.py | import tensorflow as tf
import tensorflow.keras as keras
from Embedding import Embedding
from Encoder import Encoder
from Decoder import Decoder
class Seq2seq(keras.Model):
def __init__(self, config, embeds=None):
super(Seq2seq, self).__init__()
self.config = config
self.embedding = Embedding(config.num_vocab, config.embedding_size, weights=embeds)
self.encoder = Encoder(config.ende_rnn_type,
config.embedding_size,
config.ende_output_size,
config.ende_num_layers,
config.encoder_bidirectional)
self.decoder = Decoder(config.ende_rnn_type,
config.embedding_size,
config.ende_output_size,
config.ende_num_layers)
self.projector = keras.layers.Dense(config.num_vocab, input_shape=(None, None, config.ende_output_size))
self.softmax = keras.layers.Softmax(-1)
def __call__(self, input, inference=False, max_len=60):
if not inference: # 训练
posts = input['posts'] # [batch, len_encoder]
responses = input['responses'] # [batch, len_decoder+1]
decoder_len = tf.shape(responses)[1] - 1 # [batch, len_decoder]
encoder_input = self.embedding(posts) # [batch, len_encoder, embedding_size]
decoder_input = self.embedding(responses)[:, :-1, :] # [batch, len_decoder, embedding_size]
# encoder_states: [num_layers] * tensor(batch, output_size)
_, encoder_states = self.encoder(encoder_input)
ta = tf.TensorArray(size=0, dtype=tf.int64, dynamic_size=True)
decoder_input = ta.unstack(tf.transpose(decoder_input, [1, 0, 2])) # decoder_len * [batch, embedding_size]
outputs = []
for timestep in range(decoder_len):
if timestep == 0:
states = encoder_states
# output: [batch, 1, dim]
output, states = self.decoder(tf.expand_dims(decoder_input.read(timestep), 1), states)
outputs.append(output)
outputs = tf.concat(outputs, 1) # [batch, len_decoder, dim]
outputs_prob = self.projector(outputs) # [batch, len_decoder, num_vocab]
outputs_prob = self.softmax(outputs_prob)
return outputs_prob
else: # 测试
posts = input['posts'] # [batch, len_encoder]
batch_size = tf.shape(posts)[0]
encoder_input = self.embedding(posts) # [batch, len_encoder, embedding_size]
# encoder_states: [num_layers] * tensor(batch, output_size)
_, encoder_states = self.encoder(encoder_input)
outputs = []
done = tf.cast(tf.zeros([batch_size], dtype=tf.int32), dtype=tf.bool)
first_input = self.embedding( # [batch, 1, embedding_size]
tf.expand_dims(tf.ones([batch_size], dtype=tf.int32) * self.config.start_id, 1))
for timestep in range(max_len):
if timestep == 0:
states = encoder_states
decoder_input = first_input # [batch, embedding_size]
# output: [batch, 1, dim]
output, states = self.decoder(decoder_input, states)
outputs.append(output) # [batch, 1, dim]
output_prob = self.projector(output) # [batch, 1, num_vocab]
output_prob = self.softmax(output_prob) # [batch, 1, num_vocab]
next_input_id = tf.reshape(tf.argmax(output_prob, 2), [-1]) # [batch]
_done = next_input_id == self.config.end_id
done = done | _done
if tf.reduce_sum(tf.cast(done, dtype=tf.int32)) == batch_size:
break
else:
decoder_input = self.embedding(tf.expand_dims(next_input_id, 1)) # [batch, 1, embedding_size]
outputs = tf.concat(outputs, 1) # [batch, len_decoder, dim]
outputs_prob = self.projector(outputs) # [batch, len_decoder, num_vocab]
outputs_prob = self.softmax(outputs_prob)
return outputs_prob
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,038 | Kirito0918/seq2seq-tf2 | refs/heads/master | /module/Embedding.py | import tensorflow.keras as keras
class Embedding(keras.layers.Layer):
def __init__(self, input_size,
output_size,
weights=None):
super(Embedding, self).__init__()
if weights is not None:
self.embedding = keras.layers.Embedding(input_size, output_size,
embeddings_initializer=keras.initializers.constant(weights),
mask_zero=True)
else:
self.embedding = keras.layers.Embedding(input_size, output_size, mask_zero=True)
def __call__(self, input): # [batch, len]
return self.embedding(input) # [batch, len, output_size]
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,039 | Kirito0918/seq2seq-tf2 | refs/heads/master | /module/config.py |
class Config(object):
# 其他参数
pad_id = 0
start_id = 1
end_id = 2
unk_id = 3
# 嵌入层参数
num_vocab = 39000
embedding_size = 300
# 编解码器参数
ende_rnn_type = 'LSTM'
ende_num_layers = 2
ende_output_size = 300
encoder_bidirectional = True
batch_size = 32
lr = 0.0001
gradients_clip_norm = 5
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,040 | Kirito0918/seq2seq-tf2 | refs/heads/master | /module/Encoder.py | import tensorflow as tf
import tensorflow.keras as keras
class Encoder(keras.layers.Layer):
def __init__(self, rnn_type, # rnn类型
input_size,
output_size,
num_layers, # rnn层数
bidirectional=False):
super(Encoder, self).__init__()
assert rnn_type in ['GRU', 'LSTM']
if bidirectional:
assert output_size % 2 == 0
if bidirectional:
self.num_directions = 2
else:
self.num_directions = 1
units = int(output_size / self.num_directions)
if rnn_type == 'GRU':
rnnCell = [getattr(keras.layers, 'GRUCell')(units) for _ in range(num_layers)]
else:
rnnCell = [getattr(keras.layers, 'LSTMCell')(units) for _ in range(num_layers)]
self.rnn = keras.layers.RNN(rnnCell, input_shape=(None, None, input_size),
return_sequences=True, return_state=True)
self.rnn_type = rnn_type
self.num_layers = num_layers
if bidirectional:
self.rnn = keras.layers.Bidirectional(self.rnn, merge_mode='concat')
self.bidirectional = bidirectional
def __call__(self, input): # [batch, timesteps, input_dim]
outputs = self.rnn(input)
output = outputs[0]
states = outputs[1:]
states_forward = states[: self.num_layers]
states_backward = states[self.num_layers:]
if self.bidirectional:
states = []
if self.rnn_type == 'LSTM':
for idx in range(self.num_layers):
state_hf, state_cf = states_forward[idx]
state_hb, state_cb = states_backward[idx]
state_h = tf.concat([state_hf, state_hb], 1)
state_c = tf.concat([state_cf, state_cb], 1)
state = [state_h, state_c]
states.append(state)
else: # 'GRU'
for idx in range(self.num_layers):
state_hf = states_forward[idx]
state_hb = states_backward[idx]
state = tf.concat([state_hf, state_hb], 1)
states.append(state)
# output: [batch_size, encoder_len, output_size]
# states: [num_layers] * tensor(batch, output_size)
return output, states
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,041 | Kirito0918/seq2seq-tf2 | refs/heads/master | /seq2seq.py | from module.config import Config
from module.model import Seq2seq
import tensorflow as tf
from module.utils.sentence_processor import SentenceProcessor
from module.utils.data_processor import DataProcessor
import json
import argparse
import os
import time
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--trainset_path', dest='trainset_path', default='data/raw/trainset_cut300000.txt', type=str, help='训练集位置')
parser.add_argument('--validset_path', dest='validset_path', default='data/raw/validset.txt', type=str, help='验证集位置')
parser.add_argument('--testset_path', dest='testset_path', default='data/raw/testset.txt', type=str, help='测试集位置')
parser.add_argument('--embed_path', dest='embed_path', default='data/embed.txt', type=str, help='词向量位置')
parser.add_argument('--result_path', dest='result_path', default='result', type=str, help='测试结果位置')
parser.add_argument('--print_per_step', dest='print_per_step', default=100, type=int, help='每更新多少次参数summary学习情况')
parser.add_argument('--log_per_step', dest='log_per_step', default=20000, type=int, help='每更新多少次参数保存模型')
parser.add_argument('--log_path', dest='log_path', default='log', type=str, help='记录模型位置')
parser.add_argument('--inference', dest='inference', default=False, type=bool, help='是否测试') #
parser.add_argument('--max_len', dest='max_len', default=60, type=int, help='测试时最大解码步数')
parser.add_argument('--model_path', dest='model_path', default='log//', type=str, help='载入模型位置') #
parser.add_argument('--max_epoch', dest='max_epoch', default=60, type=int, help='最大训练epoch')
args = parser.parse_args() # 程序运行参数
config = Config() # 模型配置
def main():
# 载入数据集
trainset, validset, testset = [], [], []
if args.inference: # 测试时只载入测试集
with open(args.testset_path, 'r', encoding='utf8') as fr:
for line in fr:
testset.append(json.loads(line))
print('载入测试集%d条' % len(testset))
else: # 训练时载入训练集和验证集
with open(args.trainset_path, 'r', encoding='utf8') as fr:
for line in fr:
trainset.append(json.loads(line))
print('载入训练集%d条' % len(trainset))
with open(args.validset_path, 'r', encoding='utf8') as fr:
for line in fr:
validset.append(json.loads(line))
print('载入验证集%d条' % len(validset))
# 载入词汇表,词向量
vocab, embeds = [], []
with open(args.embed_path, 'r', encoding='utf8') as fr:
for line in fr:
line = line.strip()
word = line[: line.find(' ')]
vec = line[line.find(' ') + 1:].split()
embed = [float(v) for v in vec]
assert len(embed) == config.embedding_size # 检测词向量维度
vocab.append(word)
embeds.append(embed)
print('载入词汇表: %d个' % len(vocab))
print('词向量维度: %d' % config.embedding_size)
# 通过词汇表构建一个word2index和index2word的工具
sentence_processor = SentenceProcessor(vocab, config.pad_id, config.start_id, config.end_id, config.unk_id)
model = Seq2seq(config, np.array(embeds))
global_step = 0
# 载入模型
if os.path.isfile(args.model_path):
model.load_weights(args.model_path)
print('载入模型完成')
log_dir, model_file = os.path.split(args.model_path)
global_step = int(model_file[5: model_file.find('.')])
elif args.inference:
print('请载入一个模型进行测试')
return
else:
print('初始化模型完成')
log_dir = os.path.join(args.log_path, 'run%d' % int(time.time()))
if not os.path.exists(args.log_path):
os.makedirs(args.log_path)
# 创建优化器
optimizer = tf.optimizers.Adam(config.lr)
# 训练
if not args.inference:
dp_train = DataProcessor(trainset, config.batch_size, sentence_processor)
dp_valid = DataProcessor(validset, config.batch_size, sentence_processor, shuffle=False)
summary_writer = tf.summary.create_file_writer(log_dir)
for epoch in range(args.max_epoch):
for data in dp_train.get_batch_data():
start_time = time.time()
loss, ppl = train(model, data, optimizer)
use_time = time.time() - start_time
if global_step % args.print_per_step == 0:
print('global_step: %d, loss: %g, ppl: %g, time: %gs'
% (global_step, loss, ppl, use_time))
with summary_writer.as_default():
tf.summary.scalar('train_loss', loss, global_step)
tf.summary.scalar('train_ppl', ppl, global_step)
summary_writer.flush()
global_step += 1
if global_step % args.log_per_step == 0:
log_file = os.path.join(log_dir, 'model%012d.ckpt' % global_step)
model.save_weights(log_file)
ppls = []
for valid_data in dp_valid.get_batch_data():
ppl = valid(model, valid_data)
ppls.extend(ppl)
avg_ppl = np.exp(np.array(ppls).mean())
print('验证集上的困惑度: %g' % avg_ppl)
with summary_writer.as_default():
tf.summary.scalar('valid_ppl', avg_ppl, global_step)
summary_writer.flush()
log_file = os.path.join(log_dir, 'model%012d.ckpt' % global_step)
model.save_weights(log_file)
ppls = []
for valid_data in dp_valid.get_batch_data():
ppl = valid(model, valid_data)
ppls.extend(ppl)
avg_ppl = np.exp(np.array(ppls).mean())
print('验证集上的困惑度: %g' % avg_ppl)
with summary_writer.as_default():
tf.summary.scalar('valid_ppl', avg_ppl, global_step)
summary_writer.flush()
else: # 测试
dp_test = DataProcessor(testset, config.batch_size, sentence_processor, shuffle=False)
ppls = []
for test_data in dp_test.get_batch_data():
ppl = valid(model, test_data)
ppls.extend(ppl)
avg_ppl = np.exp(np.array(ppls).mean())
print('测试集上的困惑度: %g' % avg_ppl)
result_dir = args.result_path
if not os.path.exists(result_dir):
os.makedirs(result_dir)
result_file = os.path.join(result_dir, model_file + '.txt')
fw = open(result_file, 'w', encoding='utf8')
for test_data in dp_test.get_batch_data():
str_posts = test_data['str_posts']
str_responses = test_data['str_responses']
feed_input = {'posts': tf.convert_to_tensor(test_data['posts'], dtype=tf.int32)}
outputs_prob = model(feed_input, inference=True, max_len=args.max_len) # [batch, len_decoder, num_vocab]
outputs_id = tf.argmax(outputs_prob, 2).numpy().tolist() # [batch, len_decoder]
for idx, result in enumerate(outputs_id):
data = {}
data['post'] = str_posts[idx]
data['response'] = str_responses[idx]
data['result'] = sentence_processor.index2word(result)
fw.write(json.dumps(data) + '\n')
fw.close()
def comput_losses(logits, # [batch, len_decoder, num_vocab]
labels, # [batch, len_decoder]
masks): # [batch, len_decoder]
len_decoder = tf.shape(logits)[1]
len_masks = 1.0 * tf.reduce_sum(masks, 1) # [batch]
len_masks = tf.clip_by_value(len_masks, 1e-12, tf.cast(len_decoder, dtype=tf.float32)) # 防止长度为0
logits = tf.reshape(logits, [-1, tf.shape(logits)[2]]) # [batch*len_decoder, num_vocab]
logits = tf.clip_by_value(logits, 1e-12, 1.0) # 防止log0
labels = tf.reshape(labels, [-1]) # [batch*len_decoder]
masks = tf.reshape(masks, [-1]) # [batch*len_decoder]
losses = tf.keras.losses.sparse_categorical_crossentropy(y_pred=logits, y_true=labels) # [batch*len_decoder]
losses = losses * masks # [batch*len_decoder]
losses = tf.reshape(losses, [-1, len_decoder]) # [batch, len_decoder]
losses = tf.reduce_sum(losses, 1) # [batch]每个样本的损失
ppls = losses / len_masks # [batch]
return losses, ppls
def train(model, data, optimizer):
# 输入
feed_input = {'posts': tf.convert_to_tensor(data['posts'], dtype=tf.int32),
'responses': tf.convert_to_tensor(data['responses'], dtype=tf.int32)}
# 标签
labels = tf.convert_to_tensor(data['responses'], dtype=tf.int32)[:, 1:] # [batch, len_decoder] 去掉start_id
# mask
len_responses = tf.convert_to_tensor(data['len_responses'], dtype=tf.int32)
len_labels = len_responses - 1
id_masks = len_labels - 1
masks = tf.cumsum(tf.one_hot(id_masks, tf.reduce_max(id_masks) + 1), 1, reverse=True)
with tf.GradientTape() as tape:
outputs_prob = model(feed_input)
losses, ppls = comput_losses(outputs_prob, labels, masks)
trainable_variables = model.trainable_variables
gradients = tape.gradient(losses, trainable_variables)
clipped_gradients, _ = tf.clip_by_global_norm(gradients, config.gradients_clip_norm)
optimizer.apply_gradients(zip(clipped_gradients, trainable_variables))
return tf.reduce_mean(losses).numpy(), tf.exp(tf.reduce_mean(ppls)).numpy()
def valid(model, data):
# 输入
feed_input = {'posts': tf.convert_to_tensor(data['posts'], dtype=tf.int32),
'responses': tf.convert_to_tensor(data['responses'], dtype=tf.int32)}
# 标签
labels = tf.convert_to_tensor(data['responses'], dtype=tf.int32)[:, 1:] # [batch, len_decoder] 去掉start_id
# mask
len_responses = tf.convert_to_tensor(data['len_responses'], dtype=tf.int32)
len_labels = len_responses - 1
id_masks = len_labels - 1
masks = tf.cumsum(tf.one_hot(id_masks, tf.reduce_max(id_masks) + 1), 1, reverse=True)
outputs_prob = model(feed_input)
_, ppls = comput_losses(outputs_prob, labels, masks)
return ppls.numpy().tolist() # [batch]
if __name__ == '__main__':
main()
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,042 | Kirito0918/seq2seq-tf2 | refs/heads/master | /module/Decoder.py | import tensorflow.keras as keras
class Decoder(keras.layers.Layer):
def __init__(self, rnn_type,
input_size,
output_size,
num_layers):
super(Decoder, self).__init__()
assert rnn_type in ['GRU', 'LSTM']
if rnn_type == 'GRU':
rnnCell = [getattr(keras.layers, 'GRUCell')(output_size) for _ in range(num_layers)]
else:
rnnCell = [getattr(keras.layers, 'LSTMCell')(output_size) for _ in range(num_layers)]
self.rnn = keras.layers.RNN(rnnCell, input_shape=(None, None, input_size),
return_sequences=True, return_state=True)
self.rnn_type = rnn_type
self.num_layers = num_layers
def __call__(self, input, states): # input: [batch, 1, input_size]
outputs = self.rnn(input, states)
# output: [batch, 1, output_size]
return outputs[0], outputs[1:]
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,043 | Kirito0918/seq2seq-tf2 | refs/heads/master | /test.py | import tensorflow as tf
import numpy as np
from module.Embedding import Embedding
from module.Encoder import Encoder
tf.random.set_seed(0)
# from tensorflow.python.ops import control_flow_util
# control_flow_util.ENABLE_CONTROL_FLOW_V2 = True
# num_vocab = 3
# embedding_size = 5
# batch_size = 2
# seq = 3
# lstm_units = 10
# num_layers = 2
# bidirectional = True
# 嵌入层测试
# weights = [np.array([[1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7]], dtype=np.float64)]
# embedding = Embedding(3, 5, weights) # (num_vocab, embedding_size)
#
# word_id = tf.convert_to_tensor([[1, 2, 0], [1, 0, 0]], dtype=tf.int64)
# word_embed = embedding(word_id) # [batch, seq, embedding_size]
# print(word_embed) # [2, 3, 5]
# 编码器测试
# encoder = Encoder('LSTM', 5, 10, 1, True)
#
# output, states = encoder(word_embed)
#
# print('output:', output)
# print('states:', states)
# TensorArray测试
# ta = tf.TensorArray(size=0, dtype=tf.int64, dynamic_size=True)
# ta = ta.unstack(word_id)
# print(ta)
done = tf.cast(tf.zeros([5]), tf.bool)
print(done)
_done = tf.convert_to_tensor([4, 3, 9, 10, 3], dtype=tf.int32) == 3
print(_done)
done = done | _done
print(done)
for i in range(tf.reduce_sum(tf.cast(done, dtype=tf.int32))):
print(1)
print(tf.ones([10]))
| {"/seq2seq.py": ["/module/config.py", "/module/model.py"], "/test.py": ["/module/Embedding.py", "/module/Encoder.py"]} |
49,055 | xcellent-dev/Python-ExportCSV | refs/heads/master | /datainput/admin.py | from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
# Register your models here.
| {"/datainput/views.py": ["/datainput/forms.py"]} |
49,056 | xcellent-dev/Python-ExportCSV | refs/heads/master | /datainput/views.py | from django.shortcuts import render
from django.views.generic import TemplateView
from datainput.forms import UserInputData
import csv
from csv import writer
import random
import string
# Create your views here.
class HomeView(TemplateView):
template_name = 'datainput/forminput.html'
def get(self, request):
form = UserInputData()
return render(request, self.template_name, {'form':form})
def post(self, request):
form = UserInputData(request.POST)
if form.is_valid():
firstPara = form.cleaned_data['stringLength']
secondPara = form.cleaned_data['density']
thridPara = form.cleaned_data['total_words']
fourthPara = form.cleaned_data['main_keyword']
fifthPara = form.cleaned_data['supporting_words']
sixthPara = form.cleaned_data['supporting_density']
seventhPara = form.cleaned_data['p_tags']
# firstPara = 8
# secondPara = 5
# thridPara = 1300
# fourthPara = "peluqueria burlada, peluqueria burgos, peluqueria toledo, peluqueria santander, peluqueria leon, peluqueria albacete, peluqueria terrassa, peluqueria ciudad real, peluqueria pamplona, peluqueria palencia, peluqueria estepona, peluqueria girona, peluqueria caceres, peluquería madrid, peluqueria logroño"
fourthPara_list = list(fourthPara.split(","))
#fifthPara = "corte,mujer,lavado,centro,peluquería,hombre,mapa,pelo,mostrar,tratamientos,peinado"
fifthPara_list = list(fifthPara.split(","))
# sixthPara = 0.3
# seventhPara = 11
filename="experimento_chorriclub"
for e in range(10):
keywords = fourthPara_list
self.append_list_as_row(filename+str(e)+".csv",["title","body","keyword", "fake_key","random_sent"])
for keyword in keywords:
result= self.random_page(secondPara, thridPara, keyword, fifthPara_list, sixthPara, seventhPara)
self.append_list_as_row(filename+str(e)+".csv",result)
text = str(firstPara) + ' ' + str(secondPara) +' ' +str(thridPara) + ' ' + str(fourthPara)+ ' ' + str(fifthPara)+ ' ' + str(sixthPara)+ ' ' + str(seventhPara)
with open('datainput/DataInput.csv', "a") as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=form.cleaned_data.keys())
writer.writerow(form.cleaned_data)
form = UserInputData()
args = {'form': form, 'text': text}
return render(request, self.template_name, args)
def randomString2(self, stringLength=8):
letters = string.ascii_lowercase
return ''.join(random.sample(letters, stringLength))
def random_page(self, density, total_words, main_keyword, supporting_words, supporting_density ,p_tags):
number_keywords = total_words * density/100
print("exact keyword", number_keywords)
sup_total = supporting_density * int(len(supporting_words))
print("sup total", sup_total)
number_support = total_words * sup_total/100
print("total support", number_support)
total_words_fake =total_words - number_keywords - number_support
print("total fake",total_words_fake)
final_text = []
for i in range(int(total_words_fake)):
final_text.append(self.randomString2(8))
#print(" ".join(final_text))
print("len total", len(final_text))
for ii in range(int(len(supporting_words))):
for i in range(int(number_support)//len(supporting_words)):
final_text.append(str(supporting_words[ii]))
print("len total", len(final_text))
for i in range(int(number_keywords)):
final_text.append(main_keyword)
print("len total", len(final_text))
min_lenght_sentence = 4
max_lenght_sentence = 10
import random
final_randomized_text = random.sample(final_text, len(final_text))
print(len(final_randomized_text))
print(len(final_text))
#print(" ".join(final_randomized_text))
starting_number = int(random.randint(min_lenght_sentence,max_lenght_sentence))
print(starting_number)
dots_position = []
#print(total_words)
while starting_number<total_words+len(dots_position)+1:
random_numb = int(random.randint(4,8))
starting_number+=random_numb+1
#print(starting_number)
dots_position.append(starting_number)
capitalize_first = []
for i in dots_position:
capitalize_first.append(i+1)
final_randomized_text.insert(i, '.')
#print(capitalize_first)
capitalize_first = capitalize_first[:1]
print(len(final_randomized_text))
final_text = " ".join(final_randomized_text)
#print(final_text)
from nltk.tokenize import sent_tokenize
sentences = sent_tokenize(final_text)
new_capitalized=[]
for i in sentences:
i = i.split(" ")
i[0]=i[0].capitalize()
new_capitalized.append(" ".join(i))
#print(new_capitalized)
#print(" ".join(new_capitalized))
text_capitalized = " ".join(new_capitalized)
text_capitalized = text_capitalized.replace(" .", ".")
#print(text_capitalized)
print("palabras totales",len(text_capitalized.split(" ")))
text_sent = sent_tokenize(text_capitalized)
#print(text_sent)
len_sent= len(text_sent)
n = len_sent//p_tags
print("n", n)
z = 0
y = 0
html_random=[]
tags_position=[]
while z<len_sent:
z+=n
if z > len_sent:
z=len_sent
tags_position.append(z)
print(len_sent,tags_position)
x = 0
for i in tags_position:
html_random.append("<p>")
html_random.append(str("".join(text_sent[x:i])))
html_random.append("</p>")
x=i
print("este es el final")
final_output = "".join(html_random)
final_output = final_output.replace(".", ". ")
#print(final_output)
title = []
for i in range(5):
title.append(self.randomString2(8).capitalize())
title = " ".join(title)
fake_key= self.randomString2(8)
random_sent=[]
for i in range(8):
random_sent.append(self.randomString2(8))
random_sent=" ".join(random_sent)
return title,final_output, main_keyword,fake_key, random_sent
def append_list_as_row(self, file_name, list_of_elem):
# Open file in append mode
with open(file_name, 'a+', newline='', encoding="utf-8") as write_obj:
# Create a writer object from csv module
csv_writer = writer(write_obj)
# Add contents of list as last row in the csv file
csv_writer.writerow(list_of_elem) | {"/datainput/views.py": ["/datainput/forms.py"]} |
49,057 | xcellent-dev/Python-ExportCSV | refs/heads/master | /datainput/forms.py | from django import forms
class UserInputData(forms.Form):
stringLength = forms.IntegerField()
density = forms.FloatField()
total_words = forms.IntegerField()
main_keyword = forms.CharField(widget=forms.Textarea)
supporting_words = forms.CharField(widget=forms.Textarea)
supporting_density = forms.FloatField()
p_tags = forms.IntegerField()
| {"/datainput/views.py": ["/datainput/forms.py"]} |
49,058 | xcellent-dev/Python-ExportCSV | refs/heads/master | /datainput/apps.py | from django.apps import AppConfig
class DatainputConfig(AppConfig):
name = 'datainput'
| {"/datainput/views.py": ["/datainput/forms.py"]} |
49,063 | chenyuan2561/bwstudent | refs/heads/master | /models.py | from dbs import db
class Student(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True) # 学号
name = db.Column(db.String(20)) # 姓名
english = db.Column(db.Integer, default=0) # 英语成绩
python = db.Column(db.Integer, default=0) # python成绩
c = db.Column(db.Integer, default=0) # c成绩
score = db.Column(db.Integer, default=0) # 总成绩
def __repr__(self):
return '<student id:%s name:%s english:%s python:%s c:%s score:%s>'%(self.id, self.name, self.english, self.python,self.c,self.score) | {"/manage.py": ["/app.py", "/models.py"], "/app.py": ["/models.py", "/config.py"]} |
49,064 | chenyuan2561/bwstudent | refs/heads/master | /manage.py | from flask_script import Manager
from app import app
from flask_migrate import Migrate,MigrateCommand
from dbs import db
from models import *
manager = Manager(app)
# init migrate upgrade
# 模型 -> 迁移文件 -> 表
# 1.要使用flask_migrate,必须绑定app和DB
migrate = Migrate(app, db)
# 2.把migrateCommand命令添加到manager中。
manager.add_command('db',MigrateCommand)
if __name__ =='__main__':
manager.run()
# python manage.py db init
# python manage.py db migrate
# python manage.py db upgrade | {"/manage.py": ["/app.py", "/models.py"], "/app.py": ["/models.py", "/config.py"]} |
49,065 | chenyuan2561/bwstudent | refs/heads/master | /config.py | # 连接数据可以
from flask import Flask
HOST = '127.0.0.1'
PORT = '3306'
USERNAME = 'root'
PASSWORD = 'root'
DATABASE = 'student'
db_url = "mysql+mysqlconnector://{}:{}@{}:{}/{}?charset=utf8mb4".format(USERNAME, PASSWORD, HOST, PORT, DATABASE)
SQLALCHEMY_DATABASE_URI = db_url
SQLALCHEMY_TRACK_MODIFICATIONS = False | {"/manage.py": ["/app.py", "/models.py"], "/app.py": ["/models.py", "/config.py"]} |
49,066 | chenyuan2561/bwstudent | refs/heads/master | /app.py | from flask import Flask, render_template, request, url_for, redirect
from dbs import db
from models import Student
import config
app = Flask(__name__)
app.config.from_object(config)
db.init_app(app)
# 主页
@app.route('/')
def index():
# 所有学生信息
s_student = Student.query.all()
return render_template('index.html',student=s_student)
# 添加
@app.route('/add_student/',methods=['GET','POST'])
def add_student():
if request.method == 'POST':
s_name = request.form.get('name')
s_english = request.form.get('english')
s_python = request.form.get('python')
s_c = request.form.get('c')
if s_name and s_python and s_english and s_c:
s_score = int(s_english) + int(s_python) + int(s_c)
data = Student(name=s_name, english=s_english, python=s_python, c=s_c, score=s_score)
db.session.add(data)
db.session.commit()
return redirect(url_for('index'))
return render_template('add_student.html',err='嘿,你忘记写全了!!!')
return render_template('add_student.html')
# 删除
@app.route('/del_student/',methods=['GET','POST'])
def del_student():
del_id = request.args.get('del')
if del_id:
Student.query.filter(Student.id == del_id).delete()
db.session.commit()
return redirect(url_for('index'))
# 修改
@app.route('/mod_student/',methods=['GET','POST'])
def mod_student():
mod_id = request.args.get('mod')
data = Student.query.filter(Student.id == mod_id)
if request.method == 'POST':
s_name = request.form.get('name')
s_english = request.form.get('english')
s_python = request.form.get('python')
s_c = request.form.get('c')
if s_name and s_python and s_english and s_c:
s_score = int(s_english) + int(s_python) + int(s_c)
data.update({'name': s_name, 'english': s_english, 'python': s_python, 'c': s_c, 'score':s_score})
db.session.commit()
return redirect(url_for('index'))
return render_template('mod_student.html',err='嘿,修改你都能忘记写全,你个垃圾!!!')
return render_template('mod_student.html')
if __name__ == '__main__':
app.run(debug=True)
| {"/manage.py": ["/app.py", "/models.py"], "/app.py": ["/models.py", "/config.py"]} |
49,071 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /setup.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from setuptools import setup, find_packages # noqa: H301
NAME = "marketcheck-api-sdk"
VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="Marketcheck Cars API",
author_email="",
url="",
keywords=["Swagger", "Marketcheck Cars API"],
install_requires=REQUIRES,
packages=find_packages(),
include_package_data=True,
long_description="""\
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
"""
)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,072 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/dealer.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Dealer(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'id': 'str',
'seller_name': 'str',
'inventory_url': 'str',
'data_source': 'str',
'status': 'str',
'street': 'str',
'city': 'str',
'state': 'str',
'country': 'str',
'zip': 'str',
'latitude': 'str',
'longitude': 'str',
'location_ll': 'str',
'seller_phone': 'str',
'seller_email': 'str',
'distance': 'float'
}
attribute_map = {
'id': 'id',
'seller_name': 'seller_name',
'inventory_url': 'inventory_url',
'data_source': 'data_source',
'status': 'status',
'street': 'street',
'city': 'city',
'state': 'state',
'country': 'country',
'zip': 'zip',
'latitude': 'latitude',
'longitude': 'longitude',
'location_ll': 'location_ll',
'seller_phone': 'seller_phone',
'seller_email': 'seller_email',
'distance': 'distance'
}
def __init__(self, id=None, seller_name=None, inventory_url=None, data_source=None, status=None, street=None, city=None, state=None, country=None, zip=None, latitude=None, longitude=None, location_ll=None, seller_phone=None, seller_email=None, distance=None): # noqa: E501
"""Dealer - a model defined in Swagger""" # noqa: E501
self._id = None
self._seller_name = None
self._inventory_url = None
self._data_source = None
self._status = None
self._street = None
self._city = None
self._state = None
self._country = None
self._zip = None
self._latitude = None
self._longitude = None
self._location_ll = None
self._seller_phone = None
self._seller_email = None
self._distance = None
self.discriminator = None
if id is not None:
self.id = id
if seller_name is not None:
self.seller_name = seller_name
if inventory_url is not None:
self.inventory_url = inventory_url
if data_source is not None:
self.data_source = data_source
if status is not None:
self.status = status
if street is not None:
self.street = street
if city is not None:
self.city = city
if state is not None:
self.state = state
if country is not None:
self.country = country
if zip is not None:
self.zip = zip
if latitude is not None:
self.latitude = latitude
if longitude is not None:
self.longitude = longitude
if location_ll is not None:
self.location_ll = location_ll
if seller_phone is not None:
self.seller_phone = seller_phone
if seller_email is not None:
self.seller_email = seller_email
if distance is not None:
self.distance = distance
@property
def id(self):
"""Gets the id of this Dealer. # noqa: E501
The unique id associated with the dealer in the Marketcheck database # noqa: E501
:return: The id of this Dealer. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Dealer.
The unique id associated with the dealer in the Marketcheck database # noqa: E501
:param id: The id of this Dealer. # noqa: E501
:type: str
"""
self._id = id
@property
def seller_name(self):
"""Gets the seller_name of this Dealer. # noqa: E501
Name of the dealer # noqa: E501
:return: The seller_name of this Dealer. # noqa: E501
:rtype: str
"""
return self._seller_name
@seller_name.setter
def seller_name(self, seller_name):
"""Sets the seller_name of this Dealer.
Name of the dealer # noqa: E501
:param seller_name: The seller_name of this Dealer. # noqa: E501
:type: str
"""
self._seller_name = seller_name
@property
def inventory_url(self):
"""Gets the inventory_url of this Dealer. # noqa: E501
Website of the dealer # noqa: E501
:return: The inventory_url of this Dealer. # noqa: E501
:rtype: str
"""
return self._inventory_url
@inventory_url.setter
def inventory_url(self, inventory_url):
"""Sets the inventory_url of this Dealer.
Website of the dealer # noqa: E501
:param inventory_url: The inventory_url of this Dealer. # noqa: E501
:type: str
"""
self._inventory_url = inventory_url
@property
def data_source(self):
"""Gets the data_source of this Dealer. # noqa: E501
Datasource of the dealer # noqa: E501
:return: The data_source of this Dealer. # noqa: E501
:rtype: str
"""
return self._data_source
@data_source.setter
def data_source(self, data_source):
"""Sets the data_source of this Dealer.
Datasource of the dealer # noqa: E501
:param data_source: The data_source of this Dealer. # noqa: E501
:type: str
"""
self._data_source = data_source
@property
def status(self):
"""Gets the status of this Dealer. # noqa: E501
Status of the dealer # noqa: E501
:return: The status of this Dealer. # noqa: E501
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this Dealer.
Status of the dealer # noqa: E501
:param status: The status of this Dealer. # noqa: E501
:type: str
"""
self._status = status
@property
def street(self):
"""Gets the street of this Dealer. # noqa: E501
Street of the dealer # noqa: E501
:return: The street of this Dealer. # noqa: E501
:rtype: str
"""
return self._street
@street.setter
def street(self, street):
"""Sets the street of this Dealer.
Street of the dealer # noqa: E501
:param street: The street of this Dealer. # noqa: E501
:type: str
"""
self._street = street
@property
def city(self):
"""Gets the city of this Dealer. # noqa: E501
City of the dealer # noqa: E501
:return: The city of this Dealer. # noqa: E501
:rtype: str
"""
return self._city
@city.setter
def city(self, city):
"""Sets the city of this Dealer.
City of the dealer # noqa: E501
:param city: The city of this Dealer. # noqa: E501
:type: str
"""
self._city = city
@property
def state(self):
"""Gets the state of this Dealer. # noqa: E501
State of the dealer # noqa: E501
:return: The state of this Dealer. # noqa: E501
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this Dealer.
State of the dealer # noqa: E501
:param state: The state of this Dealer. # noqa: E501
:type: str
"""
self._state = state
@property
def country(self):
"""Gets the country of this Dealer. # noqa: E501
country of the dealer # noqa: E501
:return: The country of this Dealer. # noqa: E501
:rtype: str
"""
return self._country
@country.setter
def country(self, country):
"""Sets the country of this Dealer.
country of the dealer # noqa: E501
:param country: The country of this Dealer. # noqa: E501
:type: str
"""
self._country = country
@property
def zip(self):
"""Gets the zip of this Dealer. # noqa: E501
Zip of the dealer # noqa: E501
:return: The zip of this Dealer. # noqa: E501
:rtype: str
"""
return self._zip
@zip.setter
def zip(self, zip):
"""Sets the zip of this Dealer.
Zip of the dealer # noqa: E501
:param zip: The zip of this Dealer. # noqa: E501
:type: str
"""
self._zip = zip
@property
def latitude(self):
"""Gets the latitude of this Dealer. # noqa: E501
Latutide for the dealer location # noqa: E501
:return: The latitude of this Dealer. # noqa: E501
:rtype: str
"""
return self._latitude
@latitude.setter
def latitude(self, latitude):
"""Sets the latitude of this Dealer.
Latutide for the dealer location # noqa: E501
:param latitude: The latitude of this Dealer. # noqa: E501
:type: str
"""
self._latitude = latitude
@property
def longitude(self):
"""Gets the longitude of this Dealer. # noqa: E501
Longitude for the dealer location # noqa: E501
:return: The longitude of this Dealer. # noqa: E501
:rtype: str
"""
return self._longitude
@longitude.setter
def longitude(self, longitude):
"""Sets the longitude of this Dealer.
Longitude for the dealer location # noqa: E501
:param longitude: The longitude of this Dealer. # noqa: E501
:type: str
"""
self._longitude = longitude
@property
def location_ll(self):
"""Gets the location_ll of this Dealer. # noqa: E501
location_ll for the dealer location # noqa: E501
:return: The location_ll of this Dealer. # noqa: E501
:rtype: str
"""
return self._location_ll
@location_ll.setter
def location_ll(self, location_ll):
"""Sets the location_ll of this Dealer.
location_ll for the dealer location # noqa: E501
:param location_ll: The location_ll of this Dealer. # noqa: E501
:type: str
"""
self._location_ll = location_ll
@property
def seller_phone(self):
"""Gets the seller_phone of this Dealer. # noqa: E501
Contact no of the dealer # noqa: E501
:return: The seller_phone of this Dealer. # noqa: E501
:rtype: str
"""
return self._seller_phone
@seller_phone.setter
def seller_phone(self, seller_phone):
"""Sets the seller_phone of this Dealer.
Contact no of the dealer # noqa: E501
:param seller_phone: The seller_phone of this Dealer. # noqa: E501
:type: str
"""
self._seller_phone = seller_phone
@property
def seller_email(self):
"""Gets the seller_email of this Dealer. # noqa: E501
Contact email of the dealer # noqa: E501
:return: The seller_email of this Dealer. # noqa: E501
:rtype: str
"""
return self._seller_email
@seller_email.setter
def seller_email(self, seller_email):
"""Sets the seller_email of this Dealer.
Contact email of the dealer # noqa: E501
:param seller_email: The seller_email of this Dealer. # noqa: E501
:type: str
"""
self._seller_email = seller_email
@property
def distance(self):
"""Gets the distance of this Dealer. # noqa: E501
Distance of dealer from given location # noqa: E501
:return: The distance of this Dealer. # noqa: E501
:rtype: float
"""
return self._distance
@distance.setter
def distance(self, distance):
"""Sets the distance of this Dealer.
Distance of dealer from given location # noqa: E501
:param distance: The distance of this Dealer. # noqa: E501
:type: float
"""
self._distance = distance
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Dealer):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,073 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/sales_stats.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SalesStats(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'absolute_mean_deviation': 'str',
'median': 'str',
'population_standard_deviation': 'str',
'variance': 'str',
'mean': 'str',
'weighted_mean': 'str',
'trimmed_mean': 'str',
'standard_deviation': 'str',
'iqr': 'str'
}
attribute_map = {
'absolute_mean_deviation': 'absolute_mean_deviation',
'median': 'median',
'population_standard_deviation': 'population_standard_deviation',
'variance': 'variance',
'mean': 'mean',
'weighted_mean': 'weighted_mean',
'trimmed_mean': 'trimmed_mean',
'standard_deviation': 'standard_deviation',
'iqr': 'iqr'
}
def __init__(self, absolute_mean_deviation=None, median=None, population_standard_deviation=None, variance=None, mean=None, weighted_mean=None, trimmed_mean=None, standard_deviation=None, iqr=None): # noqa: E501
"""SalesStats - a model defined in Swagger""" # noqa: E501
self._absolute_mean_deviation = None
self._median = None
self._population_standard_deviation = None
self._variance = None
self._mean = None
self._weighted_mean = None
self._trimmed_mean = None
self._standard_deviation = None
self._iqr = None
self.discriminator = None
if absolute_mean_deviation is not None:
self.absolute_mean_deviation = absolute_mean_deviation
if median is not None:
self.median = median
if population_standard_deviation is not None:
self.population_standard_deviation = population_standard_deviation
if variance is not None:
self.variance = variance
if mean is not None:
self.mean = mean
if weighted_mean is not None:
self.weighted_mean = weighted_mean
if trimmed_mean is not None:
self.trimmed_mean = trimmed_mean
if standard_deviation is not None:
self.standard_deviation = standard_deviation
if iqr is not None:
self.iqr = iqr
@property
def absolute_mean_deviation(self):
"""Gets the absolute_mean_deviation of this SalesStats. # noqa: E501
absolute_mean_deviation # noqa: E501
:return: The absolute_mean_deviation of this SalesStats. # noqa: E501
:rtype: str
"""
return self._absolute_mean_deviation
@absolute_mean_deviation.setter
def absolute_mean_deviation(self, absolute_mean_deviation):
"""Sets the absolute_mean_deviation of this SalesStats.
absolute_mean_deviation # noqa: E501
:param absolute_mean_deviation: The absolute_mean_deviation of this SalesStats. # noqa: E501
:type: str
"""
self._absolute_mean_deviation = absolute_mean_deviation
@property
def median(self):
"""Gets the median of this SalesStats. # noqa: E501
median # noqa: E501
:return: The median of this SalesStats. # noqa: E501
:rtype: str
"""
return self._median
@median.setter
def median(self, median):
"""Sets the median of this SalesStats.
median # noqa: E501
:param median: The median of this SalesStats. # noqa: E501
:type: str
"""
self._median = median
@property
def population_standard_deviation(self):
"""Gets the population_standard_deviation of this SalesStats. # noqa: E501
population_standard_deviation # noqa: E501
:return: The population_standard_deviation of this SalesStats. # noqa: E501
:rtype: str
"""
return self._population_standard_deviation
@population_standard_deviation.setter
def population_standard_deviation(self, population_standard_deviation):
"""Sets the population_standard_deviation of this SalesStats.
population_standard_deviation # noqa: E501
:param population_standard_deviation: The population_standard_deviation of this SalesStats. # noqa: E501
:type: str
"""
self._population_standard_deviation = population_standard_deviation
@property
def variance(self):
"""Gets the variance of this SalesStats. # noqa: E501
variance # noqa: E501
:return: The variance of this SalesStats. # noqa: E501
:rtype: str
"""
return self._variance
@variance.setter
def variance(self, variance):
"""Sets the variance of this SalesStats.
variance # noqa: E501
:param variance: The variance of this SalesStats. # noqa: E501
:type: str
"""
self._variance = variance
@property
def mean(self):
"""Gets the mean of this SalesStats. # noqa: E501
mean # noqa: E501
:return: The mean of this SalesStats. # noqa: E501
:rtype: str
"""
return self._mean
@mean.setter
def mean(self, mean):
"""Sets the mean of this SalesStats.
mean # noqa: E501
:param mean: The mean of this SalesStats. # noqa: E501
:type: str
"""
self._mean = mean
@property
def weighted_mean(self):
"""Gets the weighted_mean of this SalesStats. # noqa: E501
weighted_mean # noqa: E501
:return: The weighted_mean of this SalesStats. # noqa: E501
:rtype: str
"""
return self._weighted_mean
@weighted_mean.setter
def weighted_mean(self, weighted_mean):
"""Sets the weighted_mean of this SalesStats.
weighted_mean # noqa: E501
:param weighted_mean: The weighted_mean of this SalesStats. # noqa: E501
:type: str
"""
self._weighted_mean = weighted_mean
@property
def trimmed_mean(self):
"""Gets the trimmed_mean of this SalesStats. # noqa: E501
trimmed_mean # noqa: E501
:return: The trimmed_mean of this SalesStats. # noqa: E501
:rtype: str
"""
return self._trimmed_mean
@trimmed_mean.setter
def trimmed_mean(self, trimmed_mean):
"""Sets the trimmed_mean of this SalesStats.
trimmed_mean # noqa: E501
:param trimmed_mean: The trimmed_mean of this SalesStats. # noqa: E501
:type: str
"""
self._trimmed_mean = trimmed_mean
@property
def standard_deviation(self):
"""Gets the standard_deviation of this SalesStats. # noqa: E501
standard_deviation # noqa: E501
:return: The standard_deviation of this SalesStats. # noqa: E501
:rtype: str
"""
return self._standard_deviation
@standard_deviation.setter
def standard_deviation(self, standard_deviation):
"""Sets the standard_deviation of this SalesStats.
standard_deviation # noqa: E501
:param standard_deviation: The standard_deviation of this SalesStats. # noqa: E501
:type: str
"""
self._standard_deviation = standard_deviation
@property
def iqr(self):
"""Gets the iqr of this SalesStats. # noqa: E501
iqr # noqa: E501
:return: The iqr of this SalesStats. # noqa: E501
:rtype: str
"""
return self._iqr
@iqr.setter
def iqr(self, iqr):
"""Sets the iqr of this SalesStats.
iqr # noqa: E501
:param iqr: The iqr of this SalesStats. # noqa: E501
:type: str
"""
self._iqr = iqr
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SalesStats):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,074 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_depreciation_point.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import marketcheck_api_sdk
from marketcheck_api_sdk.models.depreciation_point import DepreciationPoint # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestDepreciationPoint(unittest.TestCase):
"""DepreciationPoint unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testDepreciationPoint(self):
"""Test DepreciationPoint"""
# FIXME: construct object with mandatory attributes with example values
# model = marketcheck_api_sdk.models.depreciation_point.DepreciationPoint() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,075 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/sales.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from marketcheck_api_sdk.models.sales_stats import SalesStats # noqa: F401,E501
class Sales(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'counts': 'int',
'cpo': 'int',
'non_cpo': 'int',
'inventory_type': 'str',
'make': 'str',
'model': 'str',
'year': 'str',
'trim': 'str',
'taxonomy_vin': 'str',
'state': 'str',
'city': 'str',
'dom_stats': 'SalesStats',
'price_stats': 'SalesStats',
'miles_stats': 'SalesStats'
}
attribute_map = {
'counts': 'counts',
'cpo': 'cpo',
'non_cpo': 'non-cpo',
'inventory_type': 'inventory_type',
'make': 'make',
'model': 'model',
'year': 'year',
'trim': 'trim',
'taxonomy_vin': 'taxonomy_vin',
'state': 'state',
'city': 'city',
'dom_stats': 'dom_stats',
'price_stats': 'price_stats',
'miles_stats': 'miles_stats'
}
def __init__(self, counts=None, cpo=None, non_cpo=None, inventory_type=None, make=None, model=None, year=None, trim=None, taxonomy_vin=None, state=None, city=None, dom_stats=None, price_stats=None, miles_stats=None): # noqa: E501
"""Sales - a model defined in Swagger""" # noqa: E501
self._counts = None
self._cpo = None
self._non_cpo = None
self._inventory_type = None
self._make = None
self._model = None
self._year = None
self._trim = None
self._taxonomy_vin = None
self._state = None
self._city = None
self._dom_stats = None
self._price_stats = None
self._miles_stats = None
self.discriminator = None
if counts is not None:
self.counts = counts
if cpo is not None:
self.cpo = cpo
if non_cpo is not None:
self.non_cpo = non_cpo
if inventory_type is not None:
self.inventory_type = inventory_type
if make is not None:
self.make = make
if model is not None:
self.model = model
if year is not None:
self.year = year
if trim is not None:
self.trim = trim
if taxonomy_vin is not None:
self.taxonomy_vin = taxonomy_vin
if state is not None:
self.state = state
if city is not None:
self.city = city
if dom_stats is not None:
self.dom_stats = dom_stats
if price_stats is not None:
self.price_stats = price_stats
if miles_stats is not None:
self.miles_stats = miles_stats
@property
def counts(self):
"""Gets the counts of this Sales. # noqa: E501
Sales count # noqa: E501
:return: The counts of this Sales. # noqa: E501
:rtype: int
"""
return self._counts
@counts.setter
def counts(self, counts):
"""Sets the counts of this Sales.
Sales count # noqa: E501
:param counts: The counts of this Sales. # noqa: E501
:type: int
"""
self._counts = counts
@property
def cpo(self):
"""Gets the cpo of this Sales. # noqa: E501
cpo sales count # noqa: E501
:return: The cpo of this Sales. # noqa: E501
:rtype: int
"""
return self._cpo
@cpo.setter
def cpo(self, cpo):
"""Sets the cpo of this Sales.
cpo sales count # noqa: E501
:param cpo: The cpo of this Sales. # noqa: E501
:type: int
"""
self._cpo = cpo
@property
def non_cpo(self):
"""Gets the non_cpo of this Sales. # noqa: E501
Non-cpo sales count # noqa: E501
:return: The non_cpo of this Sales. # noqa: E501
:rtype: int
"""
return self._non_cpo
@non_cpo.setter
def non_cpo(self, non_cpo):
"""Sets the non_cpo of this Sales.
Non-cpo sales count # noqa: E501
:param non_cpo: The non_cpo of this Sales. # noqa: E501
:type: int
"""
self._non_cpo = non_cpo
@property
def inventory_type(self):
"""Gets the inventory_type of this Sales. # noqa: E501
inventory_type # noqa: E501
:return: The inventory_type of this Sales. # noqa: E501
:rtype: str
"""
return self._inventory_type
@inventory_type.setter
def inventory_type(self, inventory_type):
"""Sets the inventory_type of this Sales.
inventory_type # noqa: E501
:param inventory_type: The inventory_type of this Sales. # noqa: E501
:type: str
"""
self._inventory_type = inventory_type
@property
def make(self):
"""Gets the make of this Sales. # noqa: E501
Make # noqa: E501
:return: The make of this Sales. # noqa: E501
:rtype: str
"""
return self._make
@make.setter
def make(self, make):
"""Sets the make of this Sales.
Make # noqa: E501
:param make: The make of this Sales. # noqa: E501
:type: str
"""
self._make = make
@property
def model(self):
"""Gets the model of this Sales. # noqa: E501
model # noqa: E501
:return: The model of this Sales. # noqa: E501
:rtype: str
"""
return self._model
@model.setter
def model(self, model):
"""Sets the model of this Sales.
model # noqa: E501
:param model: The model of this Sales. # noqa: E501
:type: str
"""
self._model = model
@property
def year(self):
"""Gets the year of this Sales. # noqa: E501
year # noqa: E501
:return: The year of this Sales. # noqa: E501
:rtype: str
"""
return self._year
@year.setter
def year(self, year):
"""Sets the year of this Sales.
year # noqa: E501
:param year: The year of this Sales. # noqa: E501
:type: str
"""
self._year = year
@property
def trim(self):
"""Gets the trim of this Sales. # noqa: E501
trim # noqa: E501
:return: The trim of this Sales. # noqa: E501
:rtype: str
"""
return self._trim
@trim.setter
def trim(self, trim):
"""Sets the trim of this Sales.
trim # noqa: E501
:param trim: The trim of this Sales. # noqa: E501
:type: str
"""
self._trim = trim
@property
def taxonomy_vin(self):
"""Gets the taxonomy_vin of this Sales. # noqa: E501
taxonomy_vin # noqa: E501
:return: The taxonomy_vin of this Sales. # noqa: E501
:rtype: str
"""
return self._taxonomy_vin
@taxonomy_vin.setter
def taxonomy_vin(self, taxonomy_vin):
"""Sets the taxonomy_vin of this Sales.
taxonomy_vin # noqa: E501
:param taxonomy_vin: The taxonomy_vin of this Sales. # noqa: E501
:type: str
"""
self._taxonomy_vin = taxonomy_vin
@property
def state(self):
"""Gets the state of this Sales. # noqa: E501
State # noqa: E501
:return: The state of this Sales. # noqa: E501
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this Sales.
State # noqa: E501
:param state: The state of this Sales. # noqa: E501
:type: str
"""
self._state = state
@property
def city(self):
"""Gets the city of this Sales. # noqa: E501
City # noqa: E501
:return: The city of this Sales. # noqa: E501
:rtype: str
"""
return self._city
@city.setter
def city(self, city):
"""Sets the city of this Sales.
City # noqa: E501
:param city: The city of this Sales. # noqa: E501
:type: str
"""
self._city = city
@property
def dom_stats(self):
"""Gets the dom_stats of this Sales. # noqa: E501
Days on market stats # noqa: E501
:return: The dom_stats of this Sales. # noqa: E501
:rtype: SalesStats
"""
return self._dom_stats
@dom_stats.setter
def dom_stats(self, dom_stats):
"""Sets the dom_stats of this Sales.
Days on market stats # noqa: E501
:param dom_stats: The dom_stats of this Sales. # noqa: E501
:type: SalesStats
"""
self._dom_stats = dom_stats
@property
def price_stats(self):
"""Gets the price_stats of this Sales. # noqa: E501
Price stats # noqa: E501
:return: The price_stats of this Sales. # noqa: E501
:rtype: SalesStats
"""
return self._price_stats
@price_stats.setter
def price_stats(self, price_stats):
"""Sets the price_stats of this Sales.
Price stats # noqa: E501
:param price_stats: The price_stats of this Sales. # noqa: E501
:type: SalesStats
"""
self._price_stats = price_stats
@property
def miles_stats(self):
"""Gets the miles_stats of this Sales. # noqa: E501
Miles stats # noqa: E501
:return: The miles_stats of this Sales. # noqa: E501
:rtype: SalesStats
"""
return self._miles_stats
@miles_stats.setter
def miles_stats(self, miles_stats):
"""Sets the miles_stats of this Sales.
Miles stats # noqa: E501
:param miles_stats: The miles_stats of this Sales. # noqa: E501
:type: SalesStats
"""
self._miles_stats = miles_stats
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Sales):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,076 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/plot_point.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class PlotPoint(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'price': 'float',
'miles': 'float',
'vin': 'str',
'msrp': 'float',
'dom': 'float',
'seller_name': 'str',
'id': 'str'
}
attribute_map = {
'price': 'price',
'miles': 'miles',
'vin': 'vin',
'msrp': 'msrp',
'dom': 'dom',
'seller_name': 'seller_name',
'id': 'id'
}
def __init__(self, price=None, miles=None, vin=None, msrp=None, dom=None, seller_name=None, id=None): # noqa: E501
"""PlotPoint - a model defined in Swagger""" # noqa: E501
self._price = None
self._miles = None
self._vin = None
self._msrp = None
self._dom = None
self._seller_name = None
self._id = None
self.discriminator = None
if price is not None:
self.price = price
if miles is not None:
self.miles = miles
if vin is not None:
self.vin = vin
if msrp is not None:
self.msrp = msrp
if dom is not None:
self.dom = dom
if seller_name is not None:
self.seller_name = seller_name
if id is not None:
self.id = id
@property
def price(self):
"""Gets the price of this PlotPoint. # noqa: E501
Price # noqa: E501
:return: The price of this PlotPoint. # noqa: E501
:rtype: float
"""
return self._price
@price.setter
def price(self, price):
"""Sets the price of this PlotPoint.
Price # noqa: E501
:param price: The price of this PlotPoint. # noqa: E501
:type: float
"""
self._price = price
@property
def miles(self):
"""Gets the miles of this PlotPoint. # noqa: E501
Miles # noqa: E501
:return: The miles of this PlotPoint. # noqa: E501
:rtype: float
"""
return self._miles
@miles.setter
def miles(self, miles):
"""Sets the miles of this PlotPoint.
Miles # noqa: E501
:param miles: The miles of this PlotPoint. # noqa: E501
:type: float
"""
self._miles = miles
@property
def vin(self):
"""Gets the vin of this PlotPoint. # noqa: E501
Vin # noqa: E501
:return: The vin of this PlotPoint. # noqa: E501
:rtype: str
"""
return self._vin
@vin.setter
def vin(self, vin):
"""Sets the vin of this PlotPoint.
Vin # noqa: E501
:param vin: The vin of this PlotPoint. # noqa: E501
:type: str
"""
self._vin = vin
@property
def msrp(self):
"""Gets the msrp of this PlotPoint. # noqa: E501
Msrp # noqa: E501
:return: The msrp of this PlotPoint. # noqa: E501
:rtype: float
"""
return self._msrp
@msrp.setter
def msrp(self, msrp):
"""Sets the msrp of this PlotPoint.
Msrp # noqa: E501
:param msrp: The msrp of this PlotPoint. # noqa: E501
:type: float
"""
self._msrp = msrp
@property
def dom(self):
"""Gets the dom of this PlotPoint. # noqa: E501
DOM # noqa: E501
:return: The dom of this PlotPoint. # noqa: E501
:rtype: float
"""
return self._dom
@dom.setter
def dom(self, dom):
"""Sets the dom of this PlotPoint.
DOM # noqa: E501
:param dom: The dom of this PlotPoint. # noqa: E501
:type: float
"""
self._dom = dom
@property
def seller_name(self):
"""Gets the seller_name of this PlotPoint. # noqa: E501
Seller name # noqa: E501
:return: The seller_name of this PlotPoint. # noqa: E501
:rtype: str
"""
return self._seller_name
@seller_name.setter
def seller_name(self, seller_name):
"""Sets the seller_name of this PlotPoint.
Seller name # noqa: E501
:param seller_name: The seller_name of this PlotPoint. # noqa: E501
:type: str
"""
self._seller_name = seller_name
@property
def id(self):
"""Gets the id of this PlotPoint. # noqa: E501
Listing id # noqa: E501
:return: The id of this PlotPoint. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this PlotPoint.
Listing id # noqa: E501
:param id: The id of this PlotPoint. # noqa: E501
:type: str
"""
self._id = id
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, PlotPoint):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,077 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_market_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from __future__ import division
from operator import truediv
from pprint import pprint
import unittest
import pdb
import marketcheck_api_sdk
from marketcheck_api_sdk.api.market_api import MarketApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestMarketApi(unittest.TestCase):
"""MarketApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.market_api.MarketApi() # noqa: E501
def tearDown(self):
pass
def test_get_averages(self):
"""Test case for get_averages
[MOCK] Get Averages for YMM # noqa: E501
"""
pass
def test_get_comparison(self):
"""Test case for get_comparison
Compare market # noqa: E501
"""
pass
def test_get_competition(self):
"""Test case for get_competition
Competitors # noqa: E501
"""
pass
def test_get_depreciation(self):
"""Test case for get_depreciation
Depreciation # noqa: E501
"""
pass
def test_get_mds(self):
"""Test case for get_mds
Market Days Supply # noqa: E501
"""
api_instance = marketcheck_api_sdk.MarketApi(marketcheck_api_sdk.ApiClient())
api_key = "YOUR API KEY"
vins =["1FTNE2CM2FKA81288","1GYS4BKJ8FR290257","3GYFNBE3XFS537500","1FT7W2BT5FEA75059","1FMCU9J90FUA21186"]
try:
###### validate MDS with exact and debug #####
for vin in vins:
api_response = api_instance.get_mds(vin, api_key=api_key,latitude=37.998,longitude=-84.522,radius=1000,exact="true",debug=1)
assert hasattr(api_response,"year")
assert hasattr(api_response,"make")
assert hasattr(api_response,"model")
assert hasattr(api_response,"trim")
assert api_response.mds != None
assert api_response.mds != 0
assert isinstance(api_response.mds, int)
assert api_response.total_active_cars_for_ymmt != None
assert api_response.total_active_cars_for_ymmt != 0
assert api_response.total_cars_sold_in_last_45_days != None
assert api_response.total_cars_sold_in_last_45_days != 0
per_day_sold_rate = truediv(api_response.total_cars_sold_in_last_45_days,45)
mds = truediv(api_response.total_active_cars_for_ymmt,per_day_sold_rate)
assert api_response.mds == int(round(mds))
####### validate MDS with debug and without exact #####
for vin in vins:
api_response = api_instance.get_mds(vin, api_key=api_key,latitude=37.998,longitude=-84.522,radius=1000,debug=1)
assert hasattr(api_response,"year")
assert hasattr(api_response,"make")
assert hasattr(api_response,"model")
assert api_response.mds != None
assert api_response.mds != 0
assert isinstance(api_response.mds, int)
assert api_response.total_active_cars_for_ymmt != None
assert api_response.total_active_cars_for_ymmt != 0
assert api_response.total_cars_sold_in_last_45_days != None
assert api_response.total_cars_sold_in_last_45_days != 0
per_day_sold_rate = truediv(api_response.total_cars_sold_in_last_45_days,45)
mds = truediv(api_response.total_active_cars_for_ymmt,per_day_sold_rate)
assert api_response.mds == int(round(mds))
########## validate MDS without debug and without exact #####
for vin in vins:
api_response = api_instance.get_mds(vin, api_key=api_key,latitude=37.998,longitude=-84.522,radius=1000,exact="true")
assert api_response.mds != None
assert api_response.mds != 0
assert isinstance(api_response.mds, int)
assert api_response.total_active_cars_for_ymmt != None
assert api_response.total_active_cars_for_ymmt != 0
assert api_response.total_cars_sold_in_last_45_days != None
assert api_response.total_cars_sold_in_last_45_days != 0
per_day_sold_rate = truediv(api_response.total_cars_sold_in_last_45_days,45)
mds = truediv(api_response.total_active_cars_for_ymmt,per_day_sold_rate)
assert api_response.mds == int(round(mds))
except ApiException as e:
pprint("Exception when calling DealerApi->dealer_search: %s\n" % e)
pass
def test_get_popularity(self):
"""Test case for get_popularity
Popularity # noqa: E501
"""
pass
def test_get_sales_count(self):
"""Test case for get_sales_count
Get sales count by make, model, year, trim or taxonomy vin # noqa: E501
"""
pass
def test_get_trends(self):
"""Test case for get_trends
Get Trends for criteria # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,078 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/safety_rating.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SafetyRating(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'overall_rating': 'float',
'roll_over_rating': 'float',
'driver_side_rating': 'float',
'driver_front_rating': 'float',
'passenger_front_rating': 'float'
}
attribute_map = {
'overall_rating': 'overall_rating',
'roll_over_rating': 'roll_over_rating',
'driver_side_rating': 'driver_side_rating',
'driver_front_rating': 'driver_front_rating',
'passenger_front_rating': 'passenger_front_rating'
}
def __init__(self, overall_rating=None, roll_over_rating=None, driver_side_rating=None, driver_front_rating=None, passenger_front_rating=None): # noqa: E501
"""SafetyRating - a model defined in Swagger""" # noqa: E501
self._overall_rating = None
self._roll_over_rating = None
self._driver_side_rating = None
self._driver_front_rating = None
self._passenger_front_rating = None
self.discriminator = None
if overall_rating is not None:
self.overall_rating = overall_rating
if roll_over_rating is not None:
self.roll_over_rating = roll_over_rating
if driver_side_rating is not None:
self.driver_side_rating = driver_side_rating
if driver_front_rating is not None:
self.driver_front_rating = driver_front_rating
if passenger_front_rating is not None:
self.passenger_front_rating = passenger_front_rating
@property
def overall_rating(self):
"""Gets the overall_rating of this SafetyRating. # noqa: E501
Overall rating of the Listing on scale 1-5 # noqa: E501
:return: The overall_rating of this SafetyRating. # noqa: E501
:rtype: float
"""
return self._overall_rating
@overall_rating.setter
def overall_rating(self, overall_rating):
"""Sets the overall_rating of this SafetyRating.
Overall rating of the Listing on scale 1-5 # noqa: E501
:param overall_rating: The overall_rating of this SafetyRating. # noqa: E501
:type: float
"""
self._overall_rating = overall_rating
@property
def roll_over_rating(self):
"""Gets the roll_over_rating of this SafetyRating. # noqa: E501
Roll Over rating of the Listing on scale 1-5 # noqa: E501
:return: The roll_over_rating of this SafetyRating. # noqa: E501
:rtype: float
"""
return self._roll_over_rating
@roll_over_rating.setter
def roll_over_rating(self, roll_over_rating):
"""Sets the roll_over_rating of this SafetyRating.
Roll Over rating of the Listing on scale 1-5 # noqa: E501
:param roll_over_rating: The roll_over_rating of this SafetyRating. # noqa: E501
:type: float
"""
self._roll_over_rating = roll_over_rating
@property
def driver_side_rating(self):
"""Gets the driver_side_rating of this SafetyRating. # noqa: E501
Driver Side rating of the Listing on scale 1-5 # noqa: E501
:return: The driver_side_rating of this SafetyRating. # noqa: E501
:rtype: float
"""
return self._driver_side_rating
@driver_side_rating.setter
def driver_side_rating(self, driver_side_rating):
"""Sets the driver_side_rating of this SafetyRating.
Driver Side rating of the Listing on scale 1-5 # noqa: E501
:param driver_side_rating: The driver_side_rating of this SafetyRating. # noqa: E501
:type: float
"""
self._driver_side_rating = driver_side_rating
@property
def driver_front_rating(self):
"""Gets the driver_front_rating of this SafetyRating. # noqa: E501
Driver front rating of the Listing on scale 1-5 # noqa: E501
:return: The driver_front_rating of this SafetyRating. # noqa: E501
:rtype: float
"""
return self._driver_front_rating
@driver_front_rating.setter
def driver_front_rating(self, driver_front_rating):
"""Sets the driver_front_rating of this SafetyRating.
Driver front rating of the Listing on scale 1-5 # noqa: E501
:param driver_front_rating: The driver_front_rating of this SafetyRating. # noqa: E501
:type: float
"""
self._driver_front_rating = driver_front_rating
@property
def passenger_front_rating(self):
"""Gets the passenger_front_rating of this SafetyRating. # noqa: E501
Passenger front rating of the Listing on scale 1-5 # noqa: E501
:return: The passenger_front_rating of this SafetyRating. # noqa: E501
:rtype: float
"""
return self._passenger_front_rating
@passenger_front_rating.setter
def passenger_front_rating(self, passenger_front_rating):
"""Sets the passenger_front_rating of this SafetyRating.
Passenger front rating of the Listing on scale 1-5 # noqa: E501
:param passenger_front_rating: The passenger_front_rating of this SafetyRating. # noqa: E501
:type: float
"""
self._passenger_front_rating = passenger_front_rating
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SafetyRating):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,079 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/__init__.py | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from marketcheck_api_sdk.api.crm_api import CRMApi
from marketcheck_api_sdk.api.dealer_api import DealerApi
from marketcheck_api_sdk.api.facets_api import FacetsApi
from marketcheck_api_sdk.api.graphs_api import GraphsApi
from marketcheck_api_sdk.api.history_api import HistoryApi
from marketcheck_api_sdk.api.inventory_api import InventoryApi
from marketcheck_api_sdk.api.listings_api import ListingsApi
from marketcheck_api_sdk.api.market_api import MarketApi
from marketcheck_api_sdk.api.vin_decoder_api import VINDecoderApi
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,080 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_crm_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from pprint import pprint
import unittest
import marketcheck_api_sdk
from marketcheck_api_sdk.api.crm_api import CRMApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestCRMApi(unittest.TestCase):
"""CRMApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.crm_api.CRMApi() # noqa: E501
def tearDown(self):
pass
def test_crm_check(self):
"""Test case for crm_check
CRM check of a particular vin # noqa: E501
"""
api_instance = marketcheck_api_sdk.CRMApi()
vin = "1N4AA5AP8EC477345"
sale_date = ["20180305","20180606"]
api_key = 'YOUR API KEY'
try:
api_response = api_instance.crm_check(vin, sale_date[0], api_key=api_key)
#pprint(api_response)
assert api_response.for_sale == 'True'
api_response = api_instance.crm_check(vin, sale_date[1], api_key=api_key)
assert api_response.for_sale == 'False'
except ApiException as e:
print("Exception when calling CRMApi->crm_check: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,081 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/facets_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class FacetsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_facets(self, fields, **kwargs): # noqa: E501
"""Facets # noqa: E501
[Merged with the /search API - Please check the 'facets' parameter to the Search API above] Get the facets for the given simple filter criteria (by given VIN's basic specification, Or by Year, Make, Model, Trim criteria) and facet fields # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_facets(fields, async=True)
>>> result = thread.get()
:param async bool
:param str fields: Comma separated list of fields to generate facets for. Supported fields are - year, make, model, trim, exterior_color, interior_color, drivetrain, vehicle_type, car_type, body_style, body_subtype, doors (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str vin: VIN as a reference to the type of car for which facets data is to be returned
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:return: list[FacetItem]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_facets_with_http_info(fields, **kwargs) # noqa: E501
else:
(data) = self.get_facets_with_http_info(fields, **kwargs) # noqa: E501
return data
def get_facets_with_http_info(self, fields, **kwargs): # noqa: E501
"""Facets # noqa: E501
[Merged with the /search API - Please check the 'facets' parameter to the Search API above] Get the facets for the given simple filter criteria (by given VIN's basic specification, Or by Year, Make, Model, Trim criteria) and facet fields # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_facets_with_http_info(fields, async=True)
>>> result = thread.get()
:param async bool
:param str fields: Comma separated list of fields to generate facets for. Supported fields are - year, make, model, trim, exterior_color, interior_color, drivetrain, vehicle_type, car_type, body_style, body_subtype, doors (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str vin: VIN as a reference to the type of car for which facets data is to be returned
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:return: list[FacetItem]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['fields', 'api_key', 'vin', 'year', 'make', 'model', 'trim'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_facets" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'fields' is set
if ('fields' not in params or
params['fields'] is None):
raise ValueError("Missing the required parameter `fields` when calling `get_facets`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
if 'year' in params:
query_params.append(('year', params['year'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'model' in params:
query_params.append(('model', params['model'])) # noqa: E501
if 'trim' in params:
query_params.append(('trim', params['trim'])) # noqa: E501
if 'fields' in params:
query_params.append(('fields', params['fields'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/facets', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[FacetItem]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,082 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_vin_decoder_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import marketcheck_api_sdk
from marketcheck_api_sdk.api.vin_decoder_api import VINDecoderApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestVINDecoderApi(unittest.TestCase):
"""VINDecoderApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.vin_decoder_api.VINDecoderApi() # noqa: E501
def tearDown(self):
pass
def test_decode(self):
"""Test case for decode
VIN Decoder # noqa: E501
"""
pass
def test_get_economy(self):
"""Test case for get_economy
Get Economy based on environmental factors # noqa: E501
"""
pass
def test_get_efficiency(self):
"""Test case for get_efficiency
Get fuel effeciency # noqa: E501
"""
pass
def test_get_safety_rating(self):
"""Test case for get_safety_rating
Get Safety Rating # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,083 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/listing_debug_attributes.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ListingDebugAttributes(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'robot_id': 'float',
'cycle_id': 'float',
'scraped_at': 'str',
'template_id': 'float',
'user_id': 'float',
'taxonomy_vin': 'str'
}
attribute_map = {
'robot_id': 'robot_id',
'cycle_id': 'cycle_id',
'scraped_at': 'scraped_at',
'template_id': 'template_id',
'user_id': 'user_id',
'taxonomy_vin': 'taxonomy_vin'
}
def __init__(self, robot_id=None, cycle_id=None, scraped_at=None, template_id=None, user_id=None, taxonomy_vin=None): # noqa: E501
"""ListingDebugAttributes - a model defined in Swagger""" # noqa: E501
self._robot_id = None
self._cycle_id = None
self._scraped_at = None
self._template_id = None
self._user_id = None
self._taxonomy_vin = None
self.discriminator = None
if robot_id is not None:
self.robot_id = robot_id
if cycle_id is not None:
self.cycle_id = cycle_id
if scraped_at is not None:
self.scraped_at = scraped_at
if template_id is not None:
self.template_id = template_id
if user_id is not None:
self.user_id = user_id
if taxonomy_vin is not None:
self.taxonomy_vin = taxonomy_vin
@property
def robot_id(self):
"""Gets the robot_id of this ListingDebugAttributes. # noqa: E501
Robot id # noqa: E501
:return: The robot_id of this ListingDebugAttributes. # noqa: E501
:rtype: float
"""
return self._robot_id
@robot_id.setter
def robot_id(self, robot_id):
"""Sets the robot_id of this ListingDebugAttributes.
Robot id # noqa: E501
:param robot_id: The robot_id of this ListingDebugAttributes. # noqa: E501
:type: float
"""
self._robot_id = robot_id
@property
def cycle_id(self):
"""Gets the cycle_id of this ListingDebugAttributes. # noqa: E501
Cycle id # noqa: E501
:return: The cycle_id of this ListingDebugAttributes. # noqa: E501
:rtype: float
"""
return self._cycle_id
@cycle_id.setter
def cycle_id(self, cycle_id):
"""Sets the cycle_id of this ListingDebugAttributes.
Cycle id # noqa: E501
:param cycle_id: The cycle_id of this ListingDebugAttributes. # noqa: E501
:type: float
"""
self._cycle_id = cycle_id
@property
def scraped_at(self):
"""Gets the scraped_at of this ListingDebugAttributes. # noqa: E501
Scraped date and time # noqa: E501
:return: The scraped_at of this ListingDebugAttributes. # noqa: E501
:rtype: str
"""
return self._scraped_at
@scraped_at.setter
def scraped_at(self, scraped_at):
"""Sets the scraped_at of this ListingDebugAttributes.
Scraped date and time # noqa: E501
:param scraped_at: The scraped_at of this ListingDebugAttributes. # noqa: E501
:type: str
"""
self._scraped_at = scraped_at
@property
def template_id(self):
"""Gets the template_id of this ListingDebugAttributes. # noqa: E501
Template id # noqa: E501
:return: The template_id of this ListingDebugAttributes. # noqa: E501
:rtype: float
"""
return self._template_id
@template_id.setter
def template_id(self, template_id):
"""Sets the template_id of this ListingDebugAttributes.
Template id # noqa: E501
:param template_id: The template_id of this ListingDebugAttributes. # noqa: E501
:type: float
"""
self._template_id = template_id
@property
def user_id(self):
"""Gets the user_id of this ListingDebugAttributes. # noqa: E501
User id # noqa: E501
:return: The user_id of this ListingDebugAttributes. # noqa: E501
:rtype: float
"""
return self._user_id
@user_id.setter
def user_id(self, user_id):
"""Sets the user_id of this ListingDebugAttributes.
User id # noqa: E501
:param user_id: The user_id of this ListingDebugAttributes. # noqa: E501
:type: float
"""
self._user_id = user_id
@property
def taxonomy_vin(self):
"""Gets the taxonomy_vin of this ListingDebugAttributes. # noqa: E501
Taxonomy vin # noqa: E501
:return: The taxonomy_vin of this ListingDebugAttributes. # noqa: E501
:rtype: str
"""
return self._taxonomy_vin
@taxonomy_vin.setter
def taxonomy_vin(self, taxonomy_vin):
"""Sets the taxonomy_vin of this ListingDebugAttributes.
Taxonomy vin # noqa: E501
:param taxonomy_vin: The taxonomy_vin of this ListingDebugAttributes. # noqa: E501
:type: str
"""
self._taxonomy_vin = taxonomy_vin
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ListingDebugAttributes):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,084 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/comparison_point.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ComparisonPoint(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'similar_vehicles_count': 'float',
'dealer_indicator': 'str',
'vin_price': 'float',
'fair_deal_price': 'float'
}
attribute_map = {
'similar_vehicles_count': 'similar_vehicles_count',
'dealer_indicator': 'dealer_indicator',
'vin_price': 'vin_price',
'fair_deal_price': 'fair_deal_price'
}
def __init__(self, similar_vehicles_count=None, dealer_indicator=None, vin_price=None, fair_deal_price=None): # noqa: E501
"""ComparisonPoint - a model defined in Swagger""" # noqa: E501
self._similar_vehicles_count = None
self._dealer_indicator = None
self._vin_price = None
self._fair_deal_price = None
self.discriminator = None
if similar_vehicles_count is not None:
self.similar_vehicles_count = similar_vehicles_count
if dealer_indicator is not None:
self.dealer_indicator = dealer_indicator
if vin_price is not None:
self.vin_price = vin_price
if fair_deal_price is not None:
self.fair_deal_price = fair_deal_price
@property
def similar_vehicles_count(self):
"""Gets the similar_vehicles_count of this ComparisonPoint. # noqa: E501
Similar Vehicles Count # noqa: E501
:return: The similar_vehicles_count of this ComparisonPoint. # noqa: E501
:rtype: float
"""
return self._similar_vehicles_count
@similar_vehicles_count.setter
def similar_vehicles_count(self, similar_vehicles_count):
"""Sets the similar_vehicles_count of this ComparisonPoint.
Similar Vehicles Count # noqa: E501
:param similar_vehicles_count: The similar_vehicles_count of this ComparisonPoint. # noqa: E501
:type: float
"""
self._similar_vehicles_count = similar_vehicles_count
@property
def dealer_indicator(self):
"""Gets the dealer_indicator of this ComparisonPoint. # noqa: E501
Deal Indicator # noqa: E501
:return: The dealer_indicator of this ComparisonPoint. # noqa: E501
:rtype: str
"""
return self._dealer_indicator
@dealer_indicator.setter
def dealer_indicator(self, dealer_indicator):
"""Sets the dealer_indicator of this ComparisonPoint.
Deal Indicator # noqa: E501
:param dealer_indicator: The dealer_indicator of this ComparisonPoint. # noqa: E501
:type: str
"""
self._dealer_indicator = dealer_indicator
@property
def vin_price(self):
"""Gets the vin_price of this ComparisonPoint. # noqa: E501
Price for Vin # noqa: E501
:return: The vin_price of this ComparisonPoint. # noqa: E501
:rtype: float
"""
return self._vin_price
@vin_price.setter
def vin_price(self, vin_price):
"""Sets the vin_price of this ComparisonPoint.
Price for Vin # noqa: E501
:param vin_price: The vin_price of this ComparisonPoint. # noqa: E501
:type: float
"""
self._vin_price = vin_price
@property
def fair_deal_price(self):
"""Gets the fair_deal_price of this ComparisonPoint. # noqa: E501
Fair Deal Price # noqa: E501
:return: The fair_deal_price of this ComparisonPoint. # noqa: E501
:rtype: float
"""
return self._fair_deal_price
@fair_deal_price.setter
def fair_deal_price(self, fair_deal_price):
"""Sets the fair_deal_price of this ComparisonPoint.
Fair Deal Price # noqa: E501
:param fair_deal_price: The fair_deal_price of this ComparisonPoint. # noqa: E501
:type: float
"""
self._fair_deal_price = fair_deal_price
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ComparisonPoint):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,085 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/search_facets.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from marketcheck_api_sdk.models.facet_item import FacetItem # noqa: F401,E501
class SearchFacets(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'year': 'list[FacetItem]',
'make': 'list[FacetItem]',
'model': 'list[FacetItem]',
'trim': 'list[FacetItem]',
'trim_o': 'list[FacetItem]',
'trim_r': 'list[FacetItem]',
'body_type': 'list[FacetItem]',
'body_subtype': 'list[FacetItem]',
'vehicle_type': 'list[FacetItem]',
'car_type': 'list[FacetItem]',
'drivetrain': 'list[FacetItem]',
'transmission': 'list[FacetItem]',
'cylinders': 'list[FacetItem]',
'fuel_type': 'list[FacetItem]',
'exterior_color': 'list[FacetItem]',
'interior_color': 'list[FacetItem]',
'city': 'list[FacetItem]',
'state': 'list[FacetItem]',
'seller_type': 'list[FacetItem]',
'doors': 'list[FacetItem]',
'engine': 'list[FacetItem]',
'engine_size': 'list[FacetItem]',
'engine_aspiration': 'list[FacetItem]',
'engine_block': 'list[FacetItem]',
'source': 'list[FacetItem]',
'seller_name_o': 'list[FacetItem]',
'seller_name': 'list[FacetItem]',
'dealer_id': 'list[FacetItem]',
'data_source': 'list[FacetItem]',
'carfax_1_owner': 'list[FacetItem]',
'carfax_clean_title': 'list[FacetItem]'
}
attribute_map = {
'year': 'year',
'make': 'make',
'model': 'model',
'trim': 'trim',
'trim_o': 'trim_o',
'trim_r': 'trim_r',
'body_type': 'body_type',
'body_subtype': 'body_subtype',
'vehicle_type': 'vehicle_type',
'car_type': 'car_type',
'drivetrain': 'drivetrain',
'transmission': 'transmission',
'cylinders': 'cylinders',
'fuel_type': 'fuel_type',
'exterior_color': 'exterior_color',
'interior_color': 'interior_color',
'city': 'city',
'state': 'state',
'seller_type': 'seller_type',
'doors': 'doors',
'engine': 'engine',
'engine_size': 'engine_size',
'engine_aspiration': 'engine_aspiration',
'engine_block': 'engine_block',
'source': 'source',
'seller_name_o': 'seller_name_o',
'seller_name': 'seller_name',
'dealer_id': 'dealer_id',
'data_source': 'data_source',
'carfax_1_owner': 'carfax_1_owner',
'carfax_clean_title': 'carfax_clean_title'
}
def __init__(self, year=None, make=None, model=None, trim=None, trim_o=None, trim_r=None, body_type=None, body_subtype=None, vehicle_type=None, car_type=None, drivetrain=None, transmission=None, cylinders=None, fuel_type=None, exterior_color=None, interior_color=None, city=None, state=None, seller_type=None, doors=None, engine=None, engine_size=None, engine_aspiration=None, engine_block=None, source=None, seller_name_o=None, seller_name=None, dealer_id=None, data_source=None, carfax_1_owner=None, carfax_clean_title=None): # noqa: E501
"""SearchFacets - a model defined in Swagger""" # noqa: E501
self._year = None
self._make = None
self._model = None
self._trim = None
self._trim_o = None
self._trim_r = None
self._body_type = None
self._body_subtype = None
self._vehicle_type = None
self._car_type = None
self._drivetrain = None
self._transmission = None
self._cylinders = None
self._fuel_type = None
self._exterior_color = None
self._interior_color = None
self._city = None
self._state = None
self._seller_type = None
self._doors = None
self._engine = None
self._engine_size = None
self._engine_aspiration = None
self._engine_block = None
self._source = None
self._seller_name_o = None
self._seller_name = None
self._dealer_id = None
self._data_source = None
self._carfax_1_owner = None
self._carfax_clean_title = None
self.discriminator = None
if year is not None:
self.year = year
if make is not None:
self.make = make
if model is not None:
self.model = model
if trim is not None:
self.trim = trim
if trim_o is not None:
self.trim_o = trim_o
if trim_r is not None:
self.trim_r = trim_r
if body_type is not None:
self.body_type = body_type
if body_subtype is not None:
self.body_subtype = body_subtype
if vehicle_type is not None:
self.vehicle_type = vehicle_type
if car_type is not None:
self.car_type = car_type
if drivetrain is not None:
self.drivetrain = drivetrain
if transmission is not None:
self.transmission = transmission
if cylinders is not None:
self.cylinders = cylinders
if fuel_type is not None:
self.fuel_type = fuel_type
if exterior_color is not None:
self.exterior_color = exterior_color
if interior_color is not None:
self.interior_color = interior_color
if city is not None:
self.city = city
if state is not None:
self.state = state
if seller_type is not None:
self.seller_type = seller_type
if doors is not None:
self.doors = doors
if engine is not None:
self.engine = engine
if engine_size is not None:
self.engine_size = engine_size
if engine_aspiration is not None:
self.engine_aspiration = engine_aspiration
if engine_block is not None:
self.engine_block = engine_block
if source is not None:
self.source = source
if seller_name_o is not None:
self.seller_name_o = seller_name_o
if seller_name is not None:
self.seller_name = seller_name
if dealer_id is not None:
self.dealer_id = dealer_id
if data_source is not None:
self.data_source = data_source
if carfax_1_owner is not None:
self.carfax_1_owner = carfax_1_owner
if carfax_clean_title is not None:
self.carfax_clean_title = carfax_clean_title
@property
def year(self):
"""Gets the year of this SearchFacets. # noqa: E501
:return: The year of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._year
@year.setter
def year(self, year):
"""Sets the year of this SearchFacets.
:param year: The year of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._year = year
@property
def make(self):
"""Gets the make of this SearchFacets. # noqa: E501
:return: The make of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._make
@make.setter
def make(self, make):
"""Sets the make of this SearchFacets.
:param make: The make of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._make = make
@property
def model(self):
"""Gets the model of this SearchFacets. # noqa: E501
:return: The model of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._model
@model.setter
def model(self, model):
"""Sets the model of this SearchFacets.
:param model: The model of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._model = model
@property
def trim(self):
"""Gets the trim of this SearchFacets. # noqa: E501
:return: The trim of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._trim
@trim.setter
def trim(self, trim):
"""Sets the trim of this SearchFacets.
:param trim: The trim of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._trim = trim
@property
def trim_o(self):
"""Gets the trim_o of this SearchFacets. # noqa: E501
:return: The trim_o of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._trim_o
@trim_o.setter
def trim_o(self, trim_o):
"""Sets the trim_o of this SearchFacets.
:param trim_o: The trim_o of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._trim_o = trim_o
@property
def trim_r(self):
"""Gets the trim_r of this SearchFacets. # noqa: E501
:return: The trim_r of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._trim_r
@trim_r.setter
def trim_r(self, trim_r):
"""Sets the trim_r of this SearchFacets.
:param trim_r: The trim_r of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._trim_r = trim_r
@property
def body_type(self):
"""Gets the body_type of this SearchFacets. # noqa: E501
:return: The body_type of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._body_type
@body_type.setter
def body_type(self, body_type):
"""Sets the body_type of this SearchFacets.
:param body_type: The body_type of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._body_type = body_type
@property
def body_subtype(self):
"""Gets the body_subtype of this SearchFacets. # noqa: E501
:return: The body_subtype of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._body_subtype
@body_subtype.setter
def body_subtype(self, body_subtype):
"""Sets the body_subtype of this SearchFacets.
:param body_subtype: The body_subtype of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._body_subtype = body_subtype
@property
def vehicle_type(self):
"""Gets the vehicle_type of this SearchFacets. # noqa: E501
:return: The vehicle_type of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._vehicle_type
@vehicle_type.setter
def vehicle_type(self, vehicle_type):
"""Sets the vehicle_type of this SearchFacets.
:param vehicle_type: The vehicle_type of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._vehicle_type = vehicle_type
@property
def car_type(self):
"""Gets the car_type of this SearchFacets. # noqa: E501
:return: The car_type of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._car_type
@car_type.setter
def car_type(self, car_type):
"""Sets the car_type of this SearchFacets.
:param car_type: The car_type of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._car_type = car_type
@property
def drivetrain(self):
"""Gets the drivetrain of this SearchFacets. # noqa: E501
:return: The drivetrain of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._drivetrain
@drivetrain.setter
def drivetrain(self, drivetrain):
"""Sets the drivetrain of this SearchFacets.
:param drivetrain: The drivetrain of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._drivetrain = drivetrain
@property
def transmission(self):
"""Gets the transmission of this SearchFacets. # noqa: E501
:return: The transmission of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._transmission
@transmission.setter
def transmission(self, transmission):
"""Sets the transmission of this SearchFacets.
:param transmission: The transmission of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._transmission = transmission
@property
def cylinders(self):
"""Gets the cylinders of this SearchFacets. # noqa: E501
:return: The cylinders of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._cylinders
@cylinders.setter
def cylinders(self, cylinders):
"""Sets the cylinders of this SearchFacets.
:param cylinders: The cylinders of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._cylinders = cylinders
@property
def fuel_type(self):
"""Gets the fuel_type of this SearchFacets. # noqa: E501
:return: The fuel_type of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._fuel_type
@fuel_type.setter
def fuel_type(self, fuel_type):
"""Sets the fuel_type of this SearchFacets.
:param fuel_type: The fuel_type of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._fuel_type = fuel_type
@property
def exterior_color(self):
"""Gets the exterior_color of this SearchFacets. # noqa: E501
:return: The exterior_color of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._exterior_color
@exterior_color.setter
def exterior_color(self, exterior_color):
"""Sets the exterior_color of this SearchFacets.
:param exterior_color: The exterior_color of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._exterior_color = exterior_color
@property
def interior_color(self):
"""Gets the interior_color of this SearchFacets. # noqa: E501
:return: The interior_color of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._interior_color
@interior_color.setter
def interior_color(self, interior_color):
"""Sets the interior_color of this SearchFacets.
:param interior_color: The interior_color of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._interior_color = interior_color
@property
def city(self):
"""Gets the city of this SearchFacets. # noqa: E501
:return: The city of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._city
@city.setter
def city(self, city):
"""Sets the city of this SearchFacets.
:param city: The city of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._city = city
@property
def state(self):
"""Gets the state of this SearchFacets. # noqa: E501
:return: The state of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._state
@state.setter
def state(self, state):
"""Sets the state of this SearchFacets.
:param state: The state of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._state = state
@property
def seller_type(self):
"""Gets the seller_type of this SearchFacets. # noqa: E501
:return: The seller_type of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._seller_type
@seller_type.setter
def seller_type(self, seller_type):
"""Sets the seller_type of this SearchFacets.
:param seller_type: The seller_type of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._seller_type = seller_type
@property
def doors(self):
"""Gets the doors of this SearchFacets. # noqa: E501
:return: The doors of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._doors
@doors.setter
def doors(self, doors):
"""Sets the doors of this SearchFacets.
:param doors: The doors of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._doors = doors
@property
def engine(self):
"""Gets the engine of this SearchFacets. # noqa: E501
:return: The engine of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._engine
@engine.setter
def engine(self, engine):
"""Sets the engine of this SearchFacets.
:param engine: The engine of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._engine = engine
@property
def engine_size(self):
"""Gets the engine_size of this SearchFacets. # noqa: E501
:return: The engine_size of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._engine_size
@engine_size.setter
def engine_size(self, engine_size):
"""Sets the engine_size of this SearchFacets.
:param engine_size: The engine_size of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._engine_size = engine_size
@property
def engine_aspiration(self):
"""Gets the engine_aspiration of this SearchFacets. # noqa: E501
:return: The engine_aspiration of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._engine_aspiration
@engine_aspiration.setter
def engine_aspiration(self, engine_aspiration):
"""Sets the engine_aspiration of this SearchFacets.
:param engine_aspiration: The engine_aspiration of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._engine_aspiration = engine_aspiration
@property
def engine_block(self):
"""Gets the engine_block of this SearchFacets. # noqa: E501
:return: The engine_block of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._engine_block
@engine_block.setter
def engine_block(self, engine_block):
"""Sets the engine_block of this SearchFacets.
:param engine_block: The engine_block of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._engine_block = engine_block
@property
def source(self):
"""Gets the source of this SearchFacets. # noqa: E501
:return: The source of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._source
@source.setter
def source(self, source):
"""Sets the source of this SearchFacets.
:param source: The source of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._source = source
@property
def seller_name_o(self):
"""Gets the seller_name_o of this SearchFacets. # noqa: E501
:return: The seller_name_o of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._seller_name_o
@seller_name_o.setter
def seller_name_o(self, seller_name_o):
"""Sets the seller_name_o of this SearchFacets.
:param seller_name_o: The seller_name_o of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._seller_name_o = seller_name_o
@property
def seller_name(self):
"""Gets the seller_name of this SearchFacets. # noqa: E501
:return: The seller_name of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._seller_name
@seller_name.setter
def seller_name(self, seller_name):
"""Sets the seller_name of this SearchFacets.
:param seller_name: The seller_name of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._seller_name = seller_name
@property
def dealer_id(self):
"""Gets the dealer_id of this SearchFacets. # noqa: E501
:return: The dealer_id of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._dealer_id
@dealer_id.setter
def dealer_id(self, dealer_id):
"""Sets the dealer_id of this SearchFacets.
:param dealer_id: The dealer_id of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._dealer_id = dealer_id
@property
def data_source(self):
"""Gets the data_source of this SearchFacets. # noqa: E501
:return: The data_source of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._data_source
@data_source.setter
def data_source(self, data_source):
"""Sets the data_source of this SearchFacets.
:param data_source: The data_source of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._data_source = data_source
@property
def carfax_1_owner(self):
"""Gets the carfax_1_owner of this SearchFacets. # noqa: E501
:return: The carfax_1_owner of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._carfax_1_owner
@carfax_1_owner.setter
def carfax_1_owner(self, carfax_1_owner):
"""Sets the carfax_1_owner of this SearchFacets.
:param carfax_1_owner: The carfax_1_owner of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._carfax_1_owner = carfax_1_owner
@property
def carfax_clean_title(self):
"""Gets the carfax_clean_title of this SearchFacets. # noqa: E501
:return: The carfax_clean_title of this SearchFacets. # noqa: E501
:rtype: list[FacetItem]
"""
return self._carfax_clean_title
@carfax_clean_title.setter
def carfax_clean_title(self, carfax_clean_title):
"""Sets the carfax_clean_title of this SearchFacets.
:param carfax_clean_title: The carfax_clean_title of this SearchFacets. # noqa: E501
:type: list[FacetItem]
"""
self._carfax_clean_title = carfax_clean_title
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SearchFacets):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,086 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/depreciation_stats.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DepreciationStats(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'name': 'str',
'current_value': 'float',
'one_year_from_now': 'float',
'one_year_from_now_percent': 'float',
'two_year_from_now': 'float',
'two_year_from_now_percent': 'float',
'five_year_from_now': 'float',
'five_year_from_now_percent': 'float'
}
attribute_map = {
'name': 'name',
'current_value': 'current_value',
'one_year_from_now': 'one_year_from_now',
'one_year_from_now_percent': 'one_year_from_now_percent',
'two_year_from_now': 'two_year_from_now',
'two_year_from_now_percent': 'two_year_from_now_percent',
'five_year_from_now': 'five_year_from_now',
'five_year_from_now_percent': 'five_year_from_now_percent'
}
def __init__(self, name=None, current_value=None, one_year_from_now=None, one_year_from_now_percent=None, two_year_from_now=None, two_year_from_now_percent=None, five_year_from_now=None, five_year_from_now_percent=None): # noqa: E501
"""DepreciationStats - a model defined in Swagger""" # noqa: E501
self._name = None
self._current_value = None
self._one_year_from_now = None
self._one_year_from_now_percent = None
self._two_year_from_now = None
self._two_year_from_now_percent = None
self._five_year_from_now = None
self._five_year_from_now_percent = None
self.discriminator = None
if name is not None:
self.name = name
if current_value is not None:
self.current_value = current_value
if one_year_from_now is not None:
self.one_year_from_now = one_year_from_now
if one_year_from_now_percent is not None:
self.one_year_from_now_percent = one_year_from_now_percent
if two_year_from_now is not None:
self.two_year_from_now = two_year_from_now
if two_year_from_now_percent is not None:
self.two_year_from_now_percent = two_year_from_now_percent
if five_year_from_now is not None:
self.five_year_from_now = five_year_from_now
if five_year_from_now_percent is not None:
self.five_year_from_now_percent = five_year_from_now_percent
@property
def name(self):
"""Gets the name of this DepreciationStats. # noqa: E501
ymm_comb_name # noqa: E501
:return: The name of this DepreciationStats. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this DepreciationStats.
ymm_comb_name # noqa: E501
:param name: The name of this DepreciationStats. # noqa: E501
:type: str
"""
self._name = name
@property
def current_value(self):
"""Gets the current_value of this DepreciationStats. # noqa: E501
Price of year make model combination # noqa: E501
:return: The current_value of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._current_value
@current_value.setter
def current_value(self, current_value):
"""Sets the current_value of this DepreciationStats.
Price of year make model combination # noqa: E501
:param current_value: The current_value of this DepreciationStats. # noqa: E501
:type: float
"""
self._current_value = current_value
@property
def one_year_from_now(self):
"""Gets the one_year_from_now of this DepreciationStats. # noqa: E501
price after one year from now # noqa: E501
:return: The one_year_from_now of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._one_year_from_now
@one_year_from_now.setter
def one_year_from_now(self, one_year_from_now):
"""Sets the one_year_from_now of this DepreciationStats.
price after one year from now # noqa: E501
:param one_year_from_now: The one_year_from_now of this DepreciationStats. # noqa: E501
:type: float
"""
self._one_year_from_now = one_year_from_now
@property
def one_year_from_now_percent(self):
"""Gets the one_year_from_now_percent of this DepreciationStats. # noqa: E501
price depreciation percent after one year from now # noqa: E501
:return: The one_year_from_now_percent of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._one_year_from_now_percent
@one_year_from_now_percent.setter
def one_year_from_now_percent(self, one_year_from_now_percent):
"""Sets the one_year_from_now_percent of this DepreciationStats.
price depreciation percent after one year from now # noqa: E501
:param one_year_from_now_percent: The one_year_from_now_percent of this DepreciationStats. # noqa: E501
:type: float
"""
self._one_year_from_now_percent = one_year_from_now_percent
@property
def two_year_from_now(self):
"""Gets the two_year_from_now of this DepreciationStats. # noqa: E501
price after two year from now # noqa: E501
:return: The two_year_from_now of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._two_year_from_now
@two_year_from_now.setter
def two_year_from_now(self, two_year_from_now):
"""Sets the two_year_from_now of this DepreciationStats.
price after two year from now # noqa: E501
:param two_year_from_now: The two_year_from_now of this DepreciationStats. # noqa: E501
:type: float
"""
self._two_year_from_now = two_year_from_now
@property
def two_year_from_now_percent(self):
"""Gets the two_year_from_now_percent of this DepreciationStats. # noqa: E501
price depreciation percent after two year from now # noqa: E501
:return: The two_year_from_now_percent of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._two_year_from_now_percent
@two_year_from_now_percent.setter
def two_year_from_now_percent(self, two_year_from_now_percent):
"""Sets the two_year_from_now_percent of this DepreciationStats.
price depreciation percent after two year from now # noqa: E501
:param two_year_from_now_percent: The two_year_from_now_percent of this DepreciationStats. # noqa: E501
:type: float
"""
self._two_year_from_now_percent = two_year_from_now_percent
@property
def five_year_from_now(self):
"""Gets the five_year_from_now of this DepreciationStats. # noqa: E501
price after five year from now # noqa: E501
:return: The five_year_from_now of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._five_year_from_now
@five_year_from_now.setter
def five_year_from_now(self, five_year_from_now):
"""Sets the five_year_from_now of this DepreciationStats.
price after five year from now # noqa: E501
:param five_year_from_now: The five_year_from_now of this DepreciationStats. # noqa: E501
:type: float
"""
self._five_year_from_now = five_year_from_now
@property
def five_year_from_now_percent(self):
"""Gets the five_year_from_now_percent of this DepreciationStats. # noqa: E501
price depreciation percent after five year from now # noqa: E501
:return: The five_year_from_now_percent of this DepreciationStats. # noqa: E501
:rtype: float
"""
return self._five_year_from_now_percent
@five_year_from_now_percent.setter
def five_year_from_now_percent(self, five_year_from_now_percent):
"""Sets the five_year_from_now_percent of this DepreciationStats.
price depreciation percent after five year from now # noqa: E501
:param five_year_from_now_percent: The five_year_from_now_percent of this DepreciationStats. # noqa: E501
:type: float
"""
self._five_year_from_now_percent = five_year_from_now_percent
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DepreciationStats):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,087 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/vin_decoder_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class VINDecoderApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def decode(self, vin, **kwargs): # noqa: E501
"""VIN Decoder # noqa: E501
Get the basic information on specifications for a car identified by a valid VIN # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.decode(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to decode (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Build
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.decode_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.decode_with_http_info(vin, **kwargs) # noqa: E501
return data
def decode_with_http_info(self, vin, **kwargs): # noqa: E501
"""VIN Decoder # noqa: E501
Get the basic information on specifications for a car identified by a valid VIN # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.decode_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to decode (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Build
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method decode" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `decode`") # noqa: E501
collection_formats = {}
path_params = {}
if 'vin' in params:
path_params['vin'] = params['vin'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/vin/{vin}/specs', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Build', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_economy(self, vin, **kwargs): # noqa: E501
"""Get Economy based on environmental factors # noqa: E501
[MOCK] Calculate Economy i.e. Environmental Friendliness # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_economy(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Environmental Economy data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Economy
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_economy_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_economy_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_economy_with_http_info(self, vin, **kwargs): # noqa: E501
"""Get Economy based on environmental factors # noqa: E501
[MOCK] Calculate Economy i.e. Environmental Friendliness # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_economy_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Environmental Economy data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Economy
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_economy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_economy`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/economy', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Economy', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_efficiency(self, vin, **kwargs): # noqa: E501
"""Get fuel effeciency # noqa: E501
[MOCK] Calculate fuel efficiency from taxonomy db mileage values # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_efficiency(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which fuel data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: FuelEfficiency
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_efficiency_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_efficiency_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_efficiency_with_http_info(self, vin, **kwargs): # noqa: E501
"""Get fuel effeciency # noqa: E501
[MOCK] Calculate fuel efficiency from taxonomy db mileage values # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_efficiency_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which fuel data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: FuelEfficiency
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_efficiency" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_efficiency`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/fuel_efficiency', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FuelEfficiency', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_safety_rating(self, vin, **kwargs): # noqa: E501
"""Get Safety Rating # noqa: E501
[MOCK] Get Safety ratings from third party sources # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_safety_rating(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to fetch the safety ratings (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: SafetyRating
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_safety_rating_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_safety_rating_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_safety_rating_with_http_info(self, vin, **kwargs): # noqa: E501
"""Get Safety Rating # noqa: E501
[MOCK] Get Safety ratings from third party sources # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_safety_rating_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to fetch the safety ratings (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: SafetyRating
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_safety_rating" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_safety_rating`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/safety', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SafetyRating', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,088 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/fuel_efficiency.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class FuelEfficiency(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'city_mileage': 'str',
'highway_mileage': 'str',
'combined_mileage': 'str',
'annual_miles': 'float',
'monthly_fuel_expense': 'float'
}
attribute_map = {
'city_mileage': 'city_mileage',
'highway_mileage': 'highway_mileage',
'combined_mileage': 'combined_mileage',
'annual_miles': 'annual_miles',
'monthly_fuel_expense': 'monthly_fuel_expense'
}
def __init__(self, city_mileage=None, highway_mileage=None, combined_mileage=None, annual_miles=None, monthly_fuel_expense=None): # noqa: E501
"""FuelEfficiency - a model defined in Swagger""" # noqa: E501
self._city_mileage = None
self._highway_mileage = None
self._combined_mileage = None
self._annual_miles = None
self._monthly_fuel_expense = None
self.discriminator = None
if city_mileage is not None:
self.city_mileage = city_mileage
if highway_mileage is not None:
self.highway_mileage = highway_mileage
if combined_mileage is not None:
self.combined_mileage = combined_mileage
if annual_miles is not None:
self.annual_miles = annual_miles
if monthly_fuel_expense is not None:
self.monthly_fuel_expense = monthly_fuel_expense
@property
def city_mileage(self):
"""Gets the city_mileage of this FuelEfficiency. # noqa: E501
City Mileage in MPG # noqa: E501
:return: The city_mileage of this FuelEfficiency. # noqa: E501
:rtype: str
"""
return self._city_mileage
@city_mileage.setter
def city_mileage(self, city_mileage):
"""Sets the city_mileage of this FuelEfficiency.
City Mileage in MPG # noqa: E501
:param city_mileage: The city_mileage of this FuelEfficiency. # noqa: E501
:type: str
"""
self._city_mileage = city_mileage
@property
def highway_mileage(self):
"""Gets the highway_mileage of this FuelEfficiency. # noqa: E501
Highway Mileage in MPG # noqa: E501
:return: The highway_mileage of this FuelEfficiency. # noqa: E501
:rtype: str
"""
return self._highway_mileage
@highway_mileage.setter
def highway_mileage(self, highway_mileage):
"""Sets the highway_mileage of this FuelEfficiency.
Highway Mileage in MPG # noqa: E501
:param highway_mileage: The highway_mileage of this FuelEfficiency. # noqa: E501
:type: str
"""
self._highway_mileage = highway_mileage
@property
def combined_mileage(self):
"""Gets the combined_mileage of this FuelEfficiency. # noqa: E501
Combined Mileage # noqa: E501
:return: The combined_mileage of this FuelEfficiency. # noqa: E501
:rtype: str
"""
return self._combined_mileage
@combined_mileage.setter
def combined_mileage(self, combined_mileage):
"""Sets the combined_mileage of this FuelEfficiency.
Combined Mileage # noqa: E501
:param combined_mileage: The combined_mileage of this FuelEfficiency. # noqa: E501
:type: str
"""
self._combined_mileage = combined_mileage
@property
def annual_miles(self):
"""Gets the annual_miles of this FuelEfficiency. # noqa: E501
Annual Miles of Car # noqa: E501
:return: The annual_miles of this FuelEfficiency. # noqa: E501
:rtype: float
"""
return self._annual_miles
@annual_miles.setter
def annual_miles(self, annual_miles):
"""Sets the annual_miles of this FuelEfficiency.
Annual Miles of Car # noqa: E501
:param annual_miles: The annual_miles of this FuelEfficiency. # noqa: E501
:type: float
"""
self._annual_miles = annual_miles
@property
def monthly_fuel_expense(self):
"""Gets the monthly_fuel_expense of this FuelEfficiency. # noqa: E501
Monthly fuel expense # noqa: E501
:return: The monthly_fuel_expense of this FuelEfficiency. # noqa: E501
:rtype: float
"""
return self._monthly_fuel_expense
@monthly_fuel_expense.setter
def monthly_fuel_expense(self, monthly_fuel_expense):
"""Sets the monthly_fuel_expense of this FuelEfficiency.
Monthly fuel expense # noqa: E501
:param monthly_fuel_expense: The monthly_fuel_expense of this FuelEfficiency. # noqa: E501
:type: float
"""
self._monthly_fuel_expense = monthly_fuel_expense
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, FuelEfficiency):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,089 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/crm_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class CRMApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def crm_check(self, vin, sale_date, **kwargs): # noqa: E501
"""CRM check of a particular vin # noqa: E501
Check whether particular vin has had a listing after stipulated date or not # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.crm_check(vin, sale_date, async=True)
>>> result = thread.get()
:param async bool
:param str vin: vin for which CRM check needs to be done (required)
:param str sale_date: sale date after which listing has appeared or not (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: CRMResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.crm_check_with_http_info(vin, sale_date, **kwargs) # noqa: E501
else:
(data) = self.crm_check_with_http_info(vin, sale_date, **kwargs) # noqa: E501
return data
def crm_check_with_http_info(self, vin, sale_date, **kwargs): # noqa: E501
"""CRM check of a particular vin # noqa: E501
Check whether particular vin has had a listing after stipulated date or not # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.crm_check_with_http_info(vin, sale_date, async=True)
>>> result = thread.get()
:param async bool
:param str vin: vin for which CRM check needs to be done (required)
:param str sale_date: sale date after which listing has appeared or not (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: CRMResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'sale_date', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method crm_check" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `crm_check`") # noqa: E501
# verify the required parameter 'sale_date' is set
if ('sale_date' not in params or
params['sale_date'] is None):
raise ValueError("Missing the required parameter `sale_date` when calling `crm_check`") # noqa: E501
collection_formats = {}
path_params = {}
if 'vin' in params:
path_params['vin'] = params['vin'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'sale_date' in params:
query_params.append(('sale_date', params['sale_date'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/crm_check/{vin}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CRMResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,090 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/search_stats.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from marketcheck_api_sdk.models.stats_item import StatsItem # noqa: F401,E501
class SearchStats(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'price': 'StatsItem',
'miles': 'StatsItem',
'dom': 'StatsItem',
'dom_180': 'StatsItem',
'dom_active': 'StatsItem',
'msrp': 'StatsItem',
'lease_term': 'StatsItem',
'lease_emp': 'StatsItem',
'lease_down_payment': 'StatsItem',
'finance_loan_term': 'StatsItem',
'finance_loan_apr': 'StatsItem',
'finance_emp': 'StatsItem',
'finance_down_payment': 'StatsItem',
'finance_down_payment_per': 'StatsItem'
}
attribute_map = {
'price': 'price',
'miles': 'miles',
'dom': 'dom',
'dom_180': 'dom_180',
'dom_active': 'dom_active',
'msrp': 'msrp',
'lease_term': 'lease_term',
'lease_emp': 'lease_emp',
'lease_down_payment': 'lease_down_payment',
'finance_loan_term': 'finance_loan_term',
'finance_loan_apr': 'finance_loan_apr',
'finance_emp': 'finance_emp',
'finance_down_payment': 'finance_down_payment',
'finance_down_payment_per': 'finance_down_payment_per'
}
def __init__(self, price=None, miles=None, dom=None, dom_180=None, dom_active=None, msrp=None, lease_term=None, lease_emp=None, lease_down_payment=None, finance_loan_term=None, finance_loan_apr=None, finance_emp=None, finance_down_payment=None, finance_down_payment_per=None): # noqa: E501
"""SearchStats - a model defined in Swagger""" # noqa: E501
self._price = None
self._miles = None
self._dom = None
self._dom_180 = None
self._dom_active = None
self._msrp = None
self._lease_term = None
self._lease_emp = None
self._lease_down_payment = None
self._finance_loan_term = None
self._finance_loan_apr = None
self._finance_emp = None
self._finance_down_payment = None
self._finance_down_payment_per = None
self.discriminator = None
if price is not None:
self.price = price
if miles is not None:
self.miles = miles
if dom is not None:
self.dom = dom
if dom_180 is not None:
self.dom_180 = dom_180
if dom_active is not None:
self.dom_active = dom_active
if msrp is not None:
self.msrp = msrp
if lease_term is not None:
self.lease_term = lease_term
if lease_emp is not None:
self.lease_emp = lease_emp
if lease_down_payment is not None:
self.lease_down_payment = lease_down_payment
if finance_loan_term is not None:
self.finance_loan_term = finance_loan_term
if finance_loan_apr is not None:
self.finance_loan_apr = finance_loan_apr
if finance_emp is not None:
self.finance_emp = finance_emp
if finance_down_payment is not None:
self.finance_down_payment = finance_down_payment
if finance_down_payment_per is not None:
self.finance_down_payment_per = finance_down_payment_per
@property
def price(self):
"""Gets the price of this SearchStats. # noqa: E501
:return: The price of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._price
@price.setter
def price(self, price):
"""Sets the price of this SearchStats.
:param price: The price of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._price = price
@property
def miles(self):
"""Gets the miles of this SearchStats. # noqa: E501
:return: The miles of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._miles
@miles.setter
def miles(self, miles):
"""Sets the miles of this SearchStats.
:param miles: The miles of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._miles = miles
@property
def dom(self):
"""Gets the dom of this SearchStats. # noqa: E501
:return: The dom of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._dom
@dom.setter
def dom(self, dom):
"""Sets the dom of this SearchStats.
:param dom: The dom of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._dom = dom
@property
def dom_180(self):
"""Gets the dom_180 of this SearchStats. # noqa: E501
:return: The dom_180 of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._dom_180
@dom_180.setter
def dom_180(self, dom_180):
"""Sets the dom_180 of this SearchStats.
:param dom_180: The dom_180 of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._dom_180 = dom_180
@property
def dom_active(self):
"""Gets the dom_active of this SearchStats. # noqa: E501
:return: The dom_active of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._dom_active
@dom_active.setter
def dom_active(self, dom_active):
"""Sets the dom_active of this SearchStats.
:param dom_active: The dom_active of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._dom_active = dom_active
@property
def msrp(self):
"""Gets the msrp of this SearchStats. # noqa: E501
:return: The msrp of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._msrp
@msrp.setter
def msrp(self, msrp):
"""Sets the msrp of this SearchStats.
:param msrp: The msrp of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._msrp = msrp
@property
def lease_term(self):
"""Gets the lease_term of this SearchStats. # noqa: E501
:return: The lease_term of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._lease_term
@lease_term.setter
def lease_term(self, lease_term):
"""Sets the lease_term of this SearchStats.
:param lease_term: The lease_term of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._lease_term = lease_term
@property
def lease_emp(self):
"""Gets the lease_emp of this SearchStats. # noqa: E501
:return: The lease_emp of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._lease_emp
@lease_emp.setter
def lease_emp(self, lease_emp):
"""Sets the lease_emp of this SearchStats.
:param lease_emp: The lease_emp of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._lease_emp = lease_emp
@property
def lease_down_payment(self):
"""Gets the lease_down_payment of this SearchStats. # noqa: E501
:return: The lease_down_payment of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._lease_down_payment
@lease_down_payment.setter
def lease_down_payment(self, lease_down_payment):
"""Sets the lease_down_payment of this SearchStats.
:param lease_down_payment: The lease_down_payment of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._lease_down_payment = lease_down_payment
@property
def finance_loan_term(self):
"""Gets the finance_loan_term of this SearchStats. # noqa: E501
:return: The finance_loan_term of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._finance_loan_term
@finance_loan_term.setter
def finance_loan_term(self, finance_loan_term):
"""Sets the finance_loan_term of this SearchStats.
:param finance_loan_term: The finance_loan_term of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._finance_loan_term = finance_loan_term
@property
def finance_loan_apr(self):
"""Gets the finance_loan_apr of this SearchStats. # noqa: E501
:return: The finance_loan_apr of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._finance_loan_apr
@finance_loan_apr.setter
def finance_loan_apr(self, finance_loan_apr):
"""Sets the finance_loan_apr of this SearchStats.
:param finance_loan_apr: The finance_loan_apr of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._finance_loan_apr = finance_loan_apr
@property
def finance_emp(self):
"""Gets the finance_emp of this SearchStats. # noqa: E501
:return: The finance_emp of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._finance_emp
@finance_emp.setter
def finance_emp(self, finance_emp):
"""Sets the finance_emp of this SearchStats.
:param finance_emp: The finance_emp of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._finance_emp = finance_emp
@property
def finance_down_payment(self):
"""Gets the finance_down_payment of this SearchStats. # noqa: E501
:return: The finance_down_payment of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._finance_down_payment
@finance_down_payment.setter
def finance_down_payment(self, finance_down_payment):
"""Sets the finance_down_payment of this SearchStats.
:param finance_down_payment: The finance_down_payment of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._finance_down_payment = finance_down_payment
@property
def finance_down_payment_per(self):
"""Gets the finance_down_payment_per of this SearchStats. # noqa: E501
:return: The finance_down_payment_per of this SearchStats. # noqa: E501
:rtype: StatsItem
"""
return self._finance_down_payment_per
@finance_down_payment_per.setter
def finance_down_payment_per(self, finance_down_payment_per):
"""Sets the finance_down_payment_per of this SearchStats.
:param finance_down_payment_per: The finance_down_payment_per of this SearchStats. # noqa: E501
:type: StatsItem
"""
self._finance_down_payment_per = finance_down_payment_per
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SearchStats):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,091 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/stats_item.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class StatsItem(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'min': 'int',
'max': 'int',
'count': 'int',
'missing': 'int',
'sum': 'int',
'mean': 'float',
'stddev': 'float',
'sum_of_squares': 'float',
'median': 'float'
}
attribute_map = {
'min': 'min',
'max': 'max',
'count': 'count',
'missing': 'missing',
'sum': 'sum',
'mean': 'mean',
'stddev': 'stddev',
'sum_of_squares': 'sum_of_squares',
'median': 'median'
}
def __init__(self, min=None, max=None, count=None, missing=None, sum=None, mean=None, stddev=None, sum_of_squares=None, median=None): # noqa: E501
"""StatsItem - a model defined in Swagger""" # noqa: E501
self._min = None
self._max = None
self._count = None
self._missing = None
self._sum = None
self._mean = None
self._stddev = None
self._sum_of_squares = None
self._median = None
self.discriminator = None
if min is not None:
self.min = min
if max is not None:
self.max = max
if count is not None:
self.count = count
if missing is not None:
self.missing = missing
if sum is not None:
self.sum = sum
if mean is not None:
self.mean = mean
if stddev is not None:
self.stddev = stddev
if sum_of_squares is not None:
self.sum_of_squares = sum_of_squares
if median is not None:
self.median = median
@property
def min(self):
"""Gets the min of this StatsItem. # noqa: E501
Minimum value of the field # noqa: E501
:return: The min of this StatsItem. # noqa: E501
:rtype: int
"""
return self._min
@min.setter
def min(self, min):
"""Sets the min of this StatsItem.
Minimum value of the field # noqa: E501
:param min: The min of this StatsItem. # noqa: E501
:type: int
"""
self._min = min
@property
def max(self):
"""Gets the max of this StatsItem. # noqa: E501
Maximum value of the field # noqa: E501
:return: The max of this StatsItem. # noqa: E501
:rtype: int
"""
return self._max
@max.setter
def max(self, max):
"""Sets the max of this StatsItem.
Maximum value of the field # noqa: E501
:param max: The max of this StatsItem. # noqa: E501
:type: int
"""
self._max = max
@property
def count(self):
"""Gets the count of this StatsItem. # noqa: E501
count # noqa: E501
:return: The count of this StatsItem. # noqa: E501
:rtype: int
"""
return self._count
@count.setter
def count(self, count):
"""Sets the count of this StatsItem.
count # noqa: E501
:param count: The count of this StatsItem. # noqa: E501
:type: int
"""
self._count = count
@property
def missing(self):
"""Gets the missing of this StatsItem. # noqa: E501
count of listings missing particular field # noqa: E501
:return: The missing of this StatsItem. # noqa: E501
:rtype: int
"""
return self._missing
@missing.setter
def missing(self, missing):
"""Sets the missing of this StatsItem.
count of listings missing particular field # noqa: E501
:param missing: The missing of this StatsItem. # noqa: E501
:type: int
"""
self._missing = missing
@property
def sum(self):
"""Gets the sum of this StatsItem. # noqa: E501
Summation of all values of the field # noqa: E501
:return: The sum of this StatsItem. # noqa: E501
:rtype: int
"""
return self._sum
@sum.setter
def sum(self, sum):
"""Sets the sum of this StatsItem.
Summation of all values of the field # noqa: E501
:param sum: The sum of this StatsItem. # noqa: E501
:type: int
"""
self._sum = sum
@property
def mean(self):
"""Gets the mean of this StatsItem. # noqa: E501
Mean of the field # noqa: E501
:return: The mean of this StatsItem. # noqa: E501
:rtype: float
"""
return self._mean
@mean.setter
def mean(self, mean):
"""Sets the mean of this StatsItem.
Mean of the field # noqa: E501
:param mean: The mean of this StatsItem. # noqa: E501
:type: float
"""
self._mean = mean
@property
def stddev(self):
"""Gets the stddev of this StatsItem. # noqa: E501
stddev of the field # noqa: E501
:return: The stddev of this StatsItem. # noqa: E501
:rtype: float
"""
return self._stddev
@stddev.setter
def stddev(self, stddev):
"""Sets the stddev of this StatsItem.
stddev of the field # noqa: E501
:param stddev: The stddev of this StatsItem. # noqa: E501
:type: float
"""
self._stddev = stddev
@property
def sum_of_squares(self):
"""Gets the sum_of_squares of this StatsItem. # noqa: E501
sum_of_squares of the field # noqa: E501
:return: The sum_of_squares of this StatsItem. # noqa: E501
:rtype: float
"""
return self._sum_of_squares
@sum_of_squares.setter
def sum_of_squares(self, sum_of_squares):
"""Sets the sum_of_squares of this StatsItem.
sum_of_squares of the field # noqa: E501
:param sum_of_squares: The sum_of_squares of this StatsItem. # noqa: E501
:type: float
"""
self._sum_of_squares = sum_of_squares
@property
def median(self):
"""Gets the median of this StatsItem. # noqa: E501
median of the field # noqa: E501
:return: The median of this StatsItem. # noqa: E501
:rtype: float
"""
return self._median
@median.setter
def median(self, median):
"""Sets the median of this StatsItem.
median of the field # noqa: E501
:param median: The median of this StatsItem. # noqa: E501
:type: float
"""
self._median = median
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, StatsItem):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,092 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/__init__.py | # coding: utf-8
# flake8: noqa
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import apis into sdk package
from marketcheck_api_sdk.api.crm_api import CRMApi
from marketcheck_api_sdk.api.dealer_api import DealerApi
from marketcheck_api_sdk.api.facets_api import FacetsApi
from marketcheck_api_sdk.api.graphs_api import GraphsApi
from marketcheck_api_sdk.api.history_api import HistoryApi
from marketcheck_api_sdk.api.inventory_api import InventoryApi
from marketcheck_api_sdk.api.listings_api import ListingsApi
from marketcheck_api_sdk.api.market_api import MarketApi
from marketcheck_api_sdk.api.vin_decoder_api import VINDecoderApi
# import ApiClient
from marketcheck_api_sdk.api_client import ApiClient
from marketcheck_api_sdk.configuration import Configuration
# import models into sdk package
from marketcheck_api_sdk.models.averages import Averages
from marketcheck_api_sdk.models.base_listing import BaseListing
from marketcheck_api_sdk.models.build import Build
from marketcheck_api_sdk.models.crm_response import CRMResponse
from marketcheck_api_sdk.models.comparison_point import ComparisonPoint
from marketcheck_api_sdk.models.competitors_car_details import CompetitorsCarDetails
from marketcheck_api_sdk.models.competitors_point import CompetitorsPoint
from marketcheck_api_sdk.models.competitors_same_cars import CompetitorsSameCars
from marketcheck_api_sdk.models.competitors_similar_cars import CompetitorsSimilarCars
from marketcheck_api_sdk.models.dealer import Dealer
from marketcheck_api_sdk.models.dealer_landing_page import DealerLandingPage
from marketcheck_api_sdk.models.dealer_rating import DealerRating
from marketcheck_api_sdk.models.dealer_review import DealerReview
from marketcheck_api_sdk.models.dealers_response import DealersResponse
from marketcheck_api_sdk.models.depreciation_point import DepreciationPoint
from marketcheck_api_sdk.models.depreciation_stats import DepreciationStats
from marketcheck_api_sdk.models.economy import Economy
from marketcheck_api_sdk.models.error import Error
from marketcheck_api_sdk.models.facet_item import FacetItem
from marketcheck_api_sdk.models.fuel_efficiency import FuelEfficiency
from marketcheck_api_sdk.models.historical_listing import HistoricalListing
from marketcheck_api_sdk.models.listing import Listing
from marketcheck_api_sdk.models.listing_debug_attributes import ListingDebugAttributes
from marketcheck_api_sdk.models.listing_extra_attributes import ListingExtraAttributes
from marketcheck_api_sdk.models.listing_finance import ListingFinance
from marketcheck_api_sdk.models.listing_lease import ListingLease
from marketcheck_api_sdk.models.listing_media import ListingMedia
from marketcheck_api_sdk.models.listing_nest_extra_attributes import ListingNestExtraAttributes
from marketcheck_api_sdk.models.listing_nest_media import ListingNestMedia
from marketcheck_api_sdk.models.listing_vdp import ListingVDP
from marketcheck_api_sdk.models.location import Location
from marketcheck_api_sdk.models.make_model import MakeModel
from marketcheck_api_sdk.models.mds import Mds
from marketcheck_api_sdk.models.nest_dealer import NestDealer
from marketcheck_api_sdk.models.plot_point import PlotPoint
from marketcheck_api_sdk.models.popularity_item import PopularityItem
from marketcheck_api_sdk.models.rating_components import RatingComponents
from marketcheck_api_sdk.models.review_components import ReviewComponents
from marketcheck_api_sdk.models.safety_rating import SafetyRating
from marketcheck_api_sdk.models.sales import Sales
from marketcheck_api_sdk.models.sales_stats import SalesStats
from marketcheck_api_sdk.models.search_facets import SearchFacets
from marketcheck_api_sdk.models.search_response import SearchResponse
from marketcheck_api_sdk.models.search_stats import SearchStats
from marketcheck_api_sdk.models.stats_item import StatsItem
from marketcheck_api_sdk.models.trend_point import TrendPoint
from marketcheck_api_sdk.models.vin_report import VinReport
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,093 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/market_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class MarketApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_averages(self, vin, **kwargs): # noqa: E501
"""[MOCK] Get Averages for YMM # noqa: E501
[Merged with the /search API - Please check the 'stats' parameter to the Search API above] Get market averages for price / miles / msrp / dom (days on market) fields for active cars matching the given reference VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_averages(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which averages data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:param str fields: Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, msrp, dom (days on market)
:return: Averages
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_averages_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_averages_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_averages_with_http_info(self, vin, **kwargs): # noqa: E501
"""[MOCK] Get Averages for YMM # noqa: E501
[Merged with the /search API - Please check the 'stats' parameter to the Search API above] Get market averages for price / miles / msrp / dom (days on market) fields for active cars matching the given reference VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_averages_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which averages data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:param str fields: Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, msrp, dom (days on market)
:return: Averages
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key', 'year', 'make', 'model', 'trim', 'fields'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_averages" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_averages`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
if 'year' in params:
query_params.append(('year', params['year'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'model' in params:
query_params.append(('model', params['model'])) # noqa: E501
if 'trim' in params:
query_params.append(('trim', params['trim'])) # noqa: E501
if 'fields' in params:
query_params.append(('fields', params['fields'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/averages', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Averages', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_comparison(self, vin, **kwargs): # noqa: E501
"""Compare market # noqa: E501
[MOCK] Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_comparison(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which comparison data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ComparisonPoint
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_comparison_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_comparison_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_comparison_with_http_info(self, vin, **kwargs): # noqa: E501
"""Compare market # noqa: E501
[MOCK] Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_comparison_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which comparison data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ComparisonPoint
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_comparison" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_comparison`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/comparison', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ComparisonPoint', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_competition(self, vin, **kwargs): # noqa: E501
"""Competitors # noqa: E501
[MOCK] Competitor cars in market for current vin # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_competition(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which competitors data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: CompetitorsPoint
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_competition_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_competition_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_competition_with_http_info(self, vin, **kwargs): # noqa: E501
"""Competitors # noqa: E501
[MOCK] Competitor cars in market for current vin # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_competition_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which competitors data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: CompetitorsPoint
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_competition" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_competition`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/competition', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CompetitorsPoint', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_depreciation(self, vin, **kwargs): # noqa: E501
"""Depreciation # noqa: E501
[MOCK] Model resale value based on depreciation # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_depreciation(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Depreciation stats is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: DepreciationPoint
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_depreciation_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_depreciation_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_depreciation_with_http_info(self, vin, **kwargs): # noqa: E501
"""Depreciation # noqa: E501
[MOCK] Model resale value based on depreciation # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_depreciation_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Depreciation stats is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: DepreciationPoint
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_depreciation" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_depreciation`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/depreciation', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DepreciationPoint', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_mds(self, vin, **kwargs): # noqa: E501
"""Market Days Supply # noqa: E501
Get the basic information on specifications for a car identified by a valid VIN # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_mds(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to decode (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param bool exact: Exact parameter
:param float latitude: Latitude component of location
:param float longitude: Longitude component of location
:param int radius: Radius around the search location
:param int debug: Debug parameter
:param bool include_sold: To fetch sold vins
:return: Mds
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_mds_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_mds_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_mds_with_http_info(self, vin, **kwargs): # noqa: E501
"""Market Days Supply # noqa: E501
Get the basic information on specifications for a car identified by a valid VIN # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_mds_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN to decode (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param bool exact: Exact parameter
:param float latitude: Latitude component of location
:param float longitude: Longitude component of location
:param int radius: Radius around the search location
:param int debug: Debug parameter
:param bool include_sold: To fetch sold vins
:return: Mds
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key', 'exact', 'latitude', 'longitude', 'radius', 'debug', 'include_sold'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_mds" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_mds`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
if 'exact' in params:
query_params.append(('exact', params['exact'])) # noqa: E501
if 'latitude' in params:
query_params.append(('latitude', params['latitude'])) # noqa: E501
if 'longitude' in params:
query_params.append(('longitude', params['longitude'])) # noqa: E501
if 'radius' in params:
query_params.append(('radius', params['radius'])) # noqa: E501
if 'debug' in params:
query_params.append(('debug', params['debug'])) # noqa: E501
if 'include_sold' in params:
query_params.append(('include_sold', params['include_sold'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/mds', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Mds', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_popularity(self, year, make, model, trim, body_type, **kwargs): # noqa: E501
"""Popularity # noqa: E501
[MOCK] [Merged with the /search API - Please check the 'popularity' parameter to the Search API above] Get the Popularity for the given simple filter criteria (by given Year, Make, Model, Trim criteria) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_popularity(year, make, model, trim, body_type, async=True)
>>> result = thread.get()
:param async bool
:param str year: Year of the car (required)
:param str make: Make of the car (required)
:param str model: Model of the Car (required)
:param str trim: Trim of the Car (required)
:param str body_type: Body type to filter the cars on. Valid values are the ones returned by body_type facets API call (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str stats: The list of fields for which stats need to be generated based on the matching listings for the search criteria. Allowed fields are - price, miles, msrp, dom The stats consists of mean, max, average and count of listings based on which the stats are calculated for the field. Stats could be requested in addition to the listings for the search. Please note - The API calls with the stats fields may take longer to respond.
:return: list[PopularityItem]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_popularity_with_http_info(year, make, model, trim, body_type, **kwargs) # noqa: E501
else:
(data) = self.get_popularity_with_http_info(year, make, model, trim, body_type, **kwargs) # noqa: E501
return data
def get_popularity_with_http_info(self, year, make, model, trim, body_type, **kwargs): # noqa: E501
"""Popularity # noqa: E501
[MOCK] [Merged with the /search API - Please check the 'popularity' parameter to the Search API above] Get the Popularity for the given simple filter criteria (by given Year, Make, Model, Trim criteria) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_popularity_with_http_info(year, make, model, trim, body_type, async=True)
>>> result = thread.get()
:param async bool
:param str year: Year of the car (required)
:param str make: Make of the car (required)
:param str model: Model of the Car (required)
:param str trim: Trim of the Car (required)
:param str body_type: Body type to filter the cars on. Valid values are the ones returned by body_type facets API call (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str stats: The list of fields for which stats need to be generated based on the matching listings for the search criteria. Allowed fields are - price, miles, msrp, dom The stats consists of mean, max, average and count of listings based on which the stats are calculated for the field. Stats could be requested in addition to the listings for the search. Please note - The API calls with the stats fields may take longer to respond.
:return: list[PopularityItem]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['year', 'make', 'model', 'trim', 'body_type', 'api_key', 'stats'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_popularity" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'year' is set
if ('year' not in params or
params['year'] is None):
raise ValueError("Missing the required parameter `year` when calling `get_popularity`") # noqa: E501
# verify the required parameter 'make' is set
if ('make' not in params or
params['make'] is None):
raise ValueError("Missing the required parameter `make` when calling `get_popularity`") # noqa: E501
# verify the required parameter 'model' is set
if ('model' not in params or
params['model'] is None):
raise ValueError("Missing the required parameter `model` when calling `get_popularity`") # noqa: E501
# verify the required parameter 'trim' is set
if ('trim' not in params or
params['trim'] is None):
raise ValueError("Missing the required parameter `trim` when calling `get_popularity`") # noqa: E501
# verify the required parameter 'body_type' is set
if ('body_type' not in params or
params['body_type'] is None):
raise ValueError("Missing the required parameter `body_type` when calling `get_popularity`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'year' in params:
query_params.append(('year', params['year'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'model' in params:
query_params.append(('model', params['model'])) # noqa: E501
if 'trim' in params:
query_params.append(('trim', params['trim'])) # noqa: E501
if 'body_type' in params:
query_params.append(('body_type', params['body_type'])) # noqa: E501
if 'stats' in params:
query_params.append(('stats', params['stats'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/popularity', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[PopularityItem]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_sales_count(self, **kwargs): # noqa: E501
"""Get sales count by make, model, year, trim or taxonomy vin # noqa: E501
Get a sales count for city, state or national level by make, model, year, trim or taxonomy vin # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_sales_count(async=True)
>>> result = thread.get()
:param async bool
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str car_type: Inventory type for which sales count is to be searched, default is used
:param str make: Make for which sales count is to be searched
:param str mm: Make-Model for which sales count is to be searched, pipe seperated like mm=ford|f-150
:param str ymm: Year-Make-Model for which sales count is to be searched, pipe seperated like ymm=2015|ford|f-150
:param str ymmt: Year-Make-Model-Trim for which sales count is to be searched, pipe seperated like ymmt=2015|ford|f-150|platinum
:param str taxonomy_vin: taxonomy_vin for which sales count is to be searched
:param str state: State level sales count
:param str city_state: City level sales count, pipe seperated like city_state=jacksonville|FL
:param str stats: Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, dom (days on market) OR all
:return: Sales
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_sales_count_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_sales_count_with_http_info(**kwargs) # noqa: E501
return data
def get_sales_count_with_http_info(self, **kwargs): # noqa: E501
"""Get sales count by make, model, year, trim or taxonomy vin # noqa: E501
Get a sales count for city, state or national level by make, model, year, trim or taxonomy vin # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_sales_count_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str car_type: Inventory type for which sales count is to be searched, default is used
:param str make: Make for which sales count is to be searched
:param str mm: Make-Model for which sales count is to be searched, pipe seperated like mm=ford|f-150
:param str ymm: Year-Make-Model for which sales count is to be searched, pipe seperated like ymm=2015|ford|f-150
:param str ymmt: Year-Make-Model-Trim for which sales count is to be searched, pipe seperated like ymmt=2015|ford|f-150|platinum
:param str taxonomy_vin: taxonomy_vin for which sales count is to be searched
:param str state: State level sales count
:param str city_state: City level sales count, pipe seperated like city_state=jacksonville|FL
:param str stats: Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, dom (days on market) OR all
:return: Sales
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['api_key', 'car_type', 'make', 'mm', 'ymm', 'ymmt', 'taxonomy_vin', 'state', 'city_state', 'stats'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_sales_count" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'car_type' in params:
query_params.append(('car_type', params['car_type'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'mm' in params:
query_params.append(('mm', params['mm'])) # noqa: E501
if 'ymm' in params:
query_params.append(('ymm', params['ymm'])) # noqa: E501
if 'ymmt' in params:
query_params.append(('ymmt', params['ymmt'])) # noqa: E501
if 'taxonomy_vin' in params:
query_params.append(('taxonomy_vin', params['taxonomy_vin'])) # noqa: E501
if 'state' in params:
query_params.append(('state', params['state'])) # noqa: E501
if 'city_state' in params:
query_params.append(('city_state', params['city_state'])) # noqa: E501
if 'stats' in params:
query_params.append(('stats', params['stats'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/sales', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Sales', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_trends(self, vin, car_type, **kwargs): # noqa: E501
"""Get Trends for criteria # noqa: E501
Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_trends(vin, car_type, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which trend data is to be returned (required)
:param str car_type: Car type. Allowed values are - new / used / certified (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:return: list[TrendPoint]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_trends_with_http_info(vin, car_type, **kwargs) # noqa: E501
else:
(data) = self.get_trends_with_http_info(vin, car_type, **kwargs) # noqa: E501
return data
def get_trends_with_http_info(self, vin, car_type, **kwargs): # noqa: E501
"""Get Trends for criteria # noqa: E501
Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_trends_with_http_info(vin, car_type, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which trend data is to be returned (required)
:param str car_type: Car type. Allowed values are - new / used / certified (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str year: Year of the car
:param str make: Make of the car
:param str model: Model of the Car
:param str trim: Trim of the Car
:return: list[TrendPoint]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'car_type', 'api_key', 'year', 'make', 'model', 'trim'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_trends" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_trends`") # noqa: E501
# verify the required parameter 'car_type' is set
if ('car_type' not in params or
params['car_type'] is None):
raise ValueError("Missing the required parameter `car_type` when calling `get_trends`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
if 'car_type' in params:
query_params.append(('car_type', params['car_type'])) # noqa: E501
if 'year' in params:
query_params.append(('year', params['year'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'model' in params:
query_params.append(('model', params['model'])) # noqa: E501
if 'trim' in params:
query_params.append(('trim', params['trim'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/trends', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[TrendPoint]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,094 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/make_model.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class MakeModel(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'make': 'str',
'model': 'str'
}
attribute_map = {
'make': 'make',
'model': 'model'
}
def __init__(self, make=None, model=None): # noqa: E501
"""MakeModel - a model defined in Swagger""" # noqa: E501
self._make = None
self._model = None
self.discriminator = None
if make is not None:
self.make = make
if model is not None:
self.model = model
@property
def make(self):
"""Gets the make of this MakeModel. # noqa: E501
:return: The make of this MakeModel. # noqa: E501
:rtype: str
"""
return self._make
@make.setter
def make(self, make):
"""Sets the make of this MakeModel.
:param make: The make of this MakeModel. # noqa: E501
:type: str
"""
self._make = make
@property
def model(self):
"""Gets the model of this MakeModel. # noqa: E501
:return: The model of this MakeModel. # noqa: E501
:rtype: str
"""
return self._model
@model.setter
def model(self, model):
"""Sets the model of this MakeModel.
:param model: The model of this MakeModel. # noqa: E501
:type: str
"""
self._model = model
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, MakeModel):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,095 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/listing_nest_extra_attributes.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ListingNestExtraAttributes(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'options': 'list[str]',
'features': 'list[str]',
'electronics_f': 'list[str]',
'exterior_f': 'list[str]',
'technical_f': 'list[str]',
'standard_f': 'list[str]',
'dealer_added_f': 'list[str]',
'interior_f': 'list[str]',
'safety_f': 'list[str]',
'seller_comments': 'str'
}
attribute_map = {
'options': 'options',
'features': 'features',
'electronics_f': 'electronics_f',
'exterior_f': 'exterior_f',
'technical_f': 'technical_f',
'standard_f': 'standard_f',
'dealer_added_f': 'dealer_added_f',
'interior_f': 'interior_f',
'safety_f': 'safety_f',
'seller_comments': 'seller_comments'
}
def __init__(self, options=None, features=None, electronics_f=None, exterior_f=None, technical_f=None, standard_f=None, dealer_added_f=None, interior_f=None, safety_f=None, seller_comments=None): # noqa: E501
"""ListingNestExtraAttributes - a model defined in Swagger""" # noqa: E501
self._options = None
self._features = None
self._electronics_f = None
self._exterior_f = None
self._technical_f = None
self._standard_f = None
self._dealer_added_f = None
self._interior_f = None
self._safety_f = None
self._seller_comments = None
self.discriminator = None
if options is not None:
self.options = options
if features is not None:
self.features = features
if electronics_f is not None:
self.electronics_f = electronics_f
if exterior_f is not None:
self.exterior_f = exterior_f
if technical_f is not None:
self.technical_f = technical_f
if standard_f is not None:
self.standard_f = standard_f
if dealer_added_f is not None:
self.dealer_added_f = dealer_added_f
if interior_f is not None:
self.interior_f = interior_f
if safety_f is not None:
self.safety_f = safety_f
if seller_comments is not None:
self.seller_comments = seller_comments
@property
def options(self):
"""Gets the options of this ListingNestExtraAttributes. # noqa: E501
Installed Options of the car # noqa: E501
:return: The options of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._options
@options.setter
def options(self, options):
"""Sets the options of this ListingNestExtraAttributes.
Installed Options of the car # noqa: E501
:param options: The options of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._options = options
@property
def features(self):
"""Gets the features of this ListingNestExtraAttributes. # noqa: E501
List of Features available with the car # noqa: E501
:return: The features of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._features
@features.setter
def features(self, features):
"""Sets the features of this ListingNestExtraAttributes.
List of Features available with the car # noqa: E501
:param features: The features of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._features = features
@property
def electronics_f(self):
"""Gets the electronics_f of this ListingNestExtraAttributes. # noqa: E501
List of electronic features available with the car # noqa: E501
:return: The electronics_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._electronics_f
@electronics_f.setter
def electronics_f(self, electronics_f):
"""Sets the electronics_f of this ListingNestExtraAttributes.
List of electronic features available with the car # noqa: E501
:param electronics_f: The electronics_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._electronics_f = electronics_f
@property
def exterior_f(self):
"""Gets the exterior_f of this ListingNestExtraAttributes. # noqa: E501
List of exterior features available with the car # noqa: E501
:return: The exterior_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._exterior_f
@exterior_f.setter
def exterior_f(self, exterior_f):
"""Sets the exterior_f of this ListingNestExtraAttributes.
List of exterior features available with the car # noqa: E501
:param exterior_f: The exterior_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._exterior_f = exterior_f
@property
def technical_f(self):
"""Gets the technical_f of this ListingNestExtraAttributes. # noqa: E501
List of technical features available with the car # noqa: E501
:return: The technical_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._technical_f
@technical_f.setter
def technical_f(self, technical_f):
"""Sets the technical_f of this ListingNestExtraAttributes.
List of technical features available with the car # noqa: E501
:param technical_f: The technical_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._technical_f = technical_f
@property
def standard_f(self):
"""Gets the standard_f of this ListingNestExtraAttributes. # noqa: E501
List of standard features available with the car # noqa: E501
:return: The standard_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._standard_f
@standard_f.setter
def standard_f(self, standard_f):
"""Sets the standard_f of this ListingNestExtraAttributes.
List of standard features available with the car # noqa: E501
:param standard_f: The standard_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._standard_f = standard_f
@property
def dealer_added_f(self):
"""Gets the dealer_added_f of this ListingNestExtraAttributes. # noqa: E501
List of dealer added features available with the car # noqa: E501
:return: The dealer_added_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._dealer_added_f
@dealer_added_f.setter
def dealer_added_f(self, dealer_added_f):
"""Sets the dealer_added_f of this ListingNestExtraAttributes.
List of dealer added features available with the car # noqa: E501
:param dealer_added_f: The dealer_added_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._dealer_added_f = dealer_added_f
@property
def interior_f(self):
"""Gets the interior_f of this ListingNestExtraAttributes. # noqa: E501
List of interior features available with the car # noqa: E501
:return: The interior_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._interior_f
@interior_f.setter
def interior_f(self, interior_f):
"""Sets the interior_f of this ListingNestExtraAttributes.
List of interior features available with the car # noqa: E501
:param interior_f: The interior_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._interior_f = interior_f
@property
def safety_f(self):
"""Gets the safety_f of this ListingNestExtraAttributes. # noqa: E501
List of safety features available with the car # noqa: E501
:return: The safety_f of this ListingNestExtraAttributes. # noqa: E501
:rtype: list[str]
"""
return self._safety_f
@safety_f.setter
def safety_f(self, safety_f):
"""Sets the safety_f of this ListingNestExtraAttributes.
List of safety features available with the car # noqa: E501
:param safety_f: The safety_f of this ListingNestExtraAttributes. # noqa: E501
:type: list[str]
"""
self._safety_f = safety_f
@property
def seller_comments(self):
"""Gets the seller_comments of this ListingNestExtraAttributes. # noqa: E501
Seller comments for the car # noqa: E501
:return: The seller_comments of this ListingNestExtraAttributes. # noqa: E501
:rtype: str
"""
return self._seller_comments
@seller_comments.setter
def seller_comments(self, seller_comments):
"""Sets the seller_comments of this ListingNestExtraAttributes.
Seller comments for the car # noqa: E501
:param seller_comments: The seller_comments of this ListingNestExtraAttributes. # noqa: E501
:type: str
"""
self._seller_comments = seller_comments
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ListingNestExtraAttributes):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,096 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/listing_media.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ListingMedia(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'id': 'str',
'photo_url': 'str',
'photo_links': 'list[str]'
}
attribute_map = {
'id': 'id',
'photo_url': 'photo_url',
'photo_links': 'photo_links'
}
def __init__(self, id=None, photo_url=None, photo_links=None): # noqa: E501
"""ListingMedia - a model defined in Swagger""" # noqa: E501
self._id = None
self._photo_url = None
self._photo_links = None
self.discriminator = None
if id is not None:
self.id = id
if photo_url is not None:
self.photo_url = photo_url
if photo_links is not None:
self.photo_links = photo_links
@property
def id(self):
"""Gets the id of this ListingMedia. # noqa: E501
Unique identifier representing a specific listing from the Marketcheck database # noqa: E501
:return: The id of this ListingMedia. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ListingMedia.
Unique identifier representing a specific listing from the Marketcheck database # noqa: E501
:param id: The id of this ListingMedia. # noqa: E501
:type: str
"""
self._id = id
@property
def photo_url(self):
"""Gets the photo_url of this ListingMedia. # noqa: E501
Single photo url of the car # noqa: E501
:return: The photo_url of this ListingMedia. # noqa: E501
:rtype: str
"""
return self._photo_url
@photo_url.setter
def photo_url(self, photo_url):
"""Sets the photo_url of this ListingMedia.
Single photo url of the car # noqa: E501
:param photo_url: The photo_url of this ListingMedia. # noqa: E501
:type: str
"""
self._photo_url = photo_url
@property
def photo_links(self):
"""Gets the photo_links of this ListingMedia. # noqa: E501
A list of photo urls for the car # noqa: E501
:return: The photo_links of this ListingMedia. # noqa: E501
:rtype: list[str]
"""
return self._photo_links
@photo_links.setter
def photo_links(self, photo_links):
"""Sets the photo_links of this ListingMedia.
A list of photo urls for the car # noqa: E501
:param photo_links: The photo_links of this ListingMedia. # noqa: E501
:type: list[str]
"""
self._photo_links = photo_links
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ListingMedia):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,097 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/base_listing.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from marketcheck_api_sdk.models.build import Build # noqa: F401,E501
from marketcheck_api_sdk.models.listing_finance import ListingFinance # noqa: F401,E501
from marketcheck_api_sdk.models.listing_lease import ListingLease # noqa: F401,E501
from marketcheck_api_sdk.models.listing_nest_media import ListingNestMedia # noqa: F401,E501
from marketcheck_api_sdk.models.nest_dealer import NestDealer # noqa: F401,E501
class BaseListing(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'id': 'str',
'vin': 'str',
'heading': 'str',
'price': 'int',
'miles': 'int',
'msrp': 'int',
'data_source': 'str',
'is_certified': 'int',
'vdp_url': 'str',
'carfax_1_owner': 'bool',
'carfax_clean_title': 'bool',
'exterior_color': 'str',
'interior_color': 'str',
'dom': 'int',
'dom_180': 'int',
'dom_active': 'int',
'seller_type': 'str',
'inventory_type': 'str',
'stock_no': 'str',
'last_seen_at': 'int',
'last_seen_at_date': 'str',
'scraped_at': 'float',
'scraped_at_date': 'str',
'first_seen_at': 'int',
'first_seen_at_date': 'str',
'ref_price': 'str',
'ref_price_dt': 'int',
'ref_miles': 'str',
'ref_miles_dt': 'int',
'source': 'str',
'financing_options': 'list[ListingFinance]',
'leasing_options': 'list[ListingLease]',
'media': 'ListingNestMedia',
'dealer': 'NestDealer',
'build': 'Build',
'distance': 'float'
}
attribute_map = {
'id': 'id',
'vin': 'vin',
'heading': 'heading',
'price': 'price',
'miles': 'miles',
'msrp': 'msrp',
'data_source': 'data_source',
'is_certified': 'is_certified',
'vdp_url': 'vdp_url',
'carfax_1_owner': 'carfax_1_owner',
'carfax_clean_title': 'carfax_clean_title',
'exterior_color': 'exterior_color',
'interior_color': 'interior_color',
'dom': 'dom',
'dom_180': 'dom_180',
'dom_active': 'dom_active',
'seller_type': 'seller_type',
'inventory_type': 'inventory_type',
'stock_no': 'stock_no',
'last_seen_at': 'last_seen_at',
'last_seen_at_date': 'last_seen_at_date',
'scraped_at': 'scraped_at',
'scraped_at_date': 'scraped_at_date',
'first_seen_at': 'first_seen_at',
'first_seen_at_date': 'first_seen_at_date',
'ref_price': 'ref_price',
'ref_price_dt': 'ref_price_dt',
'ref_miles': 'ref_miles',
'ref_miles_dt': 'ref_miles_dt',
'source': 'source',
'financing_options': 'financing_options',
'leasing_options': 'leasing_options',
'media': 'media',
'dealer': 'dealer',
'build': 'build',
'distance': 'distance'
}
def __init__(self, id=None, vin=None, heading=None, price=None, miles=None, msrp=None, data_source=None, is_certified=None, vdp_url=None, carfax_1_owner=None, carfax_clean_title=None, exterior_color=None, interior_color=None, dom=None, dom_180=None, dom_active=None, seller_type=None, inventory_type=None, stock_no=None, last_seen_at=None, last_seen_at_date=None, scraped_at=None, scraped_at_date=None, first_seen_at=None, first_seen_at_date=None, ref_price=None, ref_price_dt=None, ref_miles=None, ref_miles_dt=None, source=None, financing_options=None, leasing_options=None, media=None, dealer=None, build=None, distance=None): # noqa: E501
"""BaseListing - a model defined in Swagger""" # noqa: E501
self._id = None
self._vin = None
self._heading = None
self._price = None
self._miles = None
self._msrp = None
self._data_source = None
self._is_certified = None
self._vdp_url = None
self._carfax_1_owner = None
self._carfax_clean_title = None
self._exterior_color = None
self._interior_color = None
self._dom = None
self._dom_180 = None
self._dom_active = None
self._seller_type = None
self._inventory_type = None
self._stock_no = None
self._last_seen_at = None
self._last_seen_at_date = None
self._scraped_at = None
self._scraped_at_date = None
self._first_seen_at = None
self._first_seen_at_date = None
self._ref_price = None
self._ref_price_dt = None
self._ref_miles = None
self._ref_miles_dt = None
self._source = None
self._financing_options = None
self._leasing_options = None
self._media = None
self._dealer = None
self._build = None
self._distance = None
self.discriminator = None
if id is not None:
self.id = id
if vin is not None:
self.vin = vin
if heading is not None:
self.heading = heading
if price is not None:
self.price = price
if miles is not None:
self.miles = miles
if msrp is not None:
self.msrp = msrp
if data_source is not None:
self.data_source = data_source
if is_certified is not None:
self.is_certified = is_certified
if vdp_url is not None:
self.vdp_url = vdp_url
if carfax_1_owner is not None:
self.carfax_1_owner = carfax_1_owner
if carfax_clean_title is not None:
self.carfax_clean_title = carfax_clean_title
if exterior_color is not None:
self.exterior_color = exterior_color
if interior_color is not None:
self.interior_color = interior_color
if dom is not None:
self.dom = dom
if dom_180 is not None:
self.dom_180 = dom_180
if dom_active is not None:
self.dom_active = dom_active
if seller_type is not None:
self.seller_type = seller_type
if inventory_type is not None:
self.inventory_type = inventory_type
if stock_no is not None:
self.stock_no = stock_no
if last_seen_at is not None:
self.last_seen_at = last_seen_at
if last_seen_at_date is not None:
self.last_seen_at_date = last_seen_at_date
if scraped_at is not None:
self.scraped_at = scraped_at
if scraped_at_date is not None:
self.scraped_at_date = scraped_at_date
if first_seen_at is not None:
self.first_seen_at = first_seen_at
if first_seen_at_date is not None:
self.first_seen_at_date = first_seen_at_date
if ref_price is not None:
self.ref_price = ref_price
if ref_price_dt is not None:
self.ref_price_dt = ref_price_dt
if ref_miles is not None:
self.ref_miles = ref_miles
if ref_miles_dt is not None:
self.ref_miles_dt = ref_miles_dt
if source is not None:
self.source = source
if financing_options is not None:
self.financing_options = financing_options
if leasing_options is not None:
self.leasing_options = leasing_options
if media is not None:
self.media = media
if dealer is not None:
self.dealer = dealer
if build is not None:
self.build = build
if distance is not None:
self.distance = distance
@property
def id(self):
"""Gets the id of this BaseListing. # noqa: E501
Unique identifier representing a specific listing from the Marketcheck database # noqa: E501
:return: The id of this BaseListing. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this BaseListing.
Unique identifier representing a specific listing from the Marketcheck database # noqa: E501
:param id: The id of this BaseListing. # noqa: E501
:type: str
"""
self._id = id
@property
def vin(self):
"""Gets the vin of this BaseListing. # noqa: E501
VIN for the car # noqa: E501
:return: The vin of this BaseListing. # noqa: E501
:rtype: str
"""
return self._vin
@vin.setter
def vin(self, vin):
"""Sets the vin of this BaseListing.
VIN for the car # noqa: E501
:param vin: The vin of this BaseListing. # noqa: E501
:type: str
"""
self._vin = vin
@property
def heading(self):
"""Gets the heading of this BaseListing. # noqa: E501
Listing title as displayed on the source website # noqa: E501
:return: The heading of this BaseListing. # noqa: E501
:rtype: str
"""
return self._heading
@heading.setter
def heading(self, heading):
"""Sets the heading of this BaseListing.
Listing title as displayed on the source website # noqa: E501
:param heading: The heading of this BaseListing. # noqa: E501
:type: str
"""
self._heading = heading
@property
def price(self):
"""Gets the price of this BaseListing. # noqa: E501
Asking price for the car # noqa: E501
:return: The price of this BaseListing. # noqa: E501
:rtype: int
"""
return self._price
@price.setter
def price(self, price):
"""Sets the price of this BaseListing.
Asking price for the car # noqa: E501
:param price: The price of this BaseListing. # noqa: E501
:type: int
"""
self._price = price
@property
def miles(self):
"""Gets the miles of this BaseListing. # noqa: E501
Odometer reading / reported miles usage for the car # noqa: E501
:return: The miles of this BaseListing. # noqa: E501
:rtype: int
"""
return self._miles
@miles.setter
def miles(self, miles):
"""Sets the miles of this BaseListing.
Odometer reading / reported miles usage for the car # noqa: E501
:param miles: The miles of this BaseListing. # noqa: E501
:type: int
"""
self._miles = miles
@property
def msrp(self):
"""Gets the msrp of this BaseListing. # noqa: E501
MSRP for the car # noqa: E501
:return: The msrp of this BaseListing. # noqa: E501
:rtype: int
"""
return self._msrp
@msrp.setter
def msrp(self, msrp):
"""Sets the msrp of this BaseListing.
MSRP for the car # noqa: E501
:param msrp: The msrp of this BaseListing. # noqa: E501
:type: int
"""
self._msrp = msrp
@property
def data_source(self):
"""Gets the data_source of this BaseListing. # noqa: E501
Data source of the listing # noqa: E501
:return: The data_source of this BaseListing. # noqa: E501
:rtype: str
"""
return self._data_source
@data_source.setter
def data_source(self, data_source):
"""Sets the data_source of this BaseListing.
Data source of the listing # noqa: E501
:param data_source: The data_source of this BaseListing. # noqa: E501
:type: str
"""
self._data_source = data_source
@property
def is_certified(self):
"""Gets the is_certified of this BaseListing. # noqa: E501
Certified car # noqa: E501
:return: The is_certified of this BaseListing. # noqa: E501
:rtype: int
"""
return self._is_certified
@is_certified.setter
def is_certified(self, is_certified):
"""Sets the is_certified of this BaseListing.
Certified car # noqa: E501
:param is_certified: The is_certified of this BaseListing. # noqa: E501
:type: int
"""
self._is_certified = is_certified
@property
def vdp_url(self):
"""Gets the vdp_url of this BaseListing. # noqa: E501
Vehicle Details Page url of the specific car # noqa: E501
:return: The vdp_url of this BaseListing. # noqa: E501
:rtype: str
"""
return self._vdp_url
@vdp_url.setter
def vdp_url(self, vdp_url):
"""Sets the vdp_url of this BaseListing.
Vehicle Details Page url of the specific car # noqa: E501
:param vdp_url: The vdp_url of this BaseListing. # noqa: E501
:type: str
"""
self._vdp_url = vdp_url
@property
def carfax_1_owner(self):
"""Gets the carfax_1_owner of this BaseListing. # noqa: E501
Flag to indicate whether listing is carfax_1_owner # noqa: E501
:return: The carfax_1_owner of this BaseListing. # noqa: E501
:rtype: bool
"""
return self._carfax_1_owner
@carfax_1_owner.setter
def carfax_1_owner(self, carfax_1_owner):
"""Sets the carfax_1_owner of this BaseListing.
Flag to indicate whether listing is carfax_1_owner # noqa: E501
:param carfax_1_owner: The carfax_1_owner of this BaseListing. # noqa: E501
:type: bool
"""
self._carfax_1_owner = carfax_1_owner
@property
def carfax_clean_title(self):
"""Gets the carfax_clean_title of this BaseListing. # noqa: E501
Flag to indicate whether listing is carfax_clean_title # noqa: E501
:return: The carfax_clean_title of this BaseListing. # noqa: E501
:rtype: bool
"""
return self._carfax_clean_title
@carfax_clean_title.setter
def carfax_clean_title(self, carfax_clean_title):
"""Sets the carfax_clean_title of this BaseListing.
Flag to indicate whether listing is carfax_clean_title # noqa: E501
:param carfax_clean_title: The carfax_clean_title of this BaseListing. # noqa: E501
:type: bool
"""
self._carfax_clean_title = carfax_clean_title
@property
def exterior_color(self):
"""Gets the exterior_color of this BaseListing. # noqa: E501
Exterior color of the car # noqa: E501
:return: The exterior_color of this BaseListing. # noqa: E501
:rtype: str
"""
return self._exterior_color
@exterior_color.setter
def exterior_color(self, exterior_color):
"""Sets the exterior_color of this BaseListing.
Exterior color of the car # noqa: E501
:param exterior_color: The exterior_color of this BaseListing. # noqa: E501
:type: str
"""
self._exterior_color = exterior_color
@property
def interior_color(self):
"""Gets the interior_color of this BaseListing. # noqa: E501
Interior color of the car # noqa: E501
:return: The interior_color of this BaseListing. # noqa: E501
:rtype: str
"""
return self._interior_color
@interior_color.setter
def interior_color(self, interior_color):
"""Sets the interior_color of this BaseListing.
Interior color of the car # noqa: E501
:param interior_color: The interior_color of this BaseListing. # noqa: E501
:type: str
"""
self._interior_color = interior_color
@property
def dom(self):
"""Gets the dom of this BaseListing. # noqa: E501
Days on Market value for the car based on current and historical listings found in the Marketcheck database for this car # noqa: E501
:return: The dom of this BaseListing. # noqa: E501
:rtype: int
"""
return self._dom
@dom.setter
def dom(self, dom):
"""Sets the dom of this BaseListing.
Days on Market value for the car based on current and historical listings found in the Marketcheck database for this car # noqa: E501
:param dom: The dom of this BaseListing. # noqa: E501
:type: int
"""
self._dom = dom
@property
def dom_180(self):
"""Gets the dom_180 of this BaseListing. # noqa: E501
Days on Market value for the car based on current and last 6 month listings found in the Marketcheck database for this car # noqa: E501
:return: The dom_180 of this BaseListing. # noqa: E501
:rtype: int
"""
return self._dom_180
@dom_180.setter
def dom_180(self, dom_180):
"""Sets the dom_180 of this BaseListing.
Days on Market value for the car based on current and last 6 month listings found in the Marketcheck database for this car # noqa: E501
:param dom_180: The dom_180 of this BaseListing. # noqa: E501
:type: int
"""
self._dom_180 = dom_180
@property
def dom_active(self):
"""Gets the dom_active of this BaseListing. # noqa: E501
Days on Market value for the car based on current and last 30 days listings found in the Marketcheck database for this car # noqa: E501
:return: The dom_active of this BaseListing. # noqa: E501
:rtype: int
"""
return self._dom_active
@dom_active.setter
def dom_active(self, dom_active):
"""Sets the dom_active of this BaseListing.
Days on Market value for the car based on current and last 30 days listings found in the Marketcheck database for this car # noqa: E501
:param dom_active: The dom_active of this BaseListing. # noqa: E501
:type: int
"""
self._dom_active = dom_active
@property
def seller_type(self):
"""Gets the seller_type of this BaseListing. # noqa: E501
Seller type for the car # noqa: E501
:return: The seller_type of this BaseListing. # noqa: E501
:rtype: str
"""
return self._seller_type
@seller_type.setter
def seller_type(self, seller_type):
"""Sets the seller_type of this BaseListing.
Seller type for the car # noqa: E501
:param seller_type: The seller_type of this BaseListing. # noqa: E501
:type: str
"""
self._seller_type = seller_type
@property
def inventory_type(self):
"""Gets the inventory_type of this BaseListing. # noqa: E501
Inventory type of car # noqa: E501
:return: The inventory_type of this BaseListing. # noqa: E501
:rtype: str
"""
return self._inventory_type
@inventory_type.setter
def inventory_type(self, inventory_type):
"""Sets the inventory_type of this BaseListing.
Inventory type of car # noqa: E501
:param inventory_type: The inventory_type of this BaseListing. # noqa: E501
:type: str
"""
self._inventory_type = inventory_type
@property
def stock_no(self):
"""Gets the stock_no of this BaseListing. # noqa: E501
Stock number of car in dealers inventory # noqa: E501
:return: The stock_no of this BaseListing. # noqa: E501
:rtype: str
"""
return self._stock_no
@stock_no.setter
def stock_no(self, stock_no):
"""Sets the stock_no of this BaseListing.
Stock number of car in dealers inventory # noqa: E501
:param stock_no: The stock_no of this BaseListing. # noqa: E501
:type: str
"""
self._stock_no = stock_no
@property
def last_seen_at(self):
"""Gets the last_seen_at of this BaseListing. # noqa: E501
Listing last seen at (most recent) timestamp # noqa: E501
:return: The last_seen_at of this BaseListing. # noqa: E501
:rtype: int
"""
return self._last_seen_at
@last_seen_at.setter
def last_seen_at(self, last_seen_at):
"""Sets the last_seen_at of this BaseListing.
Listing last seen at (most recent) timestamp # noqa: E501
:param last_seen_at: The last_seen_at of this BaseListing. # noqa: E501
:type: int
"""
self._last_seen_at = last_seen_at
@property
def last_seen_at_date(self):
"""Gets the last_seen_at_date of this BaseListing. # noqa: E501
Listing last seen at (most recent) date # noqa: E501
:return: The last_seen_at_date of this BaseListing. # noqa: E501
:rtype: str
"""
return self._last_seen_at_date
@last_seen_at_date.setter
def last_seen_at_date(self, last_seen_at_date):
"""Sets the last_seen_at_date of this BaseListing.
Listing last seen at (most recent) date # noqa: E501
:param last_seen_at_date: The last_seen_at_date of this BaseListing. # noqa: E501
:type: str
"""
self._last_seen_at_date = last_seen_at_date
@property
def scraped_at(self):
"""Gets the scraped_at of this BaseListing. # noqa: E501
Listing last seen at date timestamp # noqa: E501
:return: The scraped_at of this BaseListing. # noqa: E501
:rtype: float
"""
return self._scraped_at
@scraped_at.setter
def scraped_at(self, scraped_at):
"""Sets the scraped_at of this BaseListing.
Listing last seen at date timestamp # noqa: E501
:param scraped_at: The scraped_at of this BaseListing. # noqa: E501
:type: float
"""
self._scraped_at = scraped_at
@property
def scraped_at_date(self):
"""Gets the scraped_at_date of this BaseListing. # noqa: E501
Listing last seen at date # noqa: E501
:return: The scraped_at_date of this BaseListing. # noqa: E501
:rtype: str
"""
return self._scraped_at_date
@scraped_at_date.setter
def scraped_at_date(self, scraped_at_date):
"""Sets the scraped_at_date of this BaseListing.
Listing last seen at date # noqa: E501
:param scraped_at_date: The scraped_at_date of this BaseListing. # noqa: E501
:type: str
"""
self._scraped_at_date = scraped_at_date
@property
def first_seen_at(self):
"""Gets the first_seen_at of this BaseListing. # noqa: E501
Listing first seen at first scraped timestamp # noqa: E501
:return: The first_seen_at of this BaseListing. # noqa: E501
:rtype: int
"""
return self._first_seen_at
@first_seen_at.setter
def first_seen_at(self, first_seen_at):
"""Sets the first_seen_at of this BaseListing.
Listing first seen at first scraped timestamp # noqa: E501
:param first_seen_at: The first_seen_at of this BaseListing. # noqa: E501
:type: int
"""
self._first_seen_at = first_seen_at
@property
def first_seen_at_date(self):
"""Gets the first_seen_at_date of this BaseListing. # noqa: E501
Listing first seen at first scraped date # noqa: E501
:return: The first_seen_at_date of this BaseListing. # noqa: E501
:rtype: str
"""
return self._first_seen_at_date
@first_seen_at_date.setter
def first_seen_at_date(self, first_seen_at_date):
"""Sets the first_seen_at_date of this BaseListing.
Listing first seen at first scraped date # noqa: E501
:param first_seen_at_date: The first_seen_at_date of this BaseListing. # noqa: E501
:type: str
"""
self._first_seen_at_date = first_seen_at_date
@property
def ref_price(self):
"""Gets the ref_price of this BaseListing. # noqa: E501
Last reported price for the car. If the asking price value is not or is available then the last_price could perhaps be used. last_price is the price for the car listed on the source website as of last_price_dt date # noqa: E501
:return: The ref_price of this BaseListing. # noqa: E501
:rtype: str
"""
return self._ref_price
@ref_price.setter
def ref_price(self, ref_price):
"""Sets the ref_price of this BaseListing.
Last reported price for the car. If the asking price value is not or is available then the last_price could perhaps be used. last_price is the price for the car listed on the source website as of last_price_dt date # noqa: E501
:param ref_price: The ref_price of this BaseListing. # noqa: E501
:type: str
"""
self._ref_price = ref_price
@property
def ref_price_dt(self):
"""Gets the ref_price_dt of this BaseListing. # noqa: E501
The date at which the last price was reported online. This is earlier to last_seen_date # noqa: E501
:return: The ref_price_dt of this BaseListing. # noqa: E501
:rtype: int
"""
return self._ref_price_dt
@ref_price_dt.setter
def ref_price_dt(self, ref_price_dt):
"""Sets the ref_price_dt of this BaseListing.
The date at which the last price was reported online. This is earlier to last_seen_date # noqa: E501
:param ref_price_dt: The ref_price_dt of this BaseListing. # noqa: E501
:type: int
"""
self._ref_price_dt = ref_price_dt
@property
def ref_miles(self):
"""Gets the ref_miles of this BaseListing. # noqa: E501
Last Odometer reading / reported miles usage for the car. If the asking miles value is not or is available then the last_miles could perhaps be used. last_miles is the miles for the car listed on the source website as of last_miles_dt date # noqa: E501
:return: The ref_miles of this BaseListing. # noqa: E501
:rtype: str
"""
return self._ref_miles
@ref_miles.setter
def ref_miles(self, ref_miles):
"""Sets the ref_miles of this BaseListing.
Last Odometer reading / reported miles usage for the car. If the asking miles value is not or is available then the last_miles could perhaps be used. last_miles is the miles for the car listed on the source website as of last_miles_dt date # noqa: E501
:param ref_miles: The ref_miles of this BaseListing. # noqa: E501
:type: str
"""
self._ref_miles = ref_miles
@property
def ref_miles_dt(self):
"""Gets the ref_miles_dt of this BaseListing. # noqa: E501
The date at which the last miles was reported online. This is earlier to last_seen_date # noqa: E501
:return: The ref_miles_dt of this BaseListing. # noqa: E501
:rtype: int
"""
return self._ref_miles_dt
@ref_miles_dt.setter
def ref_miles_dt(self, ref_miles_dt):
"""Sets the ref_miles_dt of this BaseListing.
The date at which the last miles was reported online. This is earlier to last_seen_date # noqa: E501
:param ref_miles_dt: The ref_miles_dt of this BaseListing. # noqa: E501
:type: int
"""
self._ref_miles_dt = ref_miles_dt
@property
def source(self):
"""Gets the source of this BaseListing. # noqa: E501
Source domain of the listing # noqa: E501
:return: The source of this BaseListing. # noqa: E501
:rtype: str
"""
return self._source
@source.setter
def source(self, source):
"""Sets the source of this BaseListing.
Source domain of the listing # noqa: E501
:param source: The source of this BaseListing. # noqa: E501
:type: str
"""
self._source = source
@property
def financing_options(self):
"""Gets the financing_options of this BaseListing. # noqa: E501
Array of all finance offers for this listing # noqa: E501
:return: The financing_options of this BaseListing. # noqa: E501
:rtype: list[ListingFinance]
"""
return self._financing_options
@financing_options.setter
def financing_options(self, financing_options):
"""Sets the financing_options of this BaseListing.
Array of all finance offers for this listing # noqa: E501
:param financing_options: The financing_options of this BaseListing. # noqa: E501
:type: list[ListingFinance]
"""
self._financing_options = financing_options
@property
def leasing_options(self):
"""Gets the leasing_options of this BaseListing. # noqa: E501
Array of all finance offers for this listing # noqa: E501
:return: The leasing_options of this BaseListing. # noqa: E501
:rtype: list[ListingLease]
"""
return self._leasing_options
@leasing_options.setter
def leasing_options(self, leasing_options):
"""Sets the leasing_options of this BaseListing.
Array of all finance offers for this listing # noqa: E501
:param leasing_options: The leasing_options of this BaseListing. # noqa: E501
:type: list[ListingLease]
"""
self._leasing_options = leasing_options
@property
def media(self):
"""Gets the media of this BaseListing. # noqa: E501
Car Media Attributes - main photo link/url and photo links # noqa: E501
:return: The media of this BaseListing. # noqa: E501
:rtype: ListingNestMedia
"""
return self._media
@media.setter
def media(self, media):
"""Sets the media of this BaseListing.
Car Media Attributes - main photo link/url and photo links # noqa: E501
:param media: The media of this BaseListing. # noqa: E501
:type: ListingNestMedia
"""
self._media = media
@property
def dealer(self):
"""Gets the dealer of this BaseListing. # noqa: E501
Dealer details of listing # noqa: E501
:return: The dealer of this BaseListing. # noqa: E501
:rtype: NestDealer
"""
return self._dealer
@dealer.setter
def dealer(self, dealer):
"""Sets the dealer of this BaseListing.
Dealer details of listing # noqa: E501
:param dealer: The dealer of this BaseListing. # noqa: E501
:type: NestDealer
"""
self._dealer = dealer
@property
def build(self):
"""Gets the build of this BaseListing. # noqa: E501
:return: The build of this BaseListing. # noqa: E501
:rtype: Build
"""
return self._build
@build.setter
def build(self, build):
"""Sets the build of this BaseListing.
:param build: The build of this BaseListing. # noqa: E501
:type: Build
"""
self._build = build
@property
def distance(self):
"""Gets the distance of this BaseListing. # noqa: E501
Distance of the car's location from the specified user lcoation # noqa: E501
:return: The distance of this BaseListing. # noqa: E501
:rtype: float
"""
return self._distance
@distance.setter
def distance(self, distance):
"""Sets the distance of this BaseListing.
Distance of the car's location from the specified user lcoation # noqa: E501
:param distance: The distance of this BaseListing. # noqa: E501
:type: float
"""
self._distance = distance
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, BaseListing):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,098 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_dealer_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from pprint import pprint
import unittest
import pdb
import marketcheck_api_sdk
from marketcheck_api_sdk.api.dealer_api import DealerApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestDealerApi(unittest.TestCase):
"""DealerApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.dealer_api.DealerApi() # noqa: E501
def tearDown(self):
pass
def test_dealer_search(self):
"""Test case for dealer_search
Find car dealers around # noqa: E501
"""
api_instance = marketcheck_api_sdk.DealerApi(marketcheck_api_sdk.ApiClient())
lat_lan = [[35, -90], [40, -80], [45, -90]]
radius = ["20","30","50"]
properties = [
{
"latitude" : 35,
"longitude": -90,
"radius" : { 20 : 126,30 : 228,50 : 255 }
},
{
"latitude" : 40,
"longitude": -80,
"radius" : { 20 : 25, 30 : 97, 50 : 359 }
},
{
"latitude" : 45,
"longitude": -90,
"radius" : { 20 : 3, 30 : 34,50 : 74 }
},
]
for values in properties:
latitude = 39.73 # float | Latitude component of location
longitude = -104.99 # float | Longitude component of location
radius = 100 # int | Radius around the search location
api_key = 'YOUR API KEY' # str | The API Authentication Key. Mandatory with all API calls. (optional)
rows = 20 # float | Number of results to return. Default is 10. Max is 50 (optional)
start = 0 # float | Offset for the search results. Default is 1. (optional)
try:
for radius,dealer_cnt in values["radius"].items():
api_response = api_instance.dealer_search(values["latitude"], values["longitude"], radius, api_key=api_key) #, rows=rows, start=start)
#pprint(api_response)
#dealers = api_response.dealers
limit = 10
lower_limit = dealer_cnt - ((limit * dealer_cnt)/100)
upper_limit = dealer_cnt + ((limit * dealer_cnt)/100)
apis_daeler_cnt = api_response.num_found
assert apis_daeler_cnt >= lower_limit
assert apis_daeler_cnt <= upper_limit
except ApiException as e:
pprint("Exception when calling DealerApi->dealer_search: %s\n" % e)
pass
def test_get_dealer(self):
"""Test case for get_dealer
Dealer by id # noqa: E501
"""
api_instance = marketcheck_api_sdk.DealerApi(marketcheck_api_sdk.ApiClient())
dealer_id = ["1016810","1016017","1016710","1017138","1016732"]
try:
for dealer in dealer_id:
api_response = api_instance.get_dealer(dealer, api_key="YOUR API KEY")
assert api_response.id == dealer
except ApiException as e:
pprint("Exception when calling DealerApi->get_dealer: %s\n" % e)
pass
def test_get_dealer_active_inventory(self):
"""Test case for get_dealer_active_inventory
Dealer inventory # noqa: E501
"""
pass
def test_get_dealer_historical_inventory(self):
"""Test case for get_dealer_historical_inventory
Dealer's historical inventory # noqa: E501
"""
pass
def test_get_dealer_landing_page(self):
"""Test case for get_dealer_landing_page
Experimental: Get cached version of dealer landing page by dealer id # noqa: E501
"""
pass
def test_get_dealer_ratings(self):
"""Test case for get_dealer_ratings
Dealer's Rating # noqa: E501
"""
pass
def test_get_dealer_reviews(self):
"""Test case for get_dealer_reviews
Dealer's Review # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,099 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/build.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Build(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'year': 'int',
'make': 'str',
'model': 'str',
'trim': 'str',
'short_trim': 'str',
'body_type': 'str',
'body_subtype': 'str',
'vehicle_type': 'str',
'transmission': 'str',
'drivetrain': 'str',
'fuel_type': 'str',
'engine': 'str',
'engine_size': 'float',
'engine_block': 'str',
'doors': 'int',
'cylinders': 'int',
'made_in': 'str',
'steering_type': 'str',
'antibrake_sys': 'str',
'tank_size': 'str',
'overall_height': 'str',
'overall_length': 'str',
'overall_width': 'str',
'std_seating': 'str',
'opt_seating': 'str',
'highway_miles': 'str',
'city_miles': 'str',
'engine_measure': 'str',
'engine_aspiration': 'str',
'trim_r': 'str'
}
attribute_map = {
'year': 'year',
'make': 'make',
'model': 'model',
'trim': 'trim',
'short_trim': 'short_trim',
'body_type': 'body_type',
'body_subtype': 'body_subtype',
'vehicle_type': 'vehicle_type',
'transmission': 'transmission',
'drivetrain': 'drivetrain',
'fuel_type': 'fuel_type',
'engine': 'engine',
'engine_size': 'engine_size',
'engine_block': 'engine_block',
'doors': 'doors',
'cylinders': 'cylinders',
'made_in': 'made_in',
'steering_type': 'steering_type',
'antibrake_sys': 'antibrake_sys',
'tank_size': 'tank_size',
'overall_height': 'overall_height',
'overall_length': 'overall_length',
'overall_width': 'overall_width',
'std_seating': 'std_seating',
'opt_seating': 'opt_seating',
'highway_miles': 'highway_miles',
'city_miles': 'city_miles',
'engine_measure': 'engine_measure',
'engine_aspiration': 'engine_aspiration',
'trim_r': 'trim_r'
}
def __init__(self, year=None, make=None, model=None, trim=None, short_trim=None, body_type=None, body_subtype=None, vehicle_type=None, transmission=None, drivetrain=None, fuel_type=None, engine=None, engine_size=None, engine_block=None, doors=None, cylinders=None, made_in=None, steering_type=None, antibrake_sys=None, tank_size=None, overall_height=None, overall_length=None, overall_width=None, std_seating=None, opt_seating=None, highway_miles=None, city_miles=None, engine_measure=None, engine_aspiration=None, trim_r=None): # noqa: E501
"""Build - a model defined in Swagger""" # noqa: E501
self._year = None
self._make = None
self._model = None
self._trim = None
self._short_trim = None
self._body_type = None
self._body_subtype = None
self._vehicle_type = None
self._transmission = None
self._drivetrain = None
self._fuel_type = None
self._engine = None
self._engine_size = None
self._engine_block = None
self._doors = None
self._cylinders = None
self._made_in = None
self._steering_type = None
self._antibrake_sys = None
self._tank_size = None
self._overall_height = None
self._overall_length = None
self._overall_width = None
self._std_seating = None
self._opt_seating = None
self._highway_miles = None
self._city_miles = None
self._engine_measure = None
self._engine_aspiration = None
self._trim_r = None
self.discriminator = None
if year is not None:
self.year = year
if make is not None:
self.make = make
if model is not None:
self.model = model
if trim is not None:
self.trim = trim
if short_trim is not None:
self.short_trim = short_trim
if body_type is not None:
self.body_type = body_type
if body_subtype is not None:
self.body_subtype = body_subtype
if vehicle_type is not None:
self.vehicle_type = vehicle_type
if transmission is not None:
self.transmission = transmission
if drivetrain is not None:
self.drivetrain = drivetrain
if fuel_type is not None:
self.fuel_type = fuel_type
if engine is not None:
self.engine = engine
if engine_size is not None:
self.engine_size = engine_size
if engine_block is not None:
self.engine_block = engine_block
if doors is not None:
self.doors = doors
if cylinders is not None:
self.cylinders = cylinders
if made_in is not None:
self.made_in = made_in
if steering_type is not None:
self.steering_type = steering_type
if antibrake_sys is not None:
self.antibrake_sys = antibrake_sys
if tank_size is not None:
self.tank_size = tank_size
if overall_height is not None:
self.overall_height = overall_height
if overall_length is not None:
self.overall_length = overall_length
if overall_width is not None:
self.overall_width = overall_width
if std_seating is not None:
self.std_seating = std_seating
if opt_seating is not None:
self.opt_seating = opt_seating
if highway_miles is not None:
self.highway_miles = highway_miles
if city_miles is not None:
self.city_miles = city_miles
if engine_measure is not None:
self.engine_measure = engine_measure
if engine_aspiration is not None:
self.engine_aspiration = engine_aspiration
if trim_r is not None:
self.trim_r = trim_r
@property
def year(self):
"""Gets the year of this Build. # noqa: E501
Year of the Car # noqa: E501
:return: The year of this Build. # noqa: E501
:rtype: int
"""
return self._year
@year.setter
def year(self, year):
"""Sets the year of this Build.
Year of the Car # noqa: E501
:param year: The year of this Build. # noqa: E501
:type: int
"""
self._year = year
@property
def make(self):
"""Gets the make of this Build. # noqa: E501
Car Make # noqa: E501
:return: The make of this Build. # noqa: E501
:rtype: str
"""
return self._make
@make.setter
def make(self, make):
"""Sets the make of this Build.
Car Make # noqa: E501
:param make: The make of this Build. # noqa: E501
:type: str
"""
self._make = make
@property
def model(self):
"""Gets the model of this Build. # noqa: E501
Car model # noqa: E501
:return: The model of this Build. # noqa: E501
:rtype: str
"""
return self._model
@model.setter
def model(self, model):
"""Sets the model of this Build.
Car model # noqa: E501
:param model: The model of this Build. # noqa: E501
:type: str
"""
self._model = model
@property
def trim(self):
"""Gets the trim of this Build. # noqa: E501
Trim of the car # noqa: E501
:return: The trim of this Build. # noqa: E501
:rtype: str
"""
return self._trim
@trim.setter
def trim(self, trim):
"""Sets the trim of this Build.
Trim of the car # noqa: E501
:param trim: The trim of this Build. # noqa: E501
:type: str
"""
self._trim = trim
@property
def short_trim(self):
"""Gets the short_trim of this Build. # noqa: E501
Short trim of the car # noqa: E501
:return: The short_trim of this Build. # noqa: E501
:rtype: str
"""
return self._short_trim
@short_trim.setter
def short_trim(self, short_trim):
"""Sets the short_trim of this Build.
Short trim of the car # noqa: E501
:param short_trim: The short_trim of this Build. # noqa: E501
:type: str
"""
self._short_trim = short_trim
@property
def body_type(self):
"""Gets the body_type of this Build. # noqa: E501
Body type of the car # noqa: E501
:return: The body_type of this Build. # noqa: E501
:rtype: str
"""
return self._body_type
@body_type.setter
def body_type(self, body_type):
"""Sets the body_type of this Build.
Body type of the car # noqa: E501
:param body_type: The body_type of this Build. # noqa: E501
:type: str
"""
self._body_type = body_type
@property
def body_subtype(self):
"""Gets the body_subtype of this Build. # noqa: E501
Body subtype of the car # noqa: E501
:return: The body_subtype of this Build. # noqa: E501
:rtype: str
"""
return self._body_subtype
@body_subtype.setter
def body_subtype(self, body_subtype):
"""Sets the body_subtype of this Build.
Body subtype of the car # noqa: E501
:param body_subtype: The body_subtype of this Build. # noqa: E501
:type: str
"""
self._body_subtype = body_subtype
@property
def vehicle_type(self):
"""Gets the vehicle_type of this Build. # noqa: E501
Vehicle type of the car # noqa: E501
:return: The vehicle_type of this Build. # noqa: E501
:rtype: str
"""
return self._vehicle_type
@vehicle_type.setter
def vehicle_type(self, vehicle_type):
"""Sets the vehicle_type of this Build.
Vehicle type of the car # noqa: E501
:param vehicle_type: The vehicle_type of this Build. # noqa: E501
:type: str
"""
self._vehicle_type = vehicle_type
@property
def transmission(self):
"""Gets the transmission of this Build. # noqa: E501
Transmission of the car # noqa: E501
:return: The transmission of this Build. # noqa: E501
:rtype: str
"""
return self._transmission
@transmission.setter
def transmission(self, transmission):
"""Sets the transmission of this Build.
Transmission of the car # noqa: E501
:param transmission: The transmission of this Build. # noqa: E501
:type: str
"""
self._transmission = transmission
@property
def drivetrain(self):
"""Gets the drivetrain of this Build. # noqa: E501
Drivetrain of the car # noqa: E501
:return: The drivetrain of this Build. # noqa: E501
:rtype: str
"""
return self._drivetrain
@drivetrain.setter
def drivetrain(self, drivetrain):
"""Sets the drivetrain of this Build.
Drivetrain of the car # noqa: E501
:param drivetrain: The drivetrain of this Build. # noqa: E501
:type: str
"""
self._drivetrain = drivetrain
@property
def fuel_type(self):
"""Gets the fuel_type of this Build. # noqa: E501
Fuel type of the car # noqa: E501
:return: The fuel_type of this Build. # noqa: E501
:rtype: str
"""
return self._fuel_type
@fuel_type.setter
def fuel_type(self, fuel_type):
"""Sets the fuel_type of this Build.
Fuel type of the car # noqa: E501
:param fuel_type: The fuel_type of this Build. # noqa: E501
:type: str
"""
self._fuel_type = fuel_type
@property
def engine(self):
"""Gets the engine of this Build. # noqa: E501
Engine of the car # noqa: E501
:return: The engine of this Build. # noqa: E501
:rtype: str
"""
return self._engine
@engine.setter
def engine(self, engine):
"""Sets the engine of this Build.
Engine of the car # noqa: E501
:param engine: The engine of this Build. # noqa: E501
:type: str
"""
self._engine = engine
@property
def engine_size(self):
"""Gets the engine_size of this Build. # noqa: E501
Engine size of the car # noqa: E501
:return: The engine_size of this Build. # noqa: E501
:rtype: float
"""
return self._engine_size
@engine_size.setter
def engine_size(self, engine_size):
"""Sets the engine_size of this Build.
Engine size of the car # noqa: E501
:param engine_size: The engine_size of this Build. # noqa: E501
:type: float
"""
self._engine_size = engine_size
@property
def engine_block(self):
"""Gets the engine_block of this Build. # noqa: E501
Engine block of the car # noqa: E501
:return: The engine_block of this Build. # noqa: E501
:rtype: str
"""
return self._engine_block
@engine_block.setter
def engine_block(self, engine_block):
"""Sets the engine_block of this Build.
Engine block of the car # noqa: E501
:param engine_block: The engine_block of this Build. # noqa: E501
:type: str
"""
self._engine_block = engine_block
@property
def doors(self):
"""Gets the doors of this Build. # noqa: E501
No of doors of the car # noqa: E501
:return: The doors of this Build. # noqa: E501
:rtype: int
"""
return self._doors
@doors.setter
def doors(self, doors):
"""Sets the doors of this Build.
No of doors of the car # noqa: E501
:param doors: The doors of this Build. # noqa: E501
:type: int
"""
self._doors = doors
@property
def cylinders(self):
"""Gets the cylinders of this Build. # noqa: E501
No of cylinders of the car # noqa: E501
:return: The cylinders of this Build. # noqa: E501
:rtype: int
"""
return self._cylinders
@cylinders.setter
def cylinders(self, cylinders):
"""Sets the cylinders of this Build.
No of cylinders of the car # noqa: E501
:param cylinders: The cylinders of this Build. # noqa: E501
:type: int
"""
self._cylinders = cylinders
@property
def made_in(self):
"""Gets the made_in of this Build. # noqa: E501
Made in of the car # noqa: E501
:return: The made_in of this Build. # noqa: E501
:rtype: str
"""
return self._made_in
@made_in.setter
def made_in(self, made_in):
"""Sets the made_in of this Build.
Made in of the car # noqa: E501
:param made_in: The made_in of this Build. # noqa: E501
:type: str
"""
self._made_in = made_in
@property
def steering_type(self):
"""Gets the steering_type of this Build. # noqa: E501
Steering type of the car # noqa: E501
:return: The steering_type of this Build. # noqa: E501
:rtype: str
"""
return self._steering_type
@steering_type.setter
def steering_type(self, steering_type):
"""Sets the steering_type of this Build.
Steering type of the car # noqa: E501
:param steering_type: The steering_type of this Build. # noqa: E501
:type: str
"""
self._steering_type = steering_type
@property
def antibrake_sys(self):
"""Gets the antibrake_sys of this Build. # noqa: E501
Antibrake system of the car # noqa: E501
:return: The antibrake_sys of this Build. # noqa: E501
:rtype: str
"""
return self._antibrake_sys
@antibrake_sys.setter
def antibrake_sys(self, antibrake_sys):
"""Sets the antibrake_sys of this Build.
Antibrake system of the car # noqa: E501
:param antibrake_sys: The antibrake_sys of this Build. # noqa: E501
:type: str
"""
self._antibrake_sys = antibrake_sys
@property
def tank_size(self):
"""Gets the tank_size of this Build. # noqa: E501
Tank size of the car # noqa: E501
:return: The tank_size of this Build. # noqa: E501
:rtype: str
"""
return self._tank_size
@tank_size.setter
def tank_size(self, tank_size):
"""Sets the tank_size of this Build.
Tank size of the car # noqa: E501
:param tank_size: The tank_size of this Build. # noqa: E501
:type: str
"""
self._tank_size = tank_size
@property
def overall_height(self):
"""Gets the overall_height of this Build. # noqa: E501
Overall height of the car # noqa: E501
:return: The overall_height of this Build. # noqa: E501
:rtype: str
"""
return self._overall_height
@overall_height.setter
def overall_height(self, overall_height):
"""Sets the overall_height of this Build.
Overall height of the car # noqa: E501
:param overall_height: The overall_height of this Build. # noqa: E501
:type: str
"""
self._overall_height = overall_height
@property
def overall_length(self):
"""Gets the overall_length of this Build. # noqa: E501
Overall length of the car # noqa: E501
:return: The overall_length of this Build. # noqa: E501
:rtype: str
"""
return self._overall_length
@overall_length.setter
def overall_length(self, overall_length):
"""Sets the overall_length of this Build.
Overall length of the car # noqa: E501
:param overall_length: The overall_length of this Build. # noqa: E501
:type: str
"""
self._overall_length = overall_length
@property
def overall_width(self):
"""Gets the overall_width of this Build. # noqa: E501
Overall width of the car # noqa: E501
:return: The overall_width of this Build. # noqa: E501
:rtype: str
"""
return self._overall_width
@overall_width.setter
def overall_width(self, overall_width):
"""Sets the overall_width of this Build.
Overall width of the car # noqa: E501
:param overall_width: The overall_width of this Build. # noqa: E501
:type: str
"""
self._overall_width = overall_width
@property
def std_seating(self):
"""Gets the std_seating of this Build. # noqa: E501
Std seating of the car # noqa: E501
:return: The std_seating of this Build. # noqa: E501
:rtype: str
"""
return self._std_seating
@std_seating.setter
def std_seating(self, std_seating):
"""Sets the std_seating of this Build.
Std seating of the car # noqa: E501
:param std_seating: The std_seating of this Build. # noqa: E501
:type: str
"""
self._std_seating = std_seating
@property
def opt_seating(self):
"""Gets the opt_seating of this Build. # noqa: E501
opt seating of the car # noqa: E501
:return: The opt_seating of this Build. # noqa: E501
:rtype: str
"""
return self._opt_seating
@opt_seating.setter
def opt_seating(self, opt_seating):
"""Sets the opt_seating of this Build.
opt seating of the car # noqa: E501
:param opt_seating: The opt_seating of this Build. # noqa: E501
:type: str
"""
self._opt_seating = opt_seating
@property
def highway_miles(self):
"""Gets the highway_miles of this Build. # noqa: E501
Highway miles of the car # noqa: E501
:return: The highway_miles of this Build. # noqa: E501
:rtype: str
"""
return self._highway_miles
@highway_miles.setter
def highway_miles(self, highway_miles):
"""Sets the highway_miles of this Build.
Highway miles of the car # noqa: E501
:param highway_miles: The highway_miles of this Build. # noqa: E501
:type: str
"""
self._highway_miles = highway_miles
@property
def city_miles(self):
"""Gets the city_miles of this Build. # noqa: E501
City miles of the car # noqa: E501
:return: The city_miles of this Build. # noqa: E501
:rtype: str
"""
return self._city_miles
@city_miles.setter
def city_miles(self, city_miles):
"""Sets the city_miles of this Build.
City miles of the car # noqa: E501
:param city_miles: The city_miles of this Build. # noqa: E501
:type: str
"""
self._city_miles = city_miles
@property
def engine_measure(self):
"""Gets the engine_measure of this Build. # noqa: E501
Engine block of the car # noqa: E501
:return: The engine_measure of this Build. # noqa: E501
:rtype: str
"""
return self._engine_measure
@engine_measure.setter
def engine_measure(self, engine_measure):
"""Sets the engine_measure of this Build.
Engine block of the car # noqa: E501
:param engine_measure: The engine_measure of this Build. # noqa: E501
:type: str
"""
self._engine_measure = engine_measure
@property
def engine_aspiration(self):
"""Gets the engine_aspiration of this Build. # noqa: E501
Engine aspiration of the car # noqa: E501
:return: The engine_aspiration of this Build. # noqa: E501
:rtype: str
"""
return self._engine_aspiration
@engine_aspiration.setter
def engine_aspiration(self, engine_aspiration):
"""Sets the engine_aspiration of this Build.
Engine aspiration of the car # noqa: E501
:param engine_aspiration: The engine_aspiration of this Build. # noqa: E501
:type: str
"""
self._engine_aspiration = engine_aspiration
@property
def trim_r(self):
"""Gets the trim_r of this Build. # noqa: E501
Trim_r of the car # noqa: E501
:return: The trim_r of this Build. # noqa: E501
:rtype: str
"""
return self._trim_r
@trim_r.setter
def trim_r(self, trim_r):
"""Sets the trim_r of this Build.
Trim_r of the car # noqa: E501
:param trim_r: The trim_r of this Build. # noqa: E501
:type: str
"""
self._trim_r = trim_r
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Build):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,100 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/mds.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Mds(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'mds': 'int',
'total_active_cars_for_ymmt': 'int',
'total_cars_sold_in_last_45_days': 'int',
'sold_vins': 'list[str]',
'year': 'int',
'make': 'str',
'model': 'str',
'trim': 'str'
}
attribute_map = {
'mds': 'mds',
'total_active_cars_for_ymmt': 'total_active_cars_for_ymmt',
'total_cars_sold_in_last_45_days': 'total_cars_sold_in_last_45_days',
'sold_vins': 'sold_vins',
'year': 'year',
'make': 'make',
'model': 'model',
'trim': 'trim'
}
def __init__(self, mds=None, total_active_cars_for_ymmt=None, total_cars_sold_in_last_45_days=None, sold_vins=None, year=None, make=None, model=None, trim=None): # noqa: E501
"""Mds - a model defined in Swagger""" # noqa: E501
self._mds = None
self._total_active_cars_for_ymmt = None
self._total_cars_sold_in_last_45_days = None
self._sold_vins = None
self._year = None
self._make = None
self._model = None
self._trim = None
self.discriminator = None
if mds is not None:
self.mds = mds
if total_active_cars_for_ymmt is not None:
self.total_active_cars_for_ymmt = total_active_cars_for_ymmt
if total_cars_sold_in_last_45_days is not None:
self.total_cars_sold_in_last_45_days = total_cars_sold_in_last_45_days
if sold_vins is not None:
self.sold_vins = sold_vins
if year is not None:
self.year = year
if make is not None:
self.make = make
if model is not None:
self.model = model
if trim is not None:
self.trim = trim
@property
def mds(self):
"""Gets the mds of this Mds. # noqa: E501
Provides Market days supply count # noqa: E501
:return: The mds of this Mds. # noqa: E501
:rtype: int
"""
return self._mds
@mds.setter
def mds(self, mds):
"""Sets the mds of this Mds.
Provides Market days supply count # noqa: E501
:param mds: The mds of this Mds. # noqa: E501
:type: int
"""
self._mds = mds
@property
def total_active_cars_for_ymmt(self):
"""Gets the total_active_cars_for_ymmt of this Mds. # noqa: E501
Active cars for ymmt combination # noqa: E501
:return: The total_active_cars_for_ymmt of this Mds. # noqa: E501
:rtype: int
"""
return self._total_active_cars_for_ymmt
@total_active_cars_for_ymmt.setter
def total_active_cars_for_ymmt(self, total_active_cars_for_ymmt):
"""Sets the total_active_cars_for_ymmt of this Mds.
Active cars for ymmt combination # noqa: E501
:param total_active_cars_for_ymmt: The total_active_cars_for_ymmt of this Mds. # noqa: E501
:type: int
"""
self._total_active_cars_for_ymmt = total_active_cars_for_ymmt
@property
def total_cars_sold_in_last_45_days(self):
"""Gets the total_cars_sold_in_last_45_days of this Mds. # noqa: E501
Cars sold in last 45 days # noqa: E501
:return: The total_cars_sold_in_last_45_days of this Mds. # noqa: E501
:rtype: int
"""
return self._total_cars_sold_in_last_45_days
@total_cars_sold_in_last_45_days.setter
def total_cars_sold_in_last_45_days(self, total_cars_sold_in_last_45_days):
"""Sets the total_cars_sold_in_last_45_days of this Mds.
Cars sold in last 45 days # noqa: E501
:param total_cars_sold_in_last_45_days: The total_cars_sold_in_last_45_days of this Mds. # noqa: E501
:type: int
"""
self._total_cars_sold_in_last_45_days = total_cars_sold_in_last_45_days
@property
def sold_vins(self):
"""Gets the sold_vins of this Mds. # noqa: E501
Sold vins array # noqa: E501
:return: The sold_vins of this Mds. # noqa: E501
:rtype: list[str]
"""
return self._sold_vins
@sold_vins.setter
def sold_vins(self, sold_vins):
"""Sets the sold_vins of this Mds.
Sold vins array # noqa: E501
:param sold_vins: The sold_vins of this Mds. # noqa: E501
:type: list[str]
"""
self._sold_vins = sold_vins
@property
def year(self):
"""Gets the year of this Mds. # noqa: E501
Year of vin provided # noqa: E501
:return: The year of this Mds. # noqa: E501
:rtype: int
"""
return self._year
@year.setter
def year(self, year):
"""Sets the year of this Mds.
Year of vin provided # noqa: E501
:param year: The year of this Mds. # noqa: E501
:type: int
"""
self._year = year
@property
def make(self):
"""Gets the make of this Mds. # noqa: E501
Make of vin provided # noqa: E501
:return: The make of this Mds. # noqa: E501
:rtype: str
"""
return self._make
@make.setter
def make(self, make):
"""Sets the make of this Mds.
Make of vin provided # noqa: E501
:param make: The make of this Mds. # noqa: E501
:type: str
"""
self._make = make
@property
def model(self):
"""Gets the model of this Mds. # noqa: E501
Model of vin provided # noqa: E501
:return: The model of this Mds. # noqa: E501
:rtype: str
"""
return self._model
@model.setter
def model(self, model):
"""Sets the model of this Mds.
Model of vin provided # noqa: E501
:param model: The model of this Mds. # noqa: E501
:type: str
"""
self._model = model
@property
def trim(self):
"""Gets the trim of this Mds. # noqa: E501
Trim of vin provided # noqa: E501
:return: The trim of this Mds. # noqa: E501
:rtype: str
"""
return self._trim
@trim.setter
def trim(self, trim):
"""Sets the trim of this Mds.
Trim of vin provided # noqa: E501
:param trim: The trim of this Mds. # noqa: E501
:type: str
"""
self._trim = trim
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Mds):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,101 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/inventory_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class InventoryApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_dealer_active_inventory(self, dealer_id, **kwargs): # noqa: E501
"""Dealer inventory # noqa: E501
Get a dealer's currently active inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_active_inventory(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_active_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_active_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_active_inventory_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer inventory # noqa: E501
Get a dealer's currently active inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_active_inventory_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id', 'api_key', 'rows', 'start'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_active_inventory" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_active_inventory`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'rows' in params:
query_params.append(('rows', params['rows'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/active/inventory', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BaseListing', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_historical_inventory(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's historical inventory # noqa: E501
[v1 : Not Implemented Yet] - Get a dealer's historical inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_historical_inventory(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_historical_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_historical_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_historical_inventory_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's historical inventory # noqa: E501
[v1 : Not Implemented Yet] - Get a dealer's historical inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_historical_inventory_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_historical_inventory" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_historical_inventory`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/historical/inventory', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BaseListing', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,102 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/models/listing_finance.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ListingFinance(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'loan_term': 'int',
'loan_apr': 'float',
'down_payment': 'float',
'down_payment_percentage': 'float',
'estimated_monthly_payment': 'float'
}
attribute_map = {
'loan_term': 'loan_term',
'loan_apr': 'loan_apr',
'down_payment': 'down_payment',
'down_payment_percentage': 'down_payment_percentage',
'estimated_monthly_payment': 'estimated_monthly_payment'
}
def __init__(self, loan_term=None, loan_apr=None, down_payment=None, down_payment_percentage=None, estimated_monthly_payment=None): # noqa: E501
"""ListingFinance - a model defined in Swagger""" # noqa: E501
self._loan_term = None
self._loan_apr = None
self._down_payment = None
self._down_payment_percentage = None
self._estimated_monthly_payment = None
self.discriminator = None
if loan_term is not None:
self.loan_term = loan_term
if loan_apr is not None:
self.loan_apr = loan_apr
if down_payment is not None:
self.down_payment = down_payment
if down_payment_percentage is not None:
self.down_payment_percentage = down_payment_percentage
if estimated_monthly_payment is not None:
self.estimated_monthly_payment = estimated_monthly_payment
@property
def loan_term(self):
"""Gets the loan_term of this ListingFinance. # noqa: E501
Loan term for this finance offer # noqa: E501
:return: The loan_term of this ListingFinance. # noqa: E501
:rtype: int
"""
return self._loan_term
@loan_term.setter
def loan_term(self, loan_term):
"""Sets the loan_term of this ListingFinance.
Loan term for this finance offer # noqa: E501
:param loan_term: The loan_term of this ListingFinance. # noqa: E501
:type: int
"""
self._loan_term = loan_term
@property
def loan_apr(self):
"""Gets the loan_apr of this ListingFinance. # noqa: E501
Loan APR for this finance offer # noqa: E501
:return: The loan_apr of this ListingFinance. # noqa: E501
:rtype: float
"""
return self._loan_apr
@loan_apr.setter
def loan_apr(self, loan_apr):
"""Sets the loan_apr of this ListingFinance.
Loan APR for this finance offer # noqa: E501
:param loan_apr: The loan_apr of this ListingFinance. # noqa: E501
:type: float
"""
self._loan_apr = loan_apr
@property
def down_payment(self):
"""Gets the down_payment of this ListingFinance. # noqa: E501
Down payment for this finance offer # noqa: E501
:return: The down_payment of this ListingFinance. # noqa: E501
:rtype: float
"""
return self._down_payment
@down_payment.setter
def down_payment(self, down_payment):
"""Sets the down_payment of this ListingFinance.
Down payment for this finance offer # noqa: E501
:param down_payment: The down_payment of this ListingFinance. # noqa: E501
:type: float
"""
self._down_payment = down_payment
@property
def down_payment_percentage(self):
"""Gets the down_payment_percentage of this ListingFinance. # noqa: E501
down payment percentage for this finance offer # noqa: E501
:return: The down_payment_percentage of this ListingFinance. # noqa: E501
:rtype: float
"""
return self._down_payment_percentage
@down_payment_percentage.setter
def down_payment_percentage(self, down_payment_percentage):
"""Sets the down_payment_percentage of this ListingFinance.
down payment percentage for this finance offer # noqa: E501
:param down_payment_percentage: The down_payment_percentage of this ListingFinance. # noqa: E501
:type: float
"""
self._down_payment_percentage = down_payment_percentage
@property
def estimated_monthly_payment(self):
"""Gets the estimated_monthly_payment of this ListingFinance. # noqa: E501
estimated monthly payment for this finance offer # noqa: E501
:return: The estimated_monthly_payment of this ListingFinance. # noqa: E501
:rtype: float
"""
return self._estimated_monthly_payment
@estimated_monthly_payment.setter
def estimated_monthly_payment(self, estimated_monthly_payment):
"""Sets the estimated_monthly_payment of this ListingFinance.
estimated monthly payment for this finance offer # noqa: E501
:param estimated_monthly_payment: The estimated_monthly_payment of this ListingFinance. # noqa: E501
:type: float
"""
self._estimated_monthly_payment = estimated_monthly_payment
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ListingFinance):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,103 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_history_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from pprint import pprint
import unittest
import pdb
import itertools
import marketcheck_api_sdk
from marketcheck_api_sdk.api.history_api import HistoryApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestHistoryApi(unittest.TestCase):
"""HistoryApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.history_api.HistoryApi() # noqa: E501
def tearDown(self):
pass
def test_history(self):
"""Test case for history
Get a cars online listing history # noqa: E501
"""
api_instance = marketcheck_api_sdk.HistoryApi()
vins = ["1FTNE2CM2FKA81288","1GYS4BKJ8FR290257","3GYFNBE3XFS537500","1FT7W2BT5FEA75059","1FMCU9J90FUA21186"]
fields = ["id","vin","seller_type","inventory_type","make","price","miles","scraped_at","status_date","is_searchable","seller_name","seller_name_o","domain_id","source","group_id","grouped_at zip","is_grouped","touch_count","is_duplicate","dealer_id","latitude","longitude","city state","data_source"]
api_key = "YOUR API KEY"
missing_vins = ["2T2BK1RA1DC181616","1FTNE1DM0FKA52494","1FTEV1EG1FFB24493"]
more_record_vins = {"1FTEW1EF1FFA67753":6,"2T2BK1BA1DC181616":3}
try:
for vin in vins:
api_response = api_instance.history(vin, api_key=api_key)
#pprint(api_response)
assert len(api_response) != 0
last_seen_at_ary = []
for history in api_response:
last_seen_at_ary.append(history.last_seen_at)
assert last_seen_at_ary == sorted(last_seen_at_ary,reverse=True)
api_response = api_instance.history(vin, api_key=api_key,fields="seller_type,inventory_type,is_searchable,dealer_id,source,data_source")
for listing in api_response:
assert hasattr(listing,"source")
assert hasattr(listing,"data_source")
assert hasattr(listing,"seller_type")
assert hasattr(listing,"inventory_type")
assert hasattr(listing,"is_searchable")
assert hasattr(listing,"dealer_id")
###### Validate pagination of history API ######
for vin,page_limit in more_record_vins.iteritems():
for count in range(1,page_limit+1):
api_response = api_instance.history(vin, api_key=api_key,page=count)
last_seen_at_ary = []
for vin_obj in api_response:
last_seen_at_ary.append(vin_obj.last_seen_at)
assert len(api_response) != 0
assert last_seen_at_ary == sorted(last_seen_at_ary,reverse=True)
assert len(api_response) == len(list(set(api_response)))
if count != page_limit: assert len(api_response) == 50
####### Validate pagination exceed error in history API ######
# for vin,page_limit in more_record_vins.iteritems():
# api_response = api_instance.history(vin, api_key=api_key,page=page_limit+1)
# pdb.set_trace()
# assert api_response.code == 422
###### Validate error response when VIN is not present with us ######
# for vin in missing_vins:
# api_response = api_instance.history(vin, api_key=api_key)
# pprint(api_response)
except ApiException as e:
print("Exception when calling HistoryApi->history: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,104 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/listings_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class ListingsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_listing(self, id, **kwargs): # noqa: E501
"""Listing by id # noqa: E501
Get a particular listing by its id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Listing
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_listing_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_listing_with_http_info(id, **kwargs) # noqa: E501
return data
def get_listing_with_http_info(self, id, **kwargs): # noqa: E501
"""Listing by id # noqa: E501
Get a particular listing by its id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Listing
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_listing" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_listing`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/listing/{id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Listing', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_listing_extra(self, id, **kwargs): # noqa: E501
"""Long text Listings attributes for Listing with the given id # noqa: E501
Get listing options, features, seller comments # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_extra(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the long text listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ListingExtraAttributes
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_listing_extra_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_listing_extra_with_http_info(id, **kwargs) # noqa: E501
return data
def get_listing_extra_with_http_info(self, id, **kwargs): # noqa: E501
"""Long text Listings attributes for Listing with the given id # noqa: E501
Get listing options, features, seller comments # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_extra_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the long text listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ListingExtraAttributes
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_listing_extra" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_listing_extra`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/listing/{id}/extra', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ListingExtraAttributes', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_listing_media(self, id, **kwargs): # noqa: E501
"""Listing media by id # noqa: E501
Get listing media (photo, photos) by id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_media(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ListingMedia
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_listing_media_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_listing_media_with_http_info(id, **kwargs) # noqa: E501
return data
def get_listing_media_with_http_info(self, id, **kwargs): # noqa: E501
"""Listing media by id # noqa: E501
Get listing media (photo, photos) by id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_media_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get all the listing attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: ListingMedia
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_listing_media" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_listing_media`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/listing/{id}/media', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ListingMedia', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_listing_vdp(self, id, **kwargs): # noqa: E501
"""Get listing HTML # noqa: E501
Cached HTML of the Vehicle Details Page (VDP) for the listing. The HTML is cached only for 7 days for all listings. So this API could be used to get HTML of mostly active listings and that have recently expired # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_vdp(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get the vehicle details page (VDP) HTML (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str html: Get only HTML for given listings VDP page
:return: ListingVDP
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_listing_vdp_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_listing_vdp_with_http_info(id, **kwargs) # noqa: E501
return data
def get_listing_vdp_with_http_info(self, id, **kwargs): # noqa: E501
"""Get listing HTML # noqa: E501
Cached HTML of the Vehicle Details Page (VDP) for the listing. The HTML is cached only for 7 days for all listings. So this API could be used to get HTML of mostly active listings and that have recently expired # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_listing_vdp_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: Listing id to get the vehicle details page (VDP) HTML (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str html: Get only HTML for given listings VDP page
:return: ListingVDP
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'api_key', 'html'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_listing_vdp" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_listing_vdp`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'html' in params:
query_params.append(('html', params['html'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/listing/{id}/vdp', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ListingVDP', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_summary_report(self, vin, **kwargs): # noqa: E501
"""Get Summary Report # noqa: E501
[MOCK] Generate Summary report # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_summary_report(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Summary data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: list[VinReport]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_summary_report_with_http_info(vin, **kwargs) # noqa: E501
else:
(data) = self.get_summary_report_with_http_info(vin, **kwargs) # noqa: E501
return data
def get_summary_report_with_http_info(self, vin, **kwargs): # noqa: E501
"""Get Summary Report # noqa: E501
[MOCK] Generate Summary report # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_summary_report_with_http_info(vin, async=True)
>>> result = thread.get()
:param async bool
:param str vin: VIN as a reference to the type of car for which Summary data is to be returned (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: list[VinReport]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['vin', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_summary_report" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'vin' is set
if ('vin' not in params or
params['vin'] is None):
raise ValueError("Missing the required parameter `vin` when calling `get_summary_report`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/vin_report_summary', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[VinReport]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def search(self, **kwargs): # noqa: E501
"""Gets active car listings for the given search criteria # noqa: E501
This endpoint is the meat of the API and serves many purposes. This API produces a list of currently active cars from the market for the given search criteria. The API results are limited to allow pagination upto 1000 rows. The search API facilitates the following use cases - 1. Search Cars around a given geo-point within a given radius 2. Search cars for a specific year / make / model or combination of these 3. Search cars matching multiple year, make, model combinatins in the same search request 4. Filter results by most car specification attributes 5. Search for similar cars by VIN or Taxonomy VIN 6. Filter cars within a given price / miles / days on market (dom) range 7. Specify a sort order for the results on price / miles / dom / listed date 8. Search cars for a given City / State combination 9. Get Facets to build the search drill downs 10. Get Market averages for price/miles/dom/msrp for your search # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.search(async=True)
>>> result = thread.get()
:param async bool
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param float latitude: Latitude component of location
:param float longitude: Longitude component of location
:param int radius: Radius around the search location
:param str zip: car search bases on zipcode
:param bool include_lease: Boolean param to search for listings that include leasing options in them
:param bool include_finance: Boolean param to search for listings that include finance options in them
:param str lease_term: Search listings with exact lease term, or inside a range with min and max seperated by a dash like lease_term=30-60
:param str lease_down_payment: Search listings with exact down payment in lease offers, or inside a range with min and max seperated by a dash like lease_down_payment=30-60
:param str lease_emp: Search listings with lease offers exactly matching Estimated Monthly Payment(EMI), or inside a range with min and max seperated by a dash like lease_emp=30-60
:param str finance_loan_term: Search listings with exact finance loan term, or inside a range with min and max seperated by a dash like finance_loan_term=30-60
:param str finance_loan_apr: Search listings with finance offers exactly matching loans Annual Percentage Rate, or inside a range with min and max seperated by a dash like finance_loan_apr=30-60
:param str finance_emp: Search listings with finance offers exactly matching Estimated Monthly Payment(EMI), or inside a range with min and max seperated by a dash like finance_emp=30-60
:param str finance_down_payment: Search listings with exact down payment in finance offers, or inside a range with min and max seperated by a dash like finance_down_payment=30-60
:param str finance_down_payment_per: Search listings with exact down payment percentage in finance offers, or inside a range with min and max seperated by a dash like finance_down_payment_per=30-60
:param str car_type: Car type. Allowed values are - new / used / certified
:param str seller_type: Seller type to filter cars on. Valid filter values are those that our Search facets API returns for unique seller types. You can pass in multiple seller type values comma separated.
:param str carfax_1_owner: Indicates whether car has had only one owner or not
:param str carfax_clean_title: Indicates whether car has clean ownership records
:param str year: Car year - 1980 onwards. Valid filter values are those that our Search facets API returns for unique years. You can pass in multiple year values comma separated.
:param str make: Car Make - should be a standard OEM Make name. Valid filter values are those that our Search facets API returns for unique make. You can pass in multiple make values separated by comma. e.g. ford,audi
:param str model: Car model to search. Valid filter values are those that our Search facets API returns for unique model. You can pass in multiple model values comma separated for e.g f-150,Mustang.
:param str trim: Car trim to search. Valid filter values are those that our Search facets API returns for unique trim. You can pass in multiple trim values comma separated
:param str dealer_id: Dealer id to filter the cars.
:param str vin: Car vin to search
:param str source: Source to search cars. Valid filter values are those that our Search facets API returns for unique source. You can pass in multiple source values comma separated
:param str body_type: Body type to filter the cars on. Valid filter values are those that our Search facets API returns for unique body types. You can pass in multiple body types comma separated.
:param str body_subtype: Body subtype to filter the cars on. Valid filter values are those that our Search facets API returns for unique body subtypes. You can pass in multiple body subtype values comma separated
:param str vehicle_type: Vehicle type to filter the cars on. Valid filter values are those that our Search facets API returns for unique vehicle types. You can pass in multiple vehicle type values comma separated
:param str vins: Comma separated list of 17 digit vins to search the matching cars for. Only 10 VINs allowed per request. If the request contains more than 10 VINs the first 10 VINs will be considered. Could be used as a More Like This or Similar Vehicles search for the given VINs. Ths vins parameter is an alternative to taxonomy_vins or ymmt parameters available with the search API. vins and taxonomy_vins parameters could be used to filter our cars with the exact build represented by the vins or taxonomy_vins whereas ymmt is a top level filter that does not filter cars by the build attributes like doors, drivetrain, cylinders, body type, body subtype, vehicle type etc
:param str taxonomy_vins: Comma separated list of 10 letters excert from the 17 letter VIN. The 10 letters to be picked up from the 17 letter VIN are - first 8 letters and the 10th and 11th letter. E.g. For a VIN - 1FTFW1EF3EKE57182 the taxonomy vin would be - 1FTFW1EFEK A taxonomy VIN identified a build of a car and could be used to filter our cars of a particular build. This is an alternative to the vin or ymmt parameters to the search API.
:param str ymmt: Comma separated list of Year, Make, Model, Trim combinations. Each combination needs to have the year,make,model, trim values separated by a pipe '|' character in the form year|make|model|trim. e.g. 2010|Audi|A5,2014|Nissan|Sentra|S 6MT,|Honda|City| You could just provide strings of the form - 'year|make||' or 'year|make|model' or '|make|model|' combinations. Individual year / make / model filters provied with the API calls will take precedence over the Year, Make, Model, Trim combinations. The Make, Model, Trim values must be valid values as per the Marketcheck Vin Decoder. If you are using a separate vin decoder then look at using the 'vins' or 'taxonomy_vins' parameter to the search api instead the year|make|model|trim combinations.
:param str match: Comma separated list of Year, Make, Model, Trim fields. For example - year,make,model,trim fields for which user wants to do an exact match
:param str cylinders: Cylinders to filter the cars on. Valid filter values are those that our Search facets API returns for unique cylinder values. You can pass in multiple cylinder values comma separated
:param str transmission: Transmission to filter the cars on. [a = Automatic, m = Manual]. Valid filter values are those that our Search facets API returns for unique transmission. You can pass in multiple transmission values comma separated
:param str speeds: Speeds to filter the cars on. Valid filter values are those that our Search facets API returns for unique speeds. You can pass in multiple speeds values comma separated
:param str doors: Doors to filter the cars on. Valid filter values are those that our Search facets API returns for unique doors. You can pass in multiple doors values comma separated
:param str drivetrain: Drivetrain to filter the cars on. Valid filter values are those that our Search facets API returns for unique drivetrains. You can pass in multiple drivetrain values comma separated
:param str exterior_color: Exterior color to match. Valid filter values are those that our Search facets API returns for unique exterior colors. You can pass in multiple exterior color values comma separated
:param str interior_color: Interior color to match. Valid filter values are those that our Search facets API returns for unique interior colors. You can pass in multiple interior color values comma separated
:param str engine: Filter listings on engine
:param str engine_type: Engine Type to match. Valid filter values are those that our Search facets API returns for unique engine types. You can pass in multiple engine type values comma separated
:param str engine_aspiration: Engine Aspiration to match. Valid filter values are those that our Search facets API returns for unique Engine Aspirations. You can pass in multiple Engine aspirations values comma separated
:param str engine_block: Engine Block to match. Valid filter values are those that our Search facets API returns for unique Engine Block. You can pass in multiple Engine Block values comma separated
:param str miles_range: Miles range to filter cars with miles in the given range. Range to be given in the format - min-max e.g. 1000-5000
:param str price_range: Price range to filter cars with the price in the range given. Range to be given in the format - min-max e.g. 1000-5000
:param str dom_range: Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str sort_by: Sort by field - allowed fields are distance|price|miles|dom|age|posted_at|year. Default sort field is distance from the given point
:param str sort_order: Sort order - asc or desc. Default sort order is distance from a point.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:param str facets: The comma separated list of fields for which facets are requested. Supported fields are - year, make, model, trim, vehicle_type, car_type, body_type, body_subtype, drivetrain, cylinders, transmission, exterior_color, interior_color, doors, engine_type, engine_aspiration, engine_block. Facets could be requested in addition to the listings for the search. Please note - The API calls with lots of facet fields may take longer to respond.
:param str stats: The list of fields for which stats need to be generated based on the matching listings for the search criteria. Allowed fields are - price, miles, msrp, dom The stats consists of mean, max, average and count of listings based on which the stats are calculated for the field. Stats could be requested in addition to the listings for the search. Please note - The API calls with the stats fields may take longer to respond.
:param str country: Filter on Country, by default US. Search available on US (United States) and CA (Canada)
:param str plot: If plot has value true results in around 25k coordinates with limited fields to plot respective graph
:param bool nodedup: If nodedup is set to true then will give results without is_searchable i.e multiple listings for single vin
:param str state: Filter listsings on State
:param str city: Filter listings on city
:param str dealer_name: Filter listings on dealer_name
:param str trim_o: Filter listings on web scraped trim
:param str trim_r: Filter trim on custom possible matches
:param str dom_active_range: Active Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str dom_180_range: Last 180 Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str options: Tokenizer search on options for multiple options use | as seperator
:param str features: Tokenizer search on features for multiple options use | as seperator
:param bool exclude_certified: Boolean param to exclude certified cars from search results
:return: SearchResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.search_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.search_with_http_info(**kwargs) # noqa: E501
return data
def search_with_http_info(self, **kwargs): # noqa: E501
"""Gets active car listings for the given search criteria # noqa: E501
This endpoint is the meat of the API and serves many purposes. This API produces a list of currently active cars from the market for the given search criteria. The API results are limited to allow pagination upto 1000 rows. The search API facilitates the following use cases - 1. Search Cars around a given geo-point within a given radius 2. Search cars for a specific year / make / model or combination of these 3. Search cars matching multiple year, make, model combinatins in the same search request 4. Filter results by most car specification attributes 5. Search for similar cars by VIN or Taxonomy VIN 6. Filter cars within a given price / miles / days on market (dom) range 7. Specify a sort order for the results on price / miles / dom / listed date 8. Search cars for a given City / State combination 9. Get Facets to build the search drill downs 10. Get Market averages for price/miles/dom/msrp for your search # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.search_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param float latitude: Latitude component of location
:param float longitude: Longitude component of location
:param int radius: Radius around the search location
:param str zip: car search bases on zipcode
:param bool include_lease: Boolean param to search for listings that include leasing options in them
:param bool include_finance: Boolean param to search for listings that include finance options in them
:param str lease_term: Search listings with exact lease term, or inside a range with min and max seperated by a dash like lease_term=30-60
:param str lease_down_payment: Search listings with exact down payment in lease offers, or inside a range with min and max seperated by a dash like lease_down_payment=30-60
:param str lease_emp: Search listings with lease offers exactly matching Estimated Monthly Payment(EMI), or inside a range with min and max seperated by a dash like lease_emp=30-60
:param str finance_loan_term: Search listings with exact finance loan term, or inside a range with min and max seperated by a dash like finance_loan_term=30-60
:param str finance_loan_apr: Search listings with finance offers exactly matching loans Annual Percentage Rate, or inside a range with min and max seperated by a dash like finance_loan_apr=30-60
:param str finance_emp: Search listings with finance offers exactly matching Estimated Monthly Payment(EMI), or inside a range with min and max seperated by a dash like finance_emp=30-60
:param str finance_down_payment: Search listings with exact down payment in finance offers, or inside a range with min and max seperated by a dash like finance_down_payment=30-60
:param str finance_down_payment_per: Search listings with exact down payment percentage in finance offers, or inside a range with min and max seperated by a dash like finance_down_payment_per=30-60
:param str car_type: Car type. Allowed values are - new / used / certified
:param str seller_type: Seller type to filter cars on. Valid filter values are those that our Search facets API returns for unique seller types. You can pass in multiple seller type values comma separated.
:param str carfax_1_owner: Indicates whether car has had only one owner or not
:param str carfax_clean_title: Indicates whether car has clean ownership records
:param str year: Car year - 1980 onwards. Valid filter values are those that our Search facets API returns for unique years. You can pass in multiple year values comma separated.
:param str make: Car Make - should be a standard OEM Make name. Valid filter values are those that our Search facets API returns for unique make. You can pass in multiple make values separated by comma. e.g. ford,audi
:param str model: Car model to search. Valid filter values are those that our Search facets API returns for unique model. You can pass in multiple model values comma separated for e.g f-150,Mustang.
:param str trim: Car trim to search. Valid filter values are those that our Search facets API returns for unique trim. You can pass in multiple trim values comma separated
:param str dealer_id: Dealer id to filter the cars.
:param str vin: Car vin to search
:param str source: Source to search cars. Valid filter values are those that our Search facets API returns for unique source. You can pass in multiple source values comma separated
:param str body_type: Body type to filter the cars on. Valid filter values are those that our Search facets API returns for unique body types. You can pass in multiple body types comma separated.
:param str body_subtype: Body subtype to filter the cars on. Valid filter values are those that our Search facets API returns for unique body subtypes. You can pass in multiple body subtype values comma separated
:param str vehicle_type: Vehicle type to filter the cars on. Valid filter values are those that our Search facets API returns for unique vehicle types. You can pass in multiple vehicle type values comma separated
:param str vins: Comma separated list of 17 digit vins to search the matching cars for. Only 10 VINs allowed per request. If the request contains more than 10 VINs the first 10 VINs will be considered. Could be used as a More Like This or Similar Vehicles search for the given VINs. Ths vins parameter is an alternative to taxonomy_vins or ymmt parameters available with the search API. vins and taxonomy_vins parameters could be used to filter our cars with the exact build represented by the vins or taxonomy_vins whereas ymmt is a top level filter that does not filter cars by the build attributes like doors, drivetrain, cylinders, body type, body subtype, vehicle type etc
:param str taxonomy_vins: Comma separated list of 10 letters excert from the 17 letter VIN. The 10 letters to be picked up from the 17 letter VIN are - first 8 letters and the 10th and 11th letter. E.g. For a VIN - 1FTFW1EF3EKE57182 the taxonomy vin would be - 1FTFW1EFEK A taxonomy VIN identified a build of a car and could be used to filter our cars of a particular build. This is an alternative to the vin or ymmt parameters to the search API.
:param str ymmt: Comma separated list of Year, Make, Model, Trim combinations. Each combination needs to have the year,make,model, trim values separated by a pipe '|' character in the form year|make|model|trim. e.g. 2010|Audi|A5,2014|Nissan|Sentra|S 6MT,|Honda|City| You could just provide strings of the form - 'year|make||' or 'year|make|model' or '|make|model|' combinations. Individual year / make / model filters provied with the API calls will take precedence over the Year, Make, Model, Trim combinations. The Make, Model, Trim values must be valid values as per the Marketcheck Vin Decoder. If you are using a separate vin decoder then look at using the 'vins' or 'taxonomy_vins' parameter to the search api instead the year|make|model|trim combinations.
:param str match: Comma separated list of Year, Make, Model, Trim fields. For example - year,make,model,trim fields for which user wants to do an exact match
:param str cylinders: Cylinders to filter the cars on. Valid filter values are those that our Search facets API returns for unique cylinder values. You can pass in multiple cylinder values comma separated
:param str transmission: Transmission to filter the cars on. [a = Automatic, m = Manual]. Valid filter values are those that our Search facets API returns for unique transmission. You can pass in multiple transmission values comma separated
:param str speeds: Speeds to filter the cars on. Valid filter values are those that our Search facets API returns for unique speeds. You can pass in multiple speeds values comma separated
:param str doors: Doors to filter the cars on. Valid filter values are those that our Search facets API returns for unique doors. You can pass in multiple doors values comma separated
:param str drivetrain: Drivetrain to filter the cars on. Valid filter values are those that our Search facets API returns for unique drivetrains. You can pass in multiple drivetrain values comma separated
:param str exterior_color: Exterior color to match. Valid filter values are those that our Search facets API returns for unique exterior colors. You can pass in multiple exterior color values comma separated
:param str interior_color: Interior color to match. Valid filter values are those that our Search facets API returns for unique interior colors. You can pass in multiple interior color values comma separated
:param str engine: Filter listings on engine
:param str engine_type: Engine Type to match. Valid filter values are those that our Search facets API returns for unique engine types. You can pass in multiple engine type values comma separated
:param str engine_aspiration: Engine Aspiration to match. Valid filter values are those that our Search facets API returns for unique Engine Aspirations. You can pass in multiple Engine aspirations values comma separated
:param str engine_block: Engine Block to match. Valid filter values are those that our Search facets API returns for unique Engine Block. You can pass in multiple Engine Block values comma separated
:param str miles_range: Miles range to filter cars with miles in the given range. Range to be given in the format - min-max e.g. 1000-5000
:param str price_range: Price range to filter cars with the price in the range given. Range to be given in the format - min-max e.g. 1000-5000
:param str dom_range: Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str sort_by: Sort by field - allowed fields are distance|price|miles|dom|age|posted_at|year. Default sort field is distance from the given point
:param str sort_order: Sort order - asc or desc. Default sort order is distance from a point.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:param str facets: The comma separated list of fields for which facets are requested. Supported fields are - year, make, model, trim, vehicle_type, car_type, body_type, body_subtype, drivetrain, cylinders, transmission, exterior_color, interior_color, doors, engine_type, engine_aspiration, engine_block. Facets could be requested in addition to the listings for the search. Please note - The API calls with lots of facet fields may take longer to respond.
:param str stats: The list of fields for which stats need to be generated based on the matching listings for the search criteria. Allowed fields are - price, miles, msrp, dom The stats consists of mean, max, average and count of listings based on which the stats are calculated for the field. Stats could be requested in addition to the listings for the search. Please note - The API calls with the stats fields may take longer to respond.
:param str country: Filter on Country, by default US. Search available on US (United States) and CA (Canada)
:param str plot: If plot has value true results in around 25k coordinates with limited fields to plot respective graph
:param bool nodedup: If nodedup is set to true then will give results without is_searchable i.e multiple listings for single vin
:param str state: Filter listsings on State
:param str city: Filter listings on city
:param str dealer_name: Filter listings on dealer_name
:param str trim_o: Filter listings on web scraped trim
:param str trim_r: Filter trim on custom possible matches
:param str dom_active_range: Active Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str dom_180_range: Last 180 Days on Market range to filter cars with the DOM within the given range. Range to be given in the format - min-max e.g. 10-50
:param str options: Tokenizer search on options for multiple options use | as seperator
:param str features: Tokenizer search on features for multiple options use | as seperator
:param bool exclude_certified: Boolean param to exclude certified cars from search results
:return: SearchResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['api_key', 'latitude', 'longitude', 'radius', 'zip', 'include_lease', 'include_finance', 'lease_term', 'lease_down_payment', 'lease_emp', 'finance_loan_term', 'finance_loan_apr', 'finance_emp', 'finance_down_payment', 'finance_down_payment_per', 'car_type', 'seller_type', 'carfax_1_owner', 'carfax_clean_title', 'year', 'make', 'model', 'trim', 'dealer_id', 'vin', 'source', 'body_type', 'body_subtype', 'vehicle_type', 'vins', 'taxonomy_vins', 'ymmt', 'match', 'cylinders', 'transmission', 'speeds', 'doors', 'drivetrain', 'exterior_color', 'interior_color', 'engine', 'engine_type', 'engine_aspiration', 'engine_block', 'miles_range', 'price_range', 'dom_range', 'sort_by', 'sort_order', 'rows', 'start', 'facets', 'stats', 'country', 'plot', 'nodedup', 'state', 'city', 'dealer_name', 'trim_o', 'trim_r', 'dom_active_range', 'dom_180_range', 'options', 'features', 'exclude_certified'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method search" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'latitude' in params:
query_params.append(('latitude', params['latitude'])) # noqa: E501
if 'longitude' in params:
query_params.append(('longitude', params['longitude'])) # noqa: E501
if 'radius' in params:
query_params.append(('radius', params['radius'])) # noqa: E501
if 'zip' in params:
query_params.append(('zip', params['zip'])) # noqa: E501
if 'include_lease' in params:
query_params.append(('include_lease', params['include_lease'])) # noqa: E501
if 'include_finance' in params:
query_params.append(('include_finance', params['include_finance'])) # noqa: E501
if 'lease_term' in params:
query_params.append(('lease_term', params['lease_term'])) # noqa: E501
if 'lease_down_payment' in params:
query_params.append(('lease_down_payment', params['lease_down_payment'])) # noqa: E501
if 'lease_emp' in params:
query_params.append(('lease_emp', params['lease_emp'])) # noqa: E501
if 'finance_loan_term' in params:
query_params.append(('finance_loan_term', params['finance_loan_term'])) # noqa: E501
if 'finance_loan_apr' in params:
query_params.append(('finance_loan_apr', params['finance_loan_apr'])) # noqa: E501
if 'finance_emp' in params:
query_params.append(('finance_emp', params['finance_emp'])) # noqa: E501
if 'finance_down_payment' in params:
query_params.append(('finance_down_payment', params['finance_down_payment'])) # noqa: E501
if 'finance_down_payment_per' in params:
query_params.append(('finance_down_payment_per', params['finance_down_payment_per'])) # noqa: E501
if 'car_type' in params:
query_params.append(('car_type', params['car_type'])) # noqa: E501
if 'seller_type' in params:
query_params.append(('seller_type', params['seller_type'])) # noqa: E501
if 'carfax_1_owner' in params:
query_params.append(('carfax_1_owner', params['carfax_1_owner'])) # noqa: E501
if 'carfax_clean_title' in params:
query_params.append(('carfax_clean_title', params['carfax_clean_title'])) # noqa: E501
if 'year' in params:
query_params.append(('year', params['year'])) # noqa: E501
if 'make' in params:
query_params.append(('make', params['make'])) # noqa: E501
if 'model' in params:
query_params.append(('model', params['model'])) # noqa: E501
if 'trim' in params:
query_params.append(('trim', params['trim'])) # noqa: E501
if 'dealer_id' in params:
query_params.append(('dealer_id', params['dealer_id'])) # noqa: E501
if 'vin' in params:
query_params.append(('vin', params['vin'])) # noqa: E501
if 'source' in params:
query_params.append(('source', params['source'])) # noqa: E501
if 'body_type' in params:
query_params.append(('body_type', params['body_type'])) # noqa: E501
if 'body_subtype' in params:
query_params.append(('body_subtype', params['body_subtype'])) # noqa: E501
if 'vehicle_type' in params:
query_params.append(('vehicle_type', params['vehicle_type'])) # noqa: E501
if 'vins' in params:
query_params.append(('vins', params['vins'])) # noqa: E501
if 'taxonomy_vins' in params:
query_params.append(('taxonomy_vins', params['taxonomy_vins'])) # noqa: E501
if 'ymmt' in params:
query_params.append(('ymmt', params['ymmt'])) # noqa: E501
if 'match' in params:
query_params.append(('match', params['match'])) # noqa: E501
if 'cylinders' in params:
query_params.append(('cylinders', params['cylinders'])) # noqa: E501
if 'transmission' in params:
query_params.append(('transmission', params['transmission'])) # noqa: E501
if 'speeds' in params:
query_params.append(('speeds', params['speeds'])) # noqa: E501
if 'doors' in params:
query_params.append(('doors', params['doors'])) # noqa: E501
if 'drivetrain' in params:
query_params.append(('drivetrain', params['drivetrain'])) # noqa: E501
if 'exterior_color' in params:
query_params.append(('exterior_color', params['exterior_color'])) # noqa: E501
if 'interior_color' in params:
query_params.append(('interior_color', params['interior_color'])) # noqa: E501
if 'engine' in params:
query_params.append(('engine', params['engine'])) # noqa: E501
if 'engine_type' in params:
query_params.append(('engine_type', params['engine_type'])) # noqa: E501
if 'engine_aspiration' in params:
query_params.append(('engine_aspiration', params['engine_aspiration'])) # noqa: E501
if 'engine_block' in params:
query_params.append(('engine_block', params['engine_block'])) # noqa: E501
if 'miles_range' in params:
query_params.append(('miles_range', params['miles_range'])) # noqa: E501
if 'price_range' in params:
query_params.append(('price_range', params['price_range'])) # noqa: E501
if 'dom_range' in params:
query_params.append(('dom_range', params['dom_range'])) # noqa: E501
if 'sort_by' in params:
query_params.append(('sort_by', params['sort_by'])) # noqa: E501
if 'sort_order' in params:
query_params.append(('sort_order', params['sort_order'])) # noqa: E501
if 'rows' in params:
query_params.append(('rows', params['rows'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
if 'facets' in params:
query_params.append(('facets', params['facets'])) # noqa: E501
if 'stats' in params:
query_params.append(('stats', params['stats'])) # noqa: E501
if 'country' in params:
query_params.append(('country', params['country'])) # noqa: E501
if 'plot' in params:
query_params.append(('plot', params['plot'])) # noqa: E501
if 'nodedup' in params:
query_params.append(('nodedup', params['nodedup'])) # noqa: E501
if 'state' in params:
query_params.append(('state', params['state'])) # noqa: E501
if 'city' in params:
query_params.append(('city', params['city'])) # noqa: E501
if 'dealer_name' in params:
query_params.append(('dealer_name', params['dealer_name'])) # noqa: E501
if 'trim_o' in params:
query_params.append(('trim_o', params['trim_o'])) # noqa: E501
if 'trim_r' in params:
query_params.append(('trim_r', params['trim_r'])) # noqa: E501
if 'dom_active_range' in params:
query_params.append(('dom_active_range', params['dom_active_range'])) # noqa: E501
if 'dom_180_range' in params:
query_params.append(('dom_180_range', params['dom_180_range'])) # noqa: E501
if 'options' in params:
query_params.append(('options', params['options'])) # noqa: E501
if 'features' in params:
query_params.append(('features', params['features'])) # noqa: E501
if 'exclude_certified' in params:
query_params.append(('exclude_certified', params['exclude_certified'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/search', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SearchResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,105 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /marketcheck_api_sdk/api/dealer_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from marketcheck_api_sdk.api_client import ApiClient
class DealerApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def dealer_search(self, latitude, longitude, radius, **kwargs): # noqa: E501
"""Find car dealers around # noqa: E501
The dealers API returns a list of dealers around a given point and radius. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.dealer_search(latitude, longitude, radius, async=True)
>>> result = thread.get()
:param async bool
:param float latitude: Latitude component of location (required)
:param float longitude: Longitude component of location (required)
:param int radius: Radius around the search location (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param float rows: Number of results to return. Default is 10. Max is 50
:param float start: Offset for the search results. Default is 1.
:return: DealersResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.dealer_search_with_http_info(latitude, longitude, radius, **kwargs) # noqa: E501
else:
(data) = self.dealer_search_with_http_info(latitude, longitude, radius, **kwargs) # noqa: E501
return data
def dealer_search_with_http_info(self, latitude, longitude, radius, **kwargs): # noqa: E501
"""Find car dealers around # noqa: E501
The dealers API returns a list of dealers around a given point and radius. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.dealer_search_with_http_info(latitude, longitude, radius, async=True)
>>> result = thread.get()
:param async bool
:param float latitude: Latitude component of location (required)
:param float longitude: Longitude component of location (required)
:param int radius: Radius around the search location (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param float rows: Number of results to return. Default is 10. Max is 50
:param float start: Offset for the search results. Default is 1.
:return: DealersResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['latitude', 'longitude', 'radius', 'api_key', 'rows', 'start'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method dealer_search" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'latitude' is set
if ('latitude' not in params or
params['latitude'] is None):
raise ValueError("Missing the required parameter `latitude` when calling `dealer_search`") # noqa: E501
# verify the required parameter 'longitude' is set
if ('longitude' not in params or
params['longitude'] is None):
raise ValueError("Missing the required parameter `longitude` when calling `dealer_search`") # noqa: E501
# verify the required parameter 'radius' is set
if ('radius' not in params or
params['radius'] is None):
raise ValueError("Missing the required parameter `radius` when calling `dealer_search`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'latitude' in params:
query_params.append(('latitude', params['latitude'])) # noqa: E501
if 'longitude' in params:
query_params.append(('longitude', params['longitude'])) # noqa: E501
if 'radius' in params:
query_params.append(('radius', params['radius'])) # noqa: E501
if 'rows' in params:
query_params.append(('rows', params['rows'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealers', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DealersResponse', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer(self, dealer_id, **kwargs): # noqa: E501
"""Dealer by id # noqa: E501
Get a particular dealer's information by its id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Dealer id to get all the dealer info attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Dealer
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer by id # noqa: E501
Get a particular dealer's information by its id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Dealer id to get all the dealer info attributes (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: Dealer
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Dealer', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_active_inventory(self, dealer_id, **kwargs): # noqa: E501
"""Dealer inventory # noqa: E501
Get a dealer's currently active inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_active_inventory(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_active_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_active_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_active_inventory_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer inventory # noqa: E501
Get a dealer's currently active inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_active_inventory_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:param str rows: Number of results to return. Default is 10. Max is 50
:param str start: Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id', 'api_key', 'rows', 'start'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_active_inventory" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_active_inventory`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
if 'rows' in params:
query_params.append(('rows', params['rows'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/active/inventory', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BaseListing', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_historical_inventory(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's historical inventory # noqa: E501
[v1 : Not Implemented Yet] - Get a dealer's historical inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_historical_inventory(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_historical_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_historical_inventory_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_historical_inventory_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's historical inventory # noqa: E501
[v1 : Not Implemented Yet] - Get a dealer's historical inventory # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_historical_inventory_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the active inventory for (required)
:return: BaseListing
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_historical_inventory" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_historical_inventory`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/historical/inventory', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BaseListing', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_landing_page(self, dealer_id, **kwargs): # noqa: E501
"""Experimental: Get cached version of dealer landing page by dealer id # noqa: E501
Experimental: Get cached version of dealer landing page by dealer id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_landing_page(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Robot id to get the landing page html for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: DealerLandingPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_landing_page_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_landing_page_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_landing_page_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Experimental: Get cached version of dealer landing page by dealer id # noqa: E501
Experimental: Get cached version of dealer landing page by dealer id # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_landing_page_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Robot id to get the landing page html for (required)
:param str api_key: The API Authentication Key. Mandatory with all API calls.
:return: DealerLandingPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id', 'api_key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_landing_page" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_landing_page`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
if 'api_key' in params:
query_params.append(('api_key', params['api_key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/landing', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DealerLandingPage', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_ratings(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's Rating # noqa: E501
[MOCK] Get a dealer's Rating # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_ratings(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the ratings for (required)
:return: DealerRating
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_ratings_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_ratings_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_ratings_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's Rating # noqa: E501
[MOCK] Get a dealer's Rating # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_ratings_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the ratings for (required)
:return: DealerRating
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_ratings" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_ratings`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/ratings', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DealerRating', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_dealer_reviews(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's Review # noqa: E501
[MOCK] Get a dealer's Review # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_reviews(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the ratings for (required)
:return: DealerReview
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_dealer_reviews_with_http_info(dealer_id, **kwargs) # noqa: E501
else:
(data) = self.get_dealer_reviews_with_http_info(dealer_id, **kwargs) # noqa: E501
return data
def get_dealer_reviews_with_http_info(self, dealer_id, **kwargs): # noqa: E501
"""Dealer's Review # noqa: E501
[MOCK] Get a dealer's Review # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_dealer_reviews_with_http_info(dealer_id, async=True)
>>> result = thread.get()
:param async bool
:param str dealer_id: Id representing the dealer to fetch the ratings for (required)
:return: DealerReview
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['dealer_id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_dealer_reviews" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'dealer_id' is set
if ('dealer_id' not in params or
params['dealer_id'] is None):
raise ValueError("Missing the required parameter `dealer_id` when calling `get_dealer_reviews`") # noqa: E501
collection_formats = {}
path_params = {}
if 'dealer_id' in params:
path_params['dealer_id'] = params['dealer_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/dealer/{dealer_id}/reviews', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DealerReview', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,106 | MarketcheckCarsInc/marketcheck_api_sdk_python | refs/heads/master | /test/test_listings_api.py | # coding: utf-8
"""
Marketcheck Cars API
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 44,000 Car dealers in US. At any time, there are about 6.2M searchable listings (about 1.9M unique VINs) for Used & Certified cars and about 6.6M (about 3.9M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='https://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li></ul> # noqa: E501
OpenAPI spec version: 1.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from pprint import pprint
import unittest
import pdb
import itertools
import marketcheck_api_sdk
from marketcheck_api_sdk.api.listings_api import ListingsApi # noqa: E501
from marketcheck_api_sdk.rest import ApiException
class TestListingsApi(unittest.TestCase):
"""ListingsApi unit test stubs"""
def setUp(self):
self.api = marketcheck_api_sdk.api.listings_api.ListingsApi() # noqa: E501
def tearDown(self):
pass
def test_get_listing(self):
"""Test case for get_listing
Listing by id # noqa: E501
"""
##### validate listing formats #######
api_instance = marketcheck_api_sdk.ListingsApi(marketcheck_api_sdk.ApiClient())
listing_id = ["1FTNE2CM2FKA81288-62fc00a9-7a8c-435b-bd55-5d862759683f","1GYS4BKJ8FR290257-1c4e667b-cef1-47b7-9669-2aabf42a7011",
"3GYFNBE3XFS537500-3d95698a-4195-4612-af97-6dcd69a21ce0"]
vins = ["1FTNE2CM2FKA81288","1GYS4BKJ8FR290257","3GYFNBE3XFS537500"]
api_key = "YOUR API KEY"
try:
for listing in listing_id:
api_response = api_instance.get_listing(listing, api_key=api_key)
#pprint(api_response)
assert isinstance(api_response.media,object)
assert isinstance(api_response.extra,object)
assert isinstance(api_response.dealer,object)
assert isinstance(api_response.build,object)
assert isinstance(api_response.media.photo_links,list)
if api_response.extra.options != None: assert isinstance(api_response.extra.options,list)
if api_response.extra.features != None: assert isinstance(api_response.extra.features,list)
if api_response.extra.seller_comments != None: assert isinstance(api_response.extra.seller_comments,str)
assert isinstance(api_response.build.model,str)
assert isinstance(api_response.build.make,str)
if api_response.build.engine != None: assert isinstance(api_response.build.engine,str)
if api_response.build.transmission != None: assert isinstance(api_response.build.transmission,str)
assert isinstance(api_response.build.year,int)
assert api_response.id == listing
except ApiException as e:
pprint("Exception when calling ListingsApi->get_listing: %s\n" % e)
pass
def test_get_listing_extra(self):
"""Test case for get_listing_extra
Long text Listings attributes for Listing with the given id # noqa: E501
"""
api_instance = marketcheck_api_sdk.ListingsApi(marketcheck_api_sdk.ApiClient())
listing_id = ["1FTNE2CM2FKA81288-62fc00a9-7a8c-435b-bd55-5d862759683f","1GYS4BKJ8FR290257-1c4e667b-cef1-47b7-9669-2aabf42a7011",
"3GYFNBE3XFS537500-3d95698a-4195-4612-af97-6dcd69a21ce0"]
vins = ["1FTNE2CM2FKA81288","1GYS4BKJ8FR290257","3GYFNBE3XFS537500"]
api_key = "YOUR API KEY"
try:
for id in listing_id:
api_response = api_instance.get_listing_extra(id, api_key=api_key)
#pprint(api_response)
assert api_response.id == id
assert hasattr(api_response,"features")
assert hasattr(api_response,"options")
assert isinstance(api_response.id,str)
if api_response.options != None: assert isinstance(api_response.options,list)
if api_response.features != None: assert isinstance(api_response.features,list)
if api_response.seller_cmts != None: assert isinstance(api_response.seller_cmts,str)
except ApiException as e:
pprint("Exception when calling ListingsApi->get_listing_extra: %s\n" % e)
pass
def test_get_listing_media(self):
"""Test case for get_listing_media
Listing media by id # noqa: E501
"""
api_instance = marketcheck_api_sdk.ListingsApi(marketcheck_api_sdk.ApiClient())
listing_id = ["1FTNE2CM2FKA81288-62fc00a9-7a8c-435b-bd55-5d862759683f","1GYS4BKJ8FR290257-1c4e667b-cef1-47b7-9669-2aabf42a7011",
"3GYFNBE3XFS537500-3d95698a-4195-4612-af97-6dcd69a21ce0"]
vins = ["1FTNE2CM2FKA81288","1GYS4BKJ8FR290257","3GYFNBE3XFS537500"]
api_key = "YOUR API KEY"
try:
for id in listing_id:
api_response = api_instance.get_listing_media(id, api_key=api_key)
#pprint(api_response)
assert api_response.id ==id
assert isinstance(api_response.id,str)
if api_response.photo_links != None: assert isinstance(api_response.photo_links,list)
if api_response.photo_url != None: assert isinstance(api_response.photo_url,str)
except ApiException as e:
pprint("Exception when calling ListingsApi->get_listing_media %s\n" % e)
pass
def test_get_listing_vdp(self):
"""Test case for get_listing_vdp
Get listing HTML # noqa: E501
"""
pass
def test_get_summary_report(self):
"""Test case for get_summary_report
Get Summary Report # noqa: E501
"""
pass
def test_search(self):
"""Test case for search
Gets active car listings for the given search criteria # noqa: E501
"""
api_instance = marketcheck_api_sdk.ListingsApi(marketcheck_api_sdk.ApiClient())
api_key = "YOUR API KEY"
try:
years=["2017", "2018", "2014", "2016", "2015"]
makes=["Ford", "Chevrolet", "Toyota", "Nissan", "Honda"]
models=["F-150", "Civic", "Escape", "Equinox", "Malibu"]
trims=["Base", "Limited", "Sport", "Platinum", "Touring"]
exterior_colors=["Black", "White", "Silver", "Red", "Blue"]
interior_colors=["Black", "Gray", "Graphite", "Cloth", "Ash"]
body_types=["Sedan", "Pickup", "Hatchback", "Coupe", "Wagon"]
body_subtypes=["Crew Cab", "Extended Cab", "Regular Cab", "Super Cab"]
vehicle_types=["SUV", "Van", "Car", "Truck"]
latitudes=["35.94","37.34","35.41","33.54","43.06"]
seller_types=["dealer", "fsbo"]
longitudes= ["-117.29","-75.65","-86.8","-80.64","-84.16"]
vins=["1FTEW1EFXFFB17341",
"1FTEW1CP0FKD64953",
"1FTEW1CG5FKE15329",
"1FTEW1EF4FKD18109",
"1FTFW1EG3FFB34334"]
taxonomy_vins= ["1FTEW1EFFF", "1FTEW1CPFK", "1FTEW1CGFK", "1FTEW1EFFK", "1FTFW1EGFF"]
miles_ranges=["3000", "5000", "8000", "10000"]
price_ranges=["30000", "40000", "50000", "60000"]
dom_ranges=["20", "30", "40", "50"]
sort_orders= ["asc", "desc"]
sort_by=["price", "miles", "dom", "year"]
lease_term=[36, 39, 48]
lease_emp=[200, 300, 400]
lease_down_payment=[1000, 2000, 3000]
finance_loan_term=[36, 48, 72]
finance_loan_apr=[4, 4.5, 4.75, 5]
finance_down_payment=[2000, 3000, 5000]
finance_emp=[200, 250, 300]
dealer_id=[1007324, 1000466, 1016299, 1016499, 1015942]
zips=["90007", "75209", "02110", "84102"]
cylinders=["4", "6", "8", "5", "3"]
doors=["4", "2", "5", "3", "6"]
transmissions=["Automatic", "Manual", "Automated Manual", "Direct Drive", "Manual/Standard"]
drivetrains=["Front Wheel Drive", "4-Wheel Drive", "All Wheel Drive", "Rear Wheel Drive", "4x2"]
countrys=["CA", "US"]
car_types=["new", "used"]
engine_blocks=["v", "i", "h"]
rows=["5", "10", "20", "30", "50"]
ym_cmobo = list(itertools.product(years,makes))
mm_cmobo = list(itertools.product(makes,models))
mt_cmobo = list(itertools.product(models,trims))
ymm_cmobo = list(itertools.product(years,makes,models))
ymmt_cmobo = list(itertools.product(years,makes,models,trims))
ext_int_clr_combo = list(itertools.product(exterior_colors,interior_colors))
ext_clr_bd_type_combo = list(itertools.product(exterior_colors,body_types))
ext_clr_bd_and_bds_type_combo = list(itertools.product(exterior_colors,body_types,body_subtypes))
seller_and_vehicle_type = list(itertools.product(seller_types,vehicle_types))
lat_lng_combo = list(itertools.product(latitudes,longitudes))
vin_combo = list(itertools.product(vins,vins))
taxonomy_vins_combo = list(itertools.product(taxonomy_vins,taxonomy_vins))
stats_fields = ["price","miles","dom"]
sort_by_and_order_combo = list(itertools.product(sort_by,sort_orders))
miles_range_combo = list(itertools.product(miles_ranges[:2],miles_ranges[-2:]))
price_range_combo = list(itertools.product(price_ranges[:2],price_ranges[-2:]))
dom_range_combo = list(itertools.product(dom_ranges[:2],dom_ranges[-2:]))
sort_by_and_order_combo = list(itertools.product(sort_by,sort_orders))
sort_by_fields_combo = list(itertools.product(sort_by[:2],sort_by[-2:],sort_orders))
########## validate stats #############
for field in stats_fields:
api_response = api_instance.search(api_key=api_key,latitude=39.73,longitude=-104.99,radius=200,stats=field,start=0,rows=10,sort_by=field,sort_order="desc",car_type="used")
assert api_response.stats[field].has_key("sum")
assert api_response.stats[field].has_key("min")
assert api_response.stats[field].has_key("max")
assert api_response.stats[field].has_key("mean")
assert api_response.stats[field].has_key("count")
assert api_response.stats[field].has_key("median")
assert api_response.stats[field].has_key("stddev")
if field == "price": assert api_response.listings[0].price == api_response.stats[field]["max"]
if field == "miles": assert api_response.listings[0].miles == api_response.stats[field]["max"]
if field == "dom": assert api_response.listings[0].dom == api_response.stats[field]["max"]
######## validate stats with multiple fields given ########
api_response = api_instance.search(api_key=api_key,latitude=39.73,longitude=-104.99,radius=200,stats="price,miles,dom",start=1,rows=0,car_type="used")
assert hasattr(api_response,"stats")
assert api_response.stats.has_key(stats_fields[0])
assert api_response.stats.has_key(stats_fields[1])
assert api_response.stats.has_key(stats_fields[2])
###### validate near by response #########
######## validate makes ###########
for make in makes:
api_response = api_instance.search(api_key=api_key,make=make,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.make == make
######### validate model ##########
for model in models:
api_response = api_instance.search(api_key=api_key,model=model,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.model == model
######### validate trim ##########
for trim in trims:
api_response = api_instance.search(api_key=api_key,trim=trim,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.trim.lower() == trim.lower()
######### Validate Year ###########
for year in years:
api_response = api_instance.search(api_key=api_key,year=year,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.year == int(year)
########### Validate zip code search #########make=ford&year=2016&zip=#{_zip}&car_type=used&sort_by=id&sort_order=desc
for zip in zips:
api_response = api_instance.search(api_key=api_key,year="2016",make="ford",zip=zip,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.dealer.zip == zip
########### Validate carafax attributes #################
api_response = api_instance.search(api_key=api_key,make="ford",year="2015",carfax_1_owner="true",carfax_clean_title="true")
for listing in api_response.listings:
assert listing.carfax_1_owner == True
assert listing.carfax_clean_title == True
for year,make in ym_cmobo[0:4]:
api_response = api_instance.search(api_key=api_key,year=year,make=make,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.make == make
assert isinstance(listing.build.year,int)
assert listing.build.year == int(year)
for make,model in mm_cmobo[0:4]:
api_response = api_instance.search(api_key=api_key,make=make,model=model,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.make == make
assert listing.build.model == model
for model,trim in mt_cmobo[0:4]:
api_response = api_instance.search(api_key=api_key,model=model,trim=trim,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.model == model
assert listing.build.trim == trim
for year,make,model in ymm_cmobo[0:4]:
api_response = api_instance.search(api_key=api_key,model=model,make=make,year=year,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.model == model
assert listing.build.year == int(year)
assert isinstance(listing.build.year,int)
assert listing.build.make == make
for year,make,model,trim in ymmt_cmobo[0:4]:
api_response = api_instance.search(api_key=api_key,model=model,year=year,make=make,trim=trim,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.model == model
assert listing.build.year == int(year)
assert isinstance(listing.build.year,int)
assert listing.build.make == make
assert listing.build.trim == trim
for exterior_color in exterior_colors:
api_response = api_instance.search(api_key=api_key,exterior_color=exterior_color,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.exterior_color.lower() == exterior_color.lower()
for interior_color in interior_colors:
api_response = api_instance.search(api_key=api_key,interior_color=interior_color,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.interior_color.lower() == interior_color.lower()
for body_type in body_types:
api_response = api_instance.search(api_key=api_key,body_type=body_type,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.body_type == body_type
for body_subtype in body_subtypes:
api_response = api_instance.search(api_key=api_key,body_subtype=body_subtype,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.body_subtype == body_subtype
for exterior_color,body_type in ext_clr_bd_type_combo[0:4]:
api_response = api_instance.search(api_key=api_key,exterior_color=exterior_color,body_type=body_type,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.exterior_color.lower() == exterior_color.lower()
assert listing.build.body_type == body_type
for exterior_color,interior_color in ext_int_clr_combo[0:4]:
api_response = api_instance.search(api_key=api_key,exterior_color=exterior_color,interior_color=interior_color,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.exterior_color.lower() == exterior_color.lower()
assert listing.interior_color.lower() == interior_color.lower()
for exterior_color,body_type,body_subtype in ext_clr_bd_and_bds_type_combo[0:4]:
api_response = api_instance.search(api_key=api_key,exterior_color=exterior_color,body_type=body_type,body_subtype=body_subtype,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.exterior_color.lower() == exterior_color.lower()
assert listing.build.body_type == body_type
assert listing.build.body_subtype == body_subtype
for seller_type in seller_types:
api_response = api_instance.search(api_key=api_key,seller_type=seller_type,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.seller_type == seller_type
for vehicle_type in vehicle_types:
api_response = api_instance.search(api_key=api_key,vehicle_type=vehicle_type,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.vehicle_type == vehicle_type
############ validate seller and vehicle type ###########
for s_type,v_type in seller_and_vehicle_type:
api_response = api_instance.search(api_key=api_key,vehicle_type=v_type,seller_type=s_type,latitude=37.998,longitude=-84.522,radius=200,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.vehicle_type == v_type
assert listing.seller_type == s_type
####### validate lease_term #####
for l_term in lease_term:
api_response = api_instance.search(api_key=api_key,lease_term=l_term,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.leasing_options[0].lease_term == l_term
########## validate lease_emp #####
for l_emp in lease_emp:
api_response = api_instance.search(api_key=api_key,lease_emp=l_emp,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.leasing_options[0].estimated_monthly_payment == l_emp
########## validate lease_down_payment ########
for l_dp in lease_down_payment:
api_response = api_instance.search(api_key=api_key,lease_down_payment=l_dp,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.leasing_options[0].down_payment == l_dp
######## validate finance_loan_term ###########
for f_term in finance_loan_term:
api_response = api_instance.search(api_key=api_key,finance_loan_term=f_term,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.financing_options[0].loan_term == f_term
########## validate finance_loan_apr ############
for f_apr in finance_loan_apr:
api_response = api_instance.search(api_key=api_key,finance_loan_apr=f_apr,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.financing_options[0].loan_apr == f_apr
########## validate finance_emp ##############
for f_emp in finance_emp:
api_response = api_instance.search(api_key=api_key,finance_emp=f_emp,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.financing_options[0].estimated_monthly_payment == f_emp
########### validate finance_down_payment ############
for f_dp in finance_down_payment:
api_response = api_instance.search(api_key=api_key,finance_down_payment=f_dp,rows=50,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.financing_options[0].down_payment == f_dp
############# validate drivetrain #############
for d_train in drivetrains:
api_response = api_instance.search(api_key=api_key,drivetrain=cgi.escape(d_train),car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.drivetrain == d_train
############## validate cylinders ##############
for cylinder in cylinders:
api_response = api_instance.search(api_key=api_key,cylinders=cylinder,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.cylinders == int(cylinder)
############## validate transmission ###########
for transmission in transmissions:
api_response = api_instance.search(api_key=api_key,transmission=cgi.escape(transmission),car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.transmission == transmission
############## validate Doors ############
for door in doors:
api_response = api_instance.search(api_key=api_key,doors=door,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.doors == int(door)
################ validate engine block #########
for e_block in engine_blocks:
api_response = api_instance.search(api_key=api_key,engine_block=e_block,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.build.engine_block.lower() == e_block.lower()
############## validate vin ###########
for vin in vins:
api_response = api_instance.search(api_key=api_key,vin=vin,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.vin == vin
############## validate rows ############
for row in rows:
api_response = api_instance.search(api_key=api_key,exterior_color="black",rows=row,car_type="used",sort_by="id",sort_order="desc")
assert len(api_response.listings) == int(row)
############# validate dealer id #########
for d_id in dealer_id:
api_response = api_instance.search(api_key=api_key,dealer_id=d_id,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
listing.dealer.id == d_id
############ validate inventory type ######
for inv_type in car_types:
api_response = api_instance.search(api_key=api_key,latitude=37.998,longitude=-84.522,radius=200,car_type=inv_type,sort_by="id",sort_order="desc")
for listing in api_response.listings:
listing.inventory_type == inv_type
############## validate country ##########
for country in countrys:
api_response = api_instance.search(api_key=api_key,country=country,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
listing.dealer.country == country
############# validate miles range #########
for mile1,mile2 in miles_range_combo[0:4]:
api_response = api_instance.search(api_key=api_key,miles_range=mile1+"-"+mile2,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.miles >= int(mile1)
assert listing.miles <= int(mile2)
############# validate price range #########
for price1,price2 in price_range_combo[0:4]:
api_response = api_instance.search(api_key=api_key,price_range=price1+"-"+price2,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.price >= int(price1)
assert listing.price <= int(price2)
############# validate dom range ########
for dom1,dom2 in dom_range_combo[0:4]:
api_response = api_instance.search(api_key=api_key,dom_range=dom1+"-"+dom2,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert listing.dom >= int(dom1)
assert listing.dom <= int(dom2)
############ validate lat and lan ##########
########### validate multiple vins ###########
for vin1,vin2 in vin_combo[0:2]:
api_response = api_instance.search(api_key=api_key,vins=vin1+","+vin2,latitude=37.998,longitude=-84.522,rows=50,radius=200)
is_taxonomy_vins = False
vins = [vin1, vin2]
for vin in vins:
if len(vin) == 10:
is_taxonomy_vins = True
taxonomy_vins_of_listing = []
taxonomy_vins_of_request = []
for listing in api_response.listings:
taxonomy_vins_of_listing.append(listing.vin[0:8]+listing.vin[9])
if is_taxonomy_vins:
taxonomy_vins_of_request = vins
else:
for vin in vins:
taxonomy_vins_of_request.append(vin[0:8] + vin[9])
taxonomy_vins_of_listing=sorted(list(set(taxonomy_vins_of_listing)))
taxonomy_vins_of_request=sorted(list(set(taxonomy_vins_of_request)))
assert len(taxonomy_vins_of_listing) - len(taxonomy_vins_of_request) == 0
################# validate taxonomy vins ##############
for vin1,vin2 in taxonomy_vins_combo[0:2]:
api_response = api_instance.search(api_key=api_key,taxonomy_vins=vin1+","+vin2,rows=50,latitude=37.998,longitude=-84.522,radius=200)
is_taxonomy_vins = False
vins = [vin1, vin2]
for vin in vins:
if len(vin) == 10:
is_taxonomy_vins = True
taxonomy_vins_of_listing = []
taxonomy_vins_of_request = []
for listing in api_response.listings:
taxonomy_vins_of_listing.append(listing.vin[0:8]+listing.vin[9:11])
if is_taxonomy_vins:
taxonomy_vins_of_request = vins
else:
for vin in vins:
taxonomy_vins_of_request.append(vin[0:8] + vin[9:11])
taxonomy_vins_of_listing=sorted(list(set(taxonomy_vins_of_listing)))
taxonomy_vins_of_request=sorted(list(set(taxonomy_vins_of_request)))
assert len(taxonomy_vins_of_listing) - len(taxonomy_vins_of_request) == 0
################# validate api response for matching vins ##########
for vin in vins:
api_response = api_instance.search(api_key=api_key,vins=vin,match="year,make,model,trim",latitude=37.998,longitude=-84.522,radius=500,car_type="used",sort_by="dist",sort_order="asc",start=0,rows=50,country="ALL")
assert hasattr(api_response,"num_found")
assert hasattr(api_response,"listings")
assert isinstance(api_response.num_found,int)
assert isinstance(api_response.listings,list)
############## validate multiple years #########
year_list=[years[i:i+3] for i in range(0, len(years), 3)]
for year in year_list:
year_param = year[0]+","+year[1]+","+year[2] if len(year) == 3 else year[0]+","+year[1]
api_response = api_instance.search(api_key=api_key,year=year_param,car_type="used",sort_by="id",sort_order="desc")
for listing in api_response.listings:
assert str(listing.build.year) in year
############# validate sort by and sort order (problem in price,miles and order as well) ##########
for sort_by,sort_order in sort_by_and_order_combo[0:2]:
api_response = api_instance.search(api_key=api_key,sort_order=sort_order,sort_by=sort_by,latitude=37.998,longitude=-84.522,radius=50,car_type="used")
field_arr = []
if sort_by == "miles" or sort_by == "dom" or sort_by == "price" or sort_by == "year": #
for listing in api_response.listings:
if sort_by == "dom": field_arr.append(listing.dom)
if sort_by == "miles": field_arr.append(listing.miles)
if sort_by == "price": field_arr.append(listing.price)
if sort_by == "year": field_arr.append(listing.build.year)
if sort_order == "asc":
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr)
else:
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr, reverse=True)
########### validate lease fields in range and sort order on them ##########
for sort_o in sort_orders:
for fl in ["lease_term","lease_emp","lease_down_payment"]:
api_response = api_instance.search(api_key=api_key,lease_term="36-48",lease_emp="200-400",lease_down_payment="1000-3000",sort_order=sort_o,sort_by=fl,rows=50,car_type="used")
field_arr=[]
for listing in api_response.listings:
assert listing.leasing_options[0].lease_term <= 48
assert listing.leasing_options[0].lease_term >= 36
assert listing.leasing_options[0].estimated_monthly_payment <=400
assert listing.leasing_options[0].estimated_monthly_payment >=200
assert listing.leasing_options[0].down_payment <=3000
assert listing.leasing_options[0].down_payment >=1000
if fl == "lease_down_payment": field_arr.append(listing.leasing_options[0].down_payment)
if fl == "lease_emp": field_arr.append(listing.leasing_options[0].estimated_monthly_payment)
if fl == "lease_term": field_arr.append(listing.leasing_options[0].lease_term)
if sort_o == "asc":
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr)
else:
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr, reverse=True)
############## validate finance fields in range and sort order on them #########
for sort_o in sort_orders:
for fl in ["finance_loan_term","finance_loan_apr","finance_down_payment", "finance_emp"]:
api_response = api_instance.search(api_key=api_key,finance_loan_term="36-48",finance_emp="200-300",finance_down_payment="2000-5000",finance_loan_apr="4-5",sort_order=sort_o,sort_by=fl,rows=50,car_type="used")
field_arr=[]
for listing in api_response.listings:
assert listing.financing_options[0].loan_term <= 72
assert listing.financing_options[0].loan_term >= 36
assert listing.financing_options[0].estimated_monthly_payment <=300
assert listing.financing_options[0].estimated_monthly_payment >=200
assert listing.financing_options[0].down_payment <=5000
assert listing.financing_options[0].down_payment >=2000
assert listing.financing_options[0].loan_apr <= 5
assert listing.financing_options[0].loan_apr >= 4
if fl == "finance_down_payment": field_arr.append(listing.financing_options[0].down_payment)
if fl == "finance_emp": field_arr.append(listing.financing_options[0].estimated_monthly_payment)
if fl == "finance_loan_term": field_arr.append(listing.financing_options[0].loan_term)
if fl == "finance_loan_apr": field_arr.append(listing.financing_options[0].loan_apr)
if sort_o == "asc":
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr)
else:
field_arr = filter(None,field_arr)
assert field_arr == sorted(field_arr, reverse=True)
except ApiException as e:
pprint("Exception when calling ListingsApi->search: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
| {"/test/test_depreciation_point.py": ["/marketcheck_api_sdk/__init__.py"], "/marketcheck_api_sdk/models/sales.py": ["/marketcheck_api_sdk/models/sales_stats.py"], "/test/test_market_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/market_api.py"], "/marketcheck_api_sdk/api/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/test/test_crm_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/crm_api.py"], "/test/test_vin_decoder_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/vin_decoder_api.py"], "/marketcheck_api_sdk/models/search_stats.py": ["/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/__init__.py": ["/marketcheck_api_sdk/api/crm_api.py", "/marketcheck_api_sdk/api/dealer_api.py", "/marketcheck_api_sdk/api/facets_api.py", "/marketcheck_api_sdk/api/inventory_api.py", "/marketcheck_api_sdk/api/listings_api.py", "/marketcheck_api_sdk/api/market_api.py", "/marketcheck_api_sdk/api/vin_decoder_api.py", "/marketcheck_api_sdk/models/base_listing.py", "/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/comparison_point.py", "/marketcheck_api_sdk/models/dealer.py", "/marketcheck_api_sdk/models/depreciation_stats.py", "/marketcheck_api_sdk/models/fuel_efficiency.py", "/marketcheck_api_sdk/models/listing_debug_attributes.py", "/marketcheck_api_sdk/models/listing_finance.py", "/marketcheck_api_sdk/models/listing_media.py", "/marketcheck_api_sdk/models/listing_nest_extra_attributes.py", "/marketcheck_api_sdk/models/make_model.py", "/marketcheck_api_sdk/models/mds.py", "/marketcheck_api_sdk/models/plot_point.py", "/marketcheck_api_sdk/models/safety_rating.py", "/marketcheck_api_sdk/models/sales.py", "/marketcheck_api_sdk/models/sales_stats.py", "/marketcheck_api_sdk/models/search_facets.py", "/marketcheck_api_sdk/models/search_stats.py", "/marketcheck_api_sdk/models/stats_item.py"], "/marketcheck_api_sdk/models/base_listing.py": ["/marketcheck_api_sdk/models/build.py", "/marketcheck_api_sdk/models/listing_finance.py"], "/test/test_dealer_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/dealer_api.py"], "/test/test_history_api.py": ["/marketcheck_api_sdk/__init__.py"], "/test/test_listings_api.py": ["/marketcheck_api_sdk/__init__.py", "/marketcheck_api_sdk/api/listings_api.py"]} |
49,107 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/source/migrations/0003_remove_source_category_class.py | # Generated by Django 3.0.3 on 2020-06-15 22:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('source', '0002_auto_20200604_0252'),
]
operations = [
migrations.RemoveField(
model_name='source',
name='category_class',
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,108 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/api/v1/article/views.py | """
THis module has views to get articles
"""
from django.shortcuts import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from etl.search import Search
from etl.category import ExtractionByCategory
from apps.article.serializers import ArticleSerializer
from apps.source.models import Source, Category
class SearchAPIView(APIView):
"""
Search arcticles y variois sources
"""
permission_classes = (IsAuthenticated,)
def get(self, request, *args, **kwargs):
"""
Search by key
:param request: Request object
:param args: Arguments
:param kwargs: Key arguments
:return: Response object
"""
print(args.__class__, request, self.__class__)
key = kwargs['key']
search = Search(Source.objects.filter(calification__gte=0))
search_results = search.search(key)
return Response(ArticleSerializer(search_results, many=True).data)
class CategorySearchAPIView(APIView):
"""
Search by Category
"""
permission_classes = (IsAuthenticated,)
def get(self, request, *args, **kwargs):
"""
Search by category
:param request: Request object
:param args: Arguments
:param kwargs: Key arguments
:return: Response object
"""
print(args.__class__, request, self.__class__)
primary_key = kwargs['pk']
if primary_key.isdigit():
category = get_object_or_404(Category, pk=primary_key)
search_results = ExtractionByCategory().extract(category)
return Response(ArticleSerializer(search_results, many=True).data)
return Response({'detail': 'Indice no valido'}, status=status.HTTP_400_BAD_REQUEST)
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,109 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/article/migrations/0004_article_source.py | # Generated by Django 3.0.3 on 2020-07-09 02:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('source', '0008_usercategory'),
('article', '0003_auto_20200709_0213'),
]
operations = [
migrations.AddField(
model_name='article',
name='source',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='source.Source'),
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,110 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/api/v1/source/views.py | """
This view is method for API view of Sources in first version
"""
from django.shortcuts import get_object_or_404
from rest_framework import generics, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from apps.article.models import Article
from apps.source.serializers import SourceCreateUpdateSerializer, SourceShowSerializer
from apps.source.models import Source
from permissions.permissions import AdminAuthenticationPermission
class SourceListAPIView(generics.ListAPIView):
"""
Returns list of sources
"""
queryset = Source.objects.filter(calification__gte=0)
serializer_class = SourceShowSerializer
class SourceCreateAPIView(generics.CreateAPIView):
"""
Interface to create sources
"""
queryset = Source.objects.all()
serializer_class = SourceCreateUpdateSerializer
permission_classes = (IsAuthenticated, AdminAuthenticationPermission)
class CalificateSourceAPIView(APIView):
"""
Interface to evaluate sources
"""
permission_classes = (IsAuthenticated,)
def put(self, request, pk):
"""
:param request: Request object
:param pk: primary key of articcle
:return: Response object
"""
print(self.request.user, " wants claficate an article")
article = get_object_or_404(Article, pk=pk)
calification = request.data.get('calification')
calification_num = 0
edit = False
neutral_evaluation = 0
if calification.__class__ == int and calification is not neutral_evaluation:
calification_num = calification / abs(calification)
edit = True
elif calification.__class__ == str and calification.isdigit():
edit = True
if int(calification) > 0:
calification_num = 1
elif (calification) < 0:
calification_num = -1
if edit:
article.source.calification = article.source.calification + calification_num
article.source.save()
return Response(SourceShowSerializer(article.source).data)
return Response({'detail': 'Bad Request'}, status=status.HTTP_400_BAD_REQUEST)
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,111 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/article/migrations/0007_auto_20200709_1600.py | # Generated by Django 3.0.3 on 2020-07-09 16:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0006_auto_20200709_0429'),
]
operations = [
migrations.AlterField(
model_name='article',
name='body',
field=models.CharField(max_length=300000),
),
migrations.AlterField(
model_name='article',
name='image',
field=models.URLField(default=None, max_length=4000),
),
migrations.AlterField(
model_name='article',
name='title',
field=models.CharField(max_length=3000),
),
migrations.AlterField(
model_name='article',
name='url',
field=models.URLField(max_length=4000),
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,112 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/source/migrations/0002_auto_20200604_0252.py | # Generated by Django 3.0.3 on 2020-06-04 02:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('source', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='source',
name='article_body_class',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='article_image_class',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='article_title_class',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='category_articles_link',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='category_class',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='homepage_articles_link',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='source',
name='search_articles_link',
field=models.CharField(max_length=100),
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,113 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/article/migrations/0001_initial.py | # Generated by Django 3.0.3 on 2020-07-09 02:04
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
('uuid', models.UUIDField(primary_key=True, serialize=False)),
('title', models.CharField(max_length=300)),
('body', models.CharField(max_length=3000)),
],
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,114 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/source/migrations/0007_auto_20200615_2305.py | # Generated by Django 3.0.3 on 2020-06-15 23:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('source', '0006_auto_20200615_2233'),
]
operations = [
migrations.AlterField(
model_name='sourcecategory',
name='category',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sources', to='source.Category'),
),
migrations.AlterField(
model_name='sourcecategory',
name='source',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='source.Source'),
),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
49,115 | ValeriaCalderon123/MyNews | refs/heads/master | /server/MyNews/apps/api/v1/auth/urls.py | """
This module has the urls for the views to User in the first version to API Rest Service
"""
from django.urls import path
from rest_framework.authtoken import views
from .views import Logout, CurrentUserAPIView
urlpatterns = [
path('', views.obtain_auth_token, name='login'),
path('logout/', Logout.as_view(), name='logout'),
path('user/', CurrentUserAPIView.as_view(), name='view'),
]
| {"/server/MyNews/apps/api/v1/auth/urls.py": ["/server/MyNews/apps/api/v1/auth/views.py"], "/server/MyNews/apps/source/admin.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/source/serializers.py": ["/server/MyNews/apps/source/models.py"], "/server/MyNews/apps/api/v1/source/urls.py": ["/server/MyNews/apps/api/v1/source/views.py"], "/server/MyNews/apps/api/v1/category/source/urls.py": ["/server/MyNews/apps/api/v1/category/source/views.py"], "/server/MyNews/apps/api/v1/category/urls.py": ["/server/MyNews/apps/api/v1/category/views.py"], "/server/MyNews/apps/api/v1/article/urls.py": ["/server/MyNews/apps/api/v1/article/views.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.