summaryrefslogtreecommitdiffstats
path: root/src/lib/dataclasses.py
diff options
context:
space:
mode:
authorColin Wilk <colin.wilk@tum.de>2023-10-09 11:52:05 +0200
committerColin Wilk <colin.wilk@tum.de>2023-10-09 12:08:43 +0200
commitc61d6fc80d7c20f580ad111db59352b8eae7b7da (patch)
tree752979c86371d311b0d82043c8376eb56c3ed1ee /src/lib/dataclasses.py
parent1da7f1638babdfe4173d0e87ff3b45b32e0c9123 (diff)
downloadszuruboorupy-c61d6fc80d7c20f580ad111db59352b8eae7b7da.tar.gz
szuruboorupy-c61d6fc80d7c20f580ad111db59352b8eae7b7da.zip
Rename booru-sync to szuruboorupy
Initially the project was intended as a script repository containing scripts for managing my szurubooru instance. Since most of my work was actually writing an API client, I decided to rename this repository to an API client and do the script repository later on separately. Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to 'src/lib/dataclasses.py')
-rw-r--r--src/lib/dataclasses.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/lib/dataclasses.py b/src/lib/dataclasses.py
deleted file mode 100644
index 6313fca..0000000
--- a/src/lib/dataclasses.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-Module for collection of dataclasses that map Szurubooru objects to python classes
-"""
-
-
-from pydantic.dataclasses import dataclass
-from dataclasses import field
-from typing import List, Optional
-
-
-@dataclass
-class Tag:
- """A single tag. Tags are used to let users search for posts.
-
- The Szurubooru structure:
- .. code-block:: JSON
- {
- "version": <version>,
- "names": <names>,
- "category": <category>,
- "implications": <implications>,
- "suggestions": <suggestions>,
- "creationTime": <creation-time>,
- "lastEditTime": <last-edit-time>,
- "usages": <usage-count>,
- "description": <description>
- }
-
- **Field meaning**
- - `<version>`: resource version.
- - `<names>`: a list of tag names (aliases). Tagging a post with any name will
- automatically assign the first name from this list.
- - `<category>`: the name of the category the given tag belongs to.
- - `<implications>`: a list of implied tags, serialized as micro tag resource.
- - `<suggestions>`: a list of suggested tags, serialized as micro tag resource.
- - `<creation-time>`: time the tag was created, formatted as per RFC 3339.
- - `<last-edit-time>`: time the tag was edited, formatted as per RFC 3339.
- - `<usage-count>`: the number of posts the tag was used in.
- - `<description>`: the tag description (instructions how to use, history etc.)
- """
-
- name: str
- version: int = -1
- description: Optional[str] = ""
- category: str = "General"
- implications: List[str] = field(default_factory=list)
- suggestions: List[str] = field(default_factory=list)