papi-projects 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.1
2
+ Name: papi-projects
3
+ Version: 0.1.2
4
+ Summary: PAPI is an API for managing projects
5
+ License: MIT
6
+ Author: sandyjmacdonald
7
+ Author-email: sandyjmacdonald@gmail.com
8
+ Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Requires-Dist: httpx (>=0.27.2,<0.28.0)
14
+ Requires-Dist: pendulum (>=3.0.0,<4.0.0)
15
+ Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
16
+ Requires-Dist: tinydb (>=4.8.0,<5.0.0)
17
+ Description-Content-Type: text/markdown
18
+
19
+ PAPI is an API for managing projects.
20
+
21
+ It has functionality for creating User and Project instances, storing users in a TinyDB database, and generating project IDs in the format we use in the Data Science group (at the Bioscience Technology Facility at the University of York). It also has wrappers for Asana and Toggl Track, two tools we use for project management and time tracking, respectively.
22
+
23
+ Much of the functionality is tailor-made to the way we manage projects in our group, but make of it what you will!
24
+
25
+ ## Installation
26
+
27
+ The simplest way to install this is to do as follows:
28
+
29
+ ```
30
+ pip install papi-projects
31
+ ```
32
+
33
+ You can also install the Poetry packaging and dependency tool and then clone this repository and install with poetry, as follows:
34
+
35
+ ```
36
+ pipx install poetry
37
+ git clone https://github.com/sandyjmacdonald/papi
38
+ cd papi
39
+ poetry install
40
+ ```
41
+
42
+ ## Environment variables
43
+
44
+ The Asana and Toggl Track wrappers expect several environment variables for API keys, etc. and the best way to do this is with a .env file that can be loaded via the Python dotenv library straight into your script. The CLI scripts provided also expect these variables to be in a .env file.
45
+
46
+ The .env file should look as follows:
47
+
48
+ ```
49
+ # Asana config:
50
+ ASANA_API_KEY="YOURAPIKEY"
51
+ ASANA_PASSWORD=""
52
+ ASANA_WORKSPACE="myworkspace"
53
+ ASANA_TEAM="My Team Name"
54
+
55
+ # toggl track config:
56
+ TOGGL_TRACK_API_KEY="YOURAPIKEY"
57
+ TOGGL_TRACK_PASSWORD="api_token"
58
+ TOGGL_TRACK_WORKSPACE="My Workspace Name"
59
+ ```
60
+
61
+ The `ASANA_PASSWORD` and `TOGGL_TRACK_PASSWORD` values can be left as above, the remaining ones should be replaced with the correct values from your Asana and Toggl Track accounts.
62
+
63
+ This .env file can either be put in your working directory or in the top-level papi module folder wherever it is installed.
64
+
65
+ Alternatively, these values can be hard-coded in your scripts, but this is not advised and will not work with the CLI scripts provided.
66
+
67
+ ## CLI scripts
68
+
69
+ Two convenience CLI scripts are provided for common Toggl Track tasks. They are:
70
+
71
+ ## create-toggl-project
72
+
73
+ This script creates a project ID if necessary, and adds the project to your Toggl Track:
74
+
75
+ ```
76
+ usage: create-toggl-project [-h] [-u USER_ID] [-g GRANT_CODE] [-n NAME] [-p PROJECT_ID]
77
+
78
+ options:
79
+ -h, --help show this help message and exit
80
+ -u USER_ID, --user_id USER_ID
81
+ three-letter user ID, e.g. CRD
82
+ -g GRANT_CODE, --grant_code GRANT_CODE
83
+ grant code, e.g. R12345
84
+ -n NAME, --name NAME short project name, e.g. 'RNA-seq analysis'
85
+ -p PROJECT_ID, --project_id PROJECT_ID
86
+ full project ID, e.g. P2024-ABC-DEFG, if already generated
87
+ ```
88
+
89
+ Ideally, a three-character user ID, grant code, and short project name will be provided, and PAPI will generate the project ID, e.g.
90
+
91
+ ```
92
+ create-toggl-project -u CRD -g R12345 -n 'Such project. Wow.'
93
+ ```
94
+
95
+ If a project ID has already been created, then it can be provided via the `-p` argument and the user ID is not necessary, e.g.
96
+
97
+ ```
98
+ create-toggl-project -p P2024-CRD-ABCD -g R12345 -n 'Such project. Wow.'
99
+ ```
100
+
101
+ The grant code (`-g`) and name (`-n`) are not required, but either a project ID (`-p`) or user ID (`-u`) _is_ necessary.
102
+
103
+ ## collate-toggl-hours
104
+
105
+ This script collates and returns your Toggl Track hours tracked over a specified time period:
106
+
107
+ ```
108
+ usage: collate-toggl-hours [-h] -s START [-e END] [-o OUTPUT]
109
+
110
+ options:
111
+ -h, --help show this help message and exit
112
+ -s START, --start START
113
+ start date in YYYY-MM-DD format
114
+ -e END, --end END end date in YYYY-MM-DD format, if none supplied then end date is now
115
+ -o OUTPUT, --output OUTPUT
116
+ output TSV filename, omit to write to stdout
117
+ ```
118
+
119
+ This script collates your tracked hours for any projects worked during a given time period and return the project name and decimal number of hours in tab-separated format.
120
+
121
+ If an output filename is provided, then the resulting hours are saved to that file, otherwise they are printed to stdout.
122
+
123
+ If no end date (`-e`) is provided, then the end date is the current time/date.
124
+
125
+ To collate your hours worked in August 2024:
126
+
127
+ ```
128
+ collate-toggl-hours -s 2024-08-01 -e 2024-08-31 -o august-2024-hours.tsv
129
+ ```
@@ -0,0 +1,111 @@
1
+ PAPI is an API for managing projects.
2
+
3
+ It has functionality for creating User and Project instances, storing users in a TinyDB database, and generating project IDs in the format we use in the Data Science group (at the Bioscience Technology Facility at the University of York). It also has wrappers for Asana and Toggl Track, two tools we use for project management and time tracking, respectively.
4
+
5
+ Much of the functionality is tailor-made to the way we manage projects in our group, but make of it what you will!
6
+
7
+ ## Installation
8
+
9
+ The simplest way to install this is to do as follows:
10
+
11
+ ```
12
+ pip install papi-projects
13
+ ```
14
+
15
+ You can also install the Poetry packaging and dependency tool and then clone this repository and install with poetry, as follows:
16
+
17
+ ```
18
+ pipx install poetry
19
+ git clone https://github.com/sandyjmacdonald/papi
20
+ cd papi
21
+ poetry install
22
+ ```
23
+
24
+ ## Environment variables
25
+
26
+ The Asana and Toggl Track wrappers expect several environment variables for API keys, etc. and the best way to do this is with a .env file that can be loaded via the Python dotenv library straight into your script. The CLI scripts provided also expect these variables to be in a .env file.
27
+
28
+ The .env file should look as follows:
29
+
30
+ ```
31
+ # Asana config:
32
+ ASANA_API_KEY="YOURAPIKEY"
33
+ ASANA_PASSWORD=""
34
+ ASANA_WORKSPACE="myworkspace"
35
+ ASANA_TEAM="My Team Name"
36
+
37
+ # toggl track config:
38
+ TOGGL_TRACK_API_KEY="YOURAPIKEY"
39
+ TOGGL_TRACK_PASSWORD="api_token"
40
+ TOGGL_TRACK_WORKSPACE="My Workspace Name"
41
+ ```
42
+
43
+ The `ASANA_PASSWORD` and `TOGGL_TRACK_PASSWORD` values can be left as above, the remaining ones should be replaced with the correct values from your Asana and Toggl Track accounts.
44
+
45
+ This .env file can either be put in your working directory or in the top-level papi module folder wherever it is installed.
46
+
47
+ Alternatively, these values can be hard-coded in your scripts, but this is not advised and will not work with the CLI scripts provided.
48
+
49
+ ## CLI scripts
50
+
51
+ Two convenience CLI scripts are provided for common Toggl Track tasks. They are:
52
+
53
+ ## create-toggl-project
54
+
55
+ This script creates a project ID if necessary, and adds the project to your Toggl Track:
56
+
57
+ ```
58
+ usage: create-toggl-project [-h] [-u USER_ID] [-g GRANT_CODE] [-n NAME] [-p PROJECT_ID]
59
+
60
+ options:
61
+ -h, --help show this help message and exit
62
+ -u USER_ID, --user_id USER_ID
63
+ three-letter user ID, e.g. CRD
64
+ -g GRANT_CODE, --grant_code GRANT_CODE
65
+ grant code, e.g. R12345
66
+ -n NAME, --name NAME short project name, e.g. 'RNA-seq analysis'
67
+ -p PROJECT_ID, --project_id PROJECT_ID
68
+ full project ID, e.g. P2024-ABC-DEFG, if already generated
69
+ ```
70
+
71
+ Ideally, a three-character user ID, grant code, and short project name will be provided, and PAPI will generate the project ID, e.g.
72
+
73
+ ```
74
+ create-toggl-project -u CRD -g R12345 -n 'Such project. Wow.'
75
+ ```
76
+
77
+ If a project ID has already been created, then it can be provided via the `-p` argument and the user ID is not necessary, e.g.
78
+
79
+ ```
80
+ create-toggl-project -p P2024-CRD-ABCD -g R12345 -n 'Such project. Wow.'
81
+ ```
82
+
83
+ The grant code (`-g`) and name (`-n`) are not required, but either a project ID (`-p`) or user ID (`-u`) _is_ necessary.
84
+
85
+ ## collate-toggl-hours
86
+
87
+ This script collates and returns your Toggl Track hours tracked over a specified time period:
88
+
89
+ ```
90
+ usage: collate-toggl-hours [-h] -s START [-e END] [-o OUTPUT]
91
+
92
+ options:
93
+ -h, --help show this help message and exit
94
+ -s START, --start START
95
+ start date in YYYY-MM-DD format
96
+ -e END, --end END end date in YYYY-MM-DD format, if none supplied then end date is now
97
+ -o OUTPUT, --output OUTPUT
98
+ output TSV filename, omit to write to stdout
99
+ ```
100
+
101
+ This script collates your tracked hours for any projects worked during a given time period and return the project name and decimal number of hours in tab-separated format.
102
+
103
+ If an output filename is provided, then the resulting hours are saved to that file, otherwise they are printed to stdout.
104
+
105
+ If no end date (`-e`) is provided, then the end date is the current time/date.
106
+
107
+ To collate your hours worked in August 2024:
108
+
109
+ ```
110
+ collate-toggl-hours -s 2024-08-01 -e 2024-08-31 -o august-2024-hours.tsv
111
+ ```
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "papi-projects"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "PAPI is an API for managing projects"
5
5
  authors = ["sandyjmacdonald <sandyjmacdonald@gmail.com>"]
6
6
  license = "MIT"
@@ -1,19 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: papi-projects
3
- Version: 0.1.1
4
- Summary: PAPI is an API for managing projects
5
- License: MIT
6
- Author: sandyjmacdonald
7
- Author-email: sandyjmacdonald@gmail.com
8
- Requires-Python: >=3.11,<4.0
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: httpx (>=0.27.2,<0.28.0)
14
- Requires-Dist: pendulum (>=3.0.0,<4.0.0)
15
- Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
16
- Requires-Dist: tinydb (>=4.8.0,<5.0.0)
17
- Description-Content-Type: text/markdown
18
-
19
-
File without changes