The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.
No print, only log: I'm working on a project that uses roboflow-python and rather than making changes to suppress stdout for this module, I updated it to use a Python logger instead.
Every module gets its own logger using logging.getLogger(__name__).
Everything is logged as INFO.
The logger uses f-strings because the optimization benefit for not using them really doesn't matter here. Ruff now ignores G003 and G004 as a result.
Type of change
[x] New feature (non-breaking change which adds functionality)
How has this change been tested, please provide a testcase or example of how you tested the change?
Ruff and mypy checks pass.
Any specific deployment considerations
I know there are still interactive prompts in there; for my next trick, I might figure out something to do with them for when running in a non-interactive environment.
Description
No
print
, onlylog
: I'm working on a project that usesroboflow-python
and rather than making changes to suppress stdout for this module, I updated it to use a Python logger instead.Every module gets its own logger using
logging.getLogger(__name__)
.Everything is logged as INFO.
The logger uses f-strings because the optimization benefit for not using them really doesn't matter here. Ruff now ignores G003 and G004 as a result.
Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Ruff and mypy checks pass.
Any specific deployment considerations
I know there are still interactive prompts in there; for my next trick, I might figure out something to do with them for when running in a non-interactive environment.