@@ -4,8 +4,41 @@ This is a loose collection of example scripts for pyghthouse.
44
55Run any script by entering ` python <filename> ` .
66
7- Some scripts have additional dependencies; you can install them by running ` pip install -r requirements.txt ` from the
8- repository root directory.
7+ Some scripts have additional dependencies; Check ` README.md ` in the repository root directory for an installation guide
98
109If you set up config.py with your username and API token, you won't have to enter them every time you run a script.
11- Be aware that API tokens are only valid for a few days.
10+ Be aware that API tokens are only valid for a few days.
11+
12+ ##### Beware:
13+ Python imports search for the modules in the current folder and in installed packages. So, if you haven't installed
14+ pyghthouse as a package, you need to change the imports of the files in this folder to work.
15+
16+ In the repository root directory should be a file called ` example.py ` . This file shows the usage of imports of
17+ pyghthouse without having it installed as a package.
18+ Note: To use the imports the same way as ` example.py ` , your skript has to be in the same folder.
19+
20+ ### Available functions
21+ Here you can find a list of functions containing in this package.
22+
23+ ` from_html(html_color) `
24+ Converts an HTML color string like FF7F00 or #c0ffee to RGB
25+
26+ ` from_hsv(h: float, s: float, v: float) `
27+ Converts HSV (float values between 0 and 1) colors to RGB.
28+
29+ ###### The class ` Pyghthouse ` with
30+ ` Pyghthouse(username: str, token: str, ...) `
31+ Set up the ` Pyghthouse ` object. Needed arguments are ` username ` and ` token ` . Optional arguments and further explanation
32+ can be found in the class definition (see ` pyghthouse\ph.py ` )
33+
34+ ` Pyghthouse.empty_image() `
35+ Creates a black image.
36+ This function can also be called with an instance of the ` Pyghthouse ` object (* ` <instance name>.empty_image() ` * )
37+
38+ ` <instance name>.set_image(image) `
39+ Sends the given ` image ` .
40+
41+ ` <instance name>.close() `
42+ Closes the connection.
43+
44+ * More functions can be found in ` pyghthouse\ph.py ` *
0 commit comments