Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion colourlovers/clapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


# API Wrapper
class ColourLovers(object):
class ColourLovers:
"""
ColourLovers API python wrapper
"""
Expand Down
12 changes: 6 additions & 6 deletions colourlovers/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Data containers for API responses
# Base classes
class CommonData(object):
class CommonData:
def __init__(self, json_data):
self.id = json_data["id"]
self.title = json_data["title"]
Expand Down Expand Up @@ -45,23 +45,23 @@ def hex_to_hsv(self):
return [tuple(colorsys.rgb_to_hsv(rgb_color[0], rgb_color[1], rgb_color[2])) for rgb_color in self.hex_to_rgb()]


class RGB(object):
class RGB:
def __init__(self, rgb):
self.red = rgb["red"]
self.green = rgb["green"]
self.blue = rgb["blue"]
self.rgb = (self.red, self.green, self.blue)


class HSV(object):
class HSV:
def __init__(self, hsv):
self.hue = hsv["hue"]
self.saturation = hsv["saturation"]
self.value = hsv["value"]
self.hsv = (self.hue, self.saturation, self.value)


class DrawColors(object):
class DrawColors:
def __init__(self, rgb_colors):
self.rgb_colors = rgb_colors
self.num_colors = len(self.rgb_colors)
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(self, json_data):
DrawColors.__init__(self, self.hex_to_rgb())


class Lover(object):
class Lover:
def __init__(self, json_data):
self.username = json_data["userName"]
self.date_registered = json_data["dateRegistered"]
Expand All @@ -121,6 +121,6 @@ def __init__(self, json_data):
# TODO: implement comments section -> switch


class Stats(object):
class Stats:
def __init__(self, json_data):
self.total = json_data["total"]
8 changes: 8 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
line-length = 120
target-version = "py310"

[lint]
extend-select = [
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
# https://github.com/asottile/pyupgrade
"UP",
]