Skip to content

Commit 404d29b

Browse files
authored
Merge pull request #127 from Geotab/results-limit-bug-async
Centralizes parameter utilities & fixes parameter bugs
2 parents ccd6a67 + 556879b commit 404d29b

File tree

17 files changed

+854
-675
lines changed

17 files changed

+854
-675
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
environment: test
1616
strategy:
1717
max-parallel: 1

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Changes
44
-------
55

6+
TBD
7+
+++
8+
9+
**Improvements**
10+
11+
- Centralized and better handling of new parameters in API calls (like `resultsLimit`, `search`, and `propertySelector`) `#127 <https://github.com/Geotab/mygeotab-python/pull/127>__`.
12+
13+
614
0.9.2 (2024-10-08)
715
++++++++++++++++++
816

Pipfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ verify_ssl = true
77
coverage = "*"
88
pytest = "*"
99
pytest-cov = "*"
10-
rope = "*"
1110
mygeotab = {editable = true,path = "."}
1211
mypy = "*"
1312
pytest-asyncio = "*"
14-
black = "*"
1513
requests-mock = "*"
1614
pytest-datadir = "*"
1715
pytest-benchmark = "*"

Pipfile.lock

Lines changed: 511 additions & 464 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/conf.py

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,39 @@
2020
# If extensions (or modules to document with autodoc) are in another directory,
2121
# add these directories to sys.path here. If the directory is relative to the
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
sys.path.append(os.path.abspath('..'))
23+
sys.path.append(os.path.abspath(".."))
2424

2525
# -- General configuration ------------------------------------------------
2626

2727
# If your documentation needs a minimal Sphinx version, state it here.
28-
#needs_sphinx = '1.0'
28+
# needs_sphinx = '1.0'
2929

3030
# Add any Sphinx extension module names here, as strings. They can be
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3232
# ones.
3333
extensions = [
34-
'sphinx.ext.autodoc',
35-
'sphinx.ext.doctest',
36-
'sphinx.ext.coverage',
37-
'sphinx.ext.viewcode',
38-
'sphinx_copybutton',
34+
"sphinx.ext.autodoc",
35+
"sphinx.ext.doctest",
36+
"sphinx.ext.coverage",
37+
"sphinx.ext.viewcode",
38+
"sphinx_copybutton",
3939
]
4040

4141
# Add any paths that contain templates here, relative to this directory.
42-
templates_path = ['_templates']
42+
templates_path = ["_templates"]
4343

4444
# The suffix of source filenames.
45-
source_suffix = '.rst'
45+
source_suffix = ".rst"
4646

4747
# The encoding of source files.
48-
#source_encoding = 'utf-8-sig'
48+
# source_encoding = 'utf-8-sig'
4949

5050
# The master toctree document.
51-
master_doc = 'index'
51+
master_doc = "index"
5252

5353
# General information about the project.
54-
project = u'MyGeotab Python SDK'
55-
copyright = u'{}, {}'.format(datetime.datetime.utcnow().year, mygeotab.__author__)
54+
project = "MyGeotab Python SDK"
55+
copyright = "{}, {}".format(datetime.datetime.utcnow().year, mygeotab.__author__)
5656

5757
# The version info for the project you're documenting, acts as replacement for
5858
# |version| and |release|, also used in various other places throughout the
@@ -65,51 +65,49 @@
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.
68-
#language = None
68+
# language = None
6969

7070
# There are two options for replacing |today|: either, you set today to some
7171
# non-false value, then it is used:
72-
#today = ''
72+
# today = ''
7373
# Else, today_fmt is used as the format for a strftime call.
74-
#today_fmt = '%B %d, %Y'
74+
# today_fmt = '%B %d, %Y'
7575

7676
# List of patterns, relative to source directory, that match files and
7777
# directories to ignore when looking for source files.
78-
exclude_patterns = ['_build']
78+
exclude_patterns = ["_build"]
7979

8080
# The reST default role (used for this markup: `text`) to use for all
8181
# documents.
82-
#default_role = None
82+
# default_role = None
8383

8484
# If true, '()' will be appended to :func: etc. cross-reference text.
85-
#add_function_parentheses = True
85+
# add_function_parentheses = True
8686

8787
# If true, the current module name will be prepended to all description
8888
# unit titles (such as .. function::).
89-
#add_module_names = True
89+
# add_module_names = True
9090

9191
# If true, sectionauthor and moduleauthor directives will be shown in the
9292
# output. They are ignored by default.
93-
#show_authors = False
93+
# show_authors = False
9494

9595
# The name of the Pygments (syntax highlighting) style to use.
96-
pygments_style = 'sphinx'
96+
pygments_style = "sphinx"
9797

9898
# A list of ignored prefixes for module index sorting.
99-
#modindex_common_prefix = []
99+
# modindex_common_prefix = []
100100

101101
# If true, keep warnings as "system message" paragraphs in the built documents.
102-
#keep_warnings = False
102+
# keep_warnings = False
103103

104104

105105
# -- Options for HTML output ----------------------------------------------
106106

107-
html_theme = 'furo'
107+
html_theme = "furo"
108108

109109
html_theme_options = {
110-
"light_css_variables": {
111-
"font-stack": "Roboto, Helvetica Neue, Helvetica, Arial, sans-serif"
112-
},
110+
"light_css_variables": {"font-stack": "Roboto, Helvetica Neue, Helvetica, Arial, sans-serif"},
113111
}
114112

115113
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
@@ -119,125 +117,119 @@
119117
html_title = project
120118

121119
# A shorter title for the navigation bar. Default is the same as html_title.
122-
#html_short_title = None
120+
# html_short_title = None
123121

124122
# The name of an image file (relative to this directory) to place at the top
125123
# of the sidebar.
126-
#html_logo = None
124+
# html_logo = None
127125

128126
# The name of an image file (within the static path) to use as favicon of the
129127
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
130128
# pixels large.
131-
#html_favicon = None
129+
# html_favicon = None
132130

133131
# Add any paths that contain custom static files (such as style sheets) here,
134132
# relative to this directory. They are copied after the builtin static files,
135133
# so a file named "default.css" will overwrite the builtin "default.css".
136-
html_static_path = ['_static']
134+
html_static_path = ["_static"]
137135

138136
# Add any extra paths that contain custom files (such as robots.txt or
139137
# .htaccess) here, relative to this directory. These files are copied
140138
# directly to the root of the documentation.
141-
#html_extra_path = []
139+
# html_extra_path = []
142140

143141
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
144142
# using the given strftime format.
145-
#html_last_updated_fmt = '%b %d, %Y'
143+
# html_last_updated_fmt = '%b %d, %Y'
146144

147145
# If true, SmartyPants will be used to convert quotes and dashes to
148146
# typographically correct entities.
149-
#html_use_smartypants = True
147+
# html_use_smartypants = True
150148

151149
# Custom sidebar templates, maps document names to template names.
152-
#html_sidebars = {}
150+
# html_sidebars = {}
153151

154152
# Additional templates that should be rendered to pages, maps page names to
155153
# template names.
156-
#html_additional_pages = {}
154+
# html_additional_pages = {}
157155

158156
# If false, no module index is generated.
159-
#html_domain_indices = True
157+
# html_domain_indices = True
160158

161159
# If false, no index is generated.
162-
#html_use_index = True
160+
# html_use_index = True
163161

164162
# If true, the index is split into individual pages for each letter.
165-
#html_split_index = False
163+
# html_split_index = False
166164

167165
# If true, links to the reST sources are added to the pages.
168-
#html_show_sourcelink = True
166+
# html_show_sourcelink = True
169167

170168
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
171-
#html_show_sphinx = True
169+
# html_show_sphinx = True
172170

173171
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
174-
#html_show_copyright = True
172+
# html_show_copyright = True
175173

176174
# If true, an OpenSearch description file will be output, and all pages will
177175
# contain a <link> tag referring to it. The value of this option must be the
178176
# base URL from which the finished HTML is served.
179-
#html_use_opensearch = ''
177+
# html_use_opensearch = ''
180178

181179
# This is the file name suffix for HTML files (e.g. ".xhtml").
182-
#html_file_suffix = None
180+
# html_file_suffix = None
183181

184182
# Output file base name for HTML help builder.
185-
htmlhelp_basename = 'MyGeotabPythonSDKdoc'
183+
htmlhelp_basename = "MyGeotabPythonSDKdoc"
186184

187185

188186
# -- Options for LaTeX output ---------------------------------------------
189187

190188
latex_elements = {
191-
# The paper size ('letterpaper' or 'a4paper').
192-
#'papersize': 'letterpaper',
193-
194-
# The font size ('10pt', '11pt' or '12pt').
195-
#'pointsize': '10pt',
196-
197-
# Additional stuff for the LaTeX preamble.
198-
#'preamble': '',
189+
# The paper size ('letterpaper' or 'a4paper').
190+
#'papersize': 'letterpaper',
191+
# The font size ('10pt', '11pt' or '12pt').
192+
#'pointsize': '10pt',
193+
# Additional stuff for the LaTeX preamble.
194+
#'preamble': '',
199195
}
200196

201197
# Grouping the document tree into LaTeX files. List of tuples
202198
# (source start file, target name, title,
203199
# author, documentclass [howto, manual, or own class]).
204200
latex_documents = [
205-
('index', 'MyGeotabPythonSDK.tex', u'MyGeotab Python SDK Documentation',
206-
mygeotab.__author__, 'manual'),
201+
("index", "MyGeotabPythonSDK.tex", "MyGeotab Python SDK Documentation", mygeotab.__author__, "manual"),
207202
]
208203

209204
# The name of an image file (relative to this directory) to place at the top of
210205
# the title page.
211-
#latex_logo = None
206+
# latex_logo = None
212207

213208
# For "manual" documents, if this is true, then toplevel headings are parts,
214209
# not chapters.
215-
#latex_use_parts = False
210+
# latex_use_parts = False
216211

217212
# If true, show page references after internal links.
218-
#latex_show_pagerefs = False
213+
# latex_show_pagerefs = False
219214

220215
# If true, show URL addresses after external links.
221-
#latex_show_urls = False
216+
# latex_show_urls = False
222217

223218
# Documents to append as an appendix to all manuals.
224-
#latex_appendices = []
219+
# latex_appendices = []
225220

226221
# If false, no module index is generated.
227-
#latex_domain_indices = True
222+
# latex_domain_indices = True
228223

229224

230225
# -- Options for manual page output ---------------------------------------
231226

232227
# One entry per manual page. List of tuples
233228
# (source start file, name, description, authors, manual section).
234-
man_pages = [
235-
('index', 'mygeotabpythonsdk', u'MyGeotab Python SDK Documentation',
236-
[mygeotab.__author__], 1)
237-
]
229+
man_pages = [("index", "mygeotabpythonsdk", "MyGeotab Python SDK Documentation", [mygeotab.__author__], 1)]
238230

239231
# If true, show URL addresses after external links.
240-
#man_show_urls = False
232+
# man_show_urls = False
241233

242234

243235
# -- Options for Texinfo output -------------------------------------------
@@ -246,27 +238,33 @@
246238
# (source start file, target name, title, author,
247239
# dir menu entry, description, category)
248240
texinfo_documents = [
249-
('index', 'MyGeotabPythonSDK', u'MyGeotab Python SDK Documentation',
250-
mygeotab.__author__, 'MyGeotabPythonSDK', 'One line description of project.',
251-
'Miscellaneous'),
241+
(
242+
"index",
243+
"MyGeotabPythonSDK",
244+
"MyGeotab Python SDK Documentation",
245+
mygeotab.__author__,
246+
"MyGeotabPythonSDK",
247+
"One line description of project.",
248+
"Miscellaneous",
249+
),
252250
]
253251

254252
# Documents to append as an appendix to all manuals.
255-
#texinfo_appendices = []
253+
# texinfo_appendices = []
256254

257255
# If false, no module index is generated.
258-
#texinfo_domain_indices = True
256+
# texinfo_domain_indices = True
259257

260258
# How to display URL addresses: 'footnote', 'no', or 'inline'.
261-
#texinfo_show_urls = 'footnote'
259+
# texinfo_show_urls = 'footnote'
262260

263261
# If true, do not generate a @detailmenu in the "Top" node's menu.
264-
#texinfo_no_detailmenu = False
262+
# texinfo_no_detailmenu = False
265263

266264
autodoc_default_options = {
267-
'members': True,
268-
'member-order': 'bysource',
269-
'special-members': '__init__',
270-
'undoc-members': True,
271-
'exclude-members': '__weakref__'
265+
"members": True,
266+
"member-order": "bysource",
267+
"special-members": "__init__",
268+
"undoc-members": True,
269+
"exclude-members": "__weakref__",
272270
}

examples/notebooks/Visualizing MyGeotab Data with Python.ipynb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
44-
"username = input('Username: ')\n",
45-
"database = input('Database: ')\n",
46-
"client = mygeotab.API(username=username, password=getpass.getpass('Password: '), database=database)"
44+
"username = input(\"Username: \")\n",
45+
"database = input(\"Database: \")\n",
46+
"client = mygeotab.API(username=username, password=getpass.getpass(\"Password: \"), database=database)"
4747
]
4848
},
4949
{
@@ -63,7 +63,7 @@
6363
},
6464
"outputs": [],
6565
"source": [
66-
"device_statuses = client.get('DeviceStatusInfo')"
66+
"device_statuses = client.get(\"DeviceStatusInfo\")"
6767
]
6868
},
6969
{
@@ -108,12 +108,9 @@
108108
"outputs": [],
109109
"source": [
110110
"for status in device_statuses:\n",
111-
" if status.get('latitude'):\n",
112-
" device = status['device']\n",
113-
" folium.Marker(\n",
114-
" location=[status.get('latitude'), status.get('longitude')],\n",
115-
" popup=device['id']\n",
116-
" ).add_to(marker_cluster)\n"
111+
" if status.get(\"latitude\"):\n",
112+
" device = status[\"device\"]\n",
113+
" folium.Marker(location=[status.get(\"latitude\"), status.get(\"longitude\")], popup=device[\"id\"]).add_to(marker_cluster)"
117114
]
118115
},
119116
{

0 commit comments

Comments
 (0)