Skip to content

Commit c14fae6

Browse files
committed
Updated readme and requirements
1 parent c1d1802 commit c14fae6

File tree

2 files changed

+58
-83
lines changed

2 files changed

+58
-83
lines changed

README.md

+57-83
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Overview
22

3-
This is a set of Python tools for helping with the migration from FOLIO OKAPI platform to FOLIO Eureka platform. A lot of the scripts need to be ran in the order presented below as they build upon each other. I purposely did not combine them into a single function as to allow for the review of data at each step.
3+
This repository contains a set of Python tools to assist with the migration from the FOLIO OKAPI platform to the FOLIO Eureka platform. Many of the scripts need to be run in the order presented below as they build upon each other. I purposely did not combine them into a single function to allow for the review of data at each step.
4+
45

56
# Installation
67

@@ -13,7 +14,7 @@ pip install -r requirements.txt
1314

1415
# Running
1516

16-
There is an interactive menu that has been added to make it easier to run the included scripts. This menu can be accessed by running:
17+
An interactive menu has been added to make it easier to run the included scripts. This menu can be accessed by running:
1718

1819

1920
```bash
@@ -23,34 +24,32 @@ python ./main.py
2324
## Menu options
2425

2526
### 1. Pull Reference Data:
26-
2727
This menu option runs four scripts:
28-
- Script one pulls all OKAPI permissions.
29-
- Script two pulls all EUREKA Capabilities .
30-
- Script three pulls all EUREKA Capability Sets.
31-
- Script four pulls all OKAPI User Permissions from your reference environment.
28+
- Script one pulls all OKAPI permissions.
29+
- Script two pulls all Eureka capabilities.
30+
- Script three pulls all Eureka capability sets.
31+
- Script four pulls all OKAPI user permissions from your reference environment.
3232

3333
### 2. Build Comparisons:
34-
3534
This menu option runs three comparison scripts against the data pulled in the first menu option.
36-
- Script one add all the sub capability data to the capability sets; this option also generates a web page displaying tthe data in an easy to read format.
37-
- Script two compares permissions to capabilities.
38-
- Script three builds a comparison of current user permission sets to capabilities.
3935

40-
### 3. Build Working CSV and HTML File:
36+
- Script one adds all the sub-capability data to the capability sets; this option also generates a web page displaying the data in an easy-to-read format.
37+
- Script two compares permissions to capabilities.
38+
- Script three builds a comparison of current user permission sets to capabilities.
39+
40+
### 3. Build Working CSV and HTML File:
41+
This menu option runs two scripts that build upon the data generated in the second menu option.
4142

42-
This menu option runs two scripts that builds upon the data generated in the second menu option.
43-
- Script one looks at the data generated from comaring the current user permissions to capabilities and looks to see what capability sets could be used to fullfill the orginal permission sets. This file can be edited and resubmitted.
44-
- Script two creates the "FOLIO Roles Simulator" web interface. This uses the data collected in the previous steps to create a dynamic web interface to test creating roles.
43+
- Script one looks at the data generated from comparing the current user permissions to capabilities and identifies which capability sets could be used to fulfill the original permission sets. This file can be edited and resubmitted.
44+
- Script two creates the "FOLIO Roles Simulator" web interface. This uses the data collected in the previous steps to create a dynamic web interface to test creating roles.
4545

4646

4747
### 4. Reprocess the Capability Set Selection File (csv):
4848

49-
This menu option takes the CSV file generated in menu option 3 and re-precesses it.
49+
This menu option takes the CSV file generated in menu option 3 and reprocesses it.
5050

5151
### 5. Run a Specific Script:
52-
53-
Each of theses menu options are outlined below.
52+
Each of these menu options is outlined below.
5453

5554
- **Pull Reference Data - OKAPI Permissions**:
5655
- **Pull Reference Data - Capability Sets**:
@@ -73,107 +72,87 @@ Each of theses menu options are outlined below.
7372
## Data Retrieval Functions
7473

7574
## Pull Reference Data - OKAPI Permissions
76-
77-
!!! Run First !!!
78-
This script needs to be ran first to pull all the permission sets from an OKAPI instance of FOLIO. By Default Ramsons BugFest has been added to the .env file.
75+
**Run First!** This script needs to be run first to pull all the permission sets from an OKAPI instance of FOLIO. By default, Ramsons BugFest has been added to the `.env` file.
7976

8077
## Pull Reference Data - Capability Sets
8178

82-
!!! Run First !!!
83-
84-
This script pulls the Capability Sets from the Eureka platform and saves them in JSON format to be used later.
85-
86-
- _At this time i can not log in via the API, so the JSON was pulled via the web interface and saved into a JSON file._
79+
**Run First!** This script pulls the capability sets from the Eureka platform and saves them in JSON format to be used later.
8780

8881
## Pull Reference Data - Capabilities
8982

90-
!!! Run First !!!
91-
92-
This script pulls the Capabilities from the Eureka platform and saves them in JSON format to be used later.
83+
**Run First!** This script pulls the capabilities from the Eureka platform and saves them in JSON format to be used later.
9384

9485
## Pull Reference Data - OKAPI Permission Sets
9586

96-
This script pulls the current permission sets form your reference system and saves them in JSON format. The reference system should be a production or test system with a current set of user permission sets.
87+
This script pulls the current permission sets from your reference system and saves them in JSON format. The reference system should be a production or test system with a current set of user permission sets.
9788

9889
---
9990
## Data Formatting Functions
10091

10192
## Expanded Capability Sets
10293

103-
This scripts takes the Capability set data and expands out the linked capabilities.
94+
This script takes the capability set data and expands the linked capabilities.
10495

10596
### Files generated:
106-
107-
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED`: JSON file listing all the capability sets and the capabilities assigned to that set
108-
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED_CSV`: CSV file of the same data set.
109-
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED_HTML`: HTML Table view that can be opened directly in the browser or saved to Confluence.
97+
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED`: JSON file listing all the capability sets and the capabilities assigned to that set.
98+
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED_CSV`: CSV file of the same data set.
99+
- `FILE_EUREKA_CAPABILITY_SETS_EXPANDED_HTML`: HTML table view that can be opened directly in the browser or saved to Confluence.
110100

111101
## Compare OKAPI Permissions to Eureka Capabilities
112102

113-
This script pulls the Capability Sets and uses the published names to match them to a OKAPI permission set. It expands on the included capabilities and permissions to show the names and UUIDS. Two files are generated:
114-
`FILE_COMPARED_SETS_TO_PERMISSIONS`: JSON file with all the collected data
115-
`FILE_COMPARED_SETS_TO_PERMISSIONS_CSV`: CV file that can be opened in Excel for easier viewing. the first row is are the headers. The data is formatted as:
116-
117-
**Eureka capability set**: _id name type resource description action_
118-
119-
**Found OKAPI Permission Set**: _okapiDisplayName_
120-
121-
**Eureka linked Capabilities**: _subCapabilities.name subCapabilities.type subCapabilities.resource subCapabilities.description subCapabilities.action_
103+
This script pulls the capability sets and uses the published names to match them to an OKAPI permission set. It expands on the included capabilities and permissions to show the names and UUIDs. Two files are generated:
122104

123-
**OKAPI sub permissions (if a Matching permission set is found)**: _okapiSubPermissions.name okapiSubPermissions.description okapiSubPermissions.permissionName_
105+
- `FILE_COMPARED_SETS_TO_PERMISSIONS`: JSON file with all the collected data.
106+
- `FILE_COMPARED_SETS_TO_PERMISSIONS_CSV`: CSV file that can be opened in Excel for easier viewing. The first row contains the headers. The data is formatted as:
107+
- **Eureka capability set**_id, name, type, resource, description, action_
108+
- **Found OKAPI Permission Set**_okapiDisplayName_
109+
- **Eureka linked Capabilities**_subCapabilities.name, subCapabilities.type, subCapabilities.resource, subCapabilities.description, subCapabilities.action_
110+
- **OKAPI sub-permissions (if a matching permission set is found)**_okapiSubPermissions.name, okapiSubPermissions.description, okapiSubPermissions.permissionName_
124111

125112

126113
## Compare Current User Permission Sets to Eureka Capabilities
127114

128-
This script takes current permission sets in the reference environment (visible, and mutable) expands the sub permissions. During this process it adds the supervision name, and description if they are included. it also looks to see if there is a matching capability, and lists that data.
129-
This should allow a user to re-create a permission set using just capabilities.
115+
This script takes current permission sets in the reference environment (visible and mutable) and expands the sub-permissions. During this process, it adds the supervision name and description if they are included. It also looks to see if there is a matching capability and lists that data. This should allow a user to recreate a permission set using just capabilities.
130116

131117
### Files generated:
132-
133-
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
134-
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
118+
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data.
119+
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set.
135120

136121
---
137122
## Create Working Documents
138123

139124
## Find Possible Capability Matches to OKAPI Permissions
125+
This script will look at the JSON generated from `compareCurrentToCapabilities.py` and compare the assigned capability sets, ranking which set may best fit a new role that will match the permission set. It does this by looking at the capability sets' individual capabilities and then matching those to the ones in the permission set. The following data will be added:
140126

141-
This script will look that the JSON generated from `compareCurrentToCapabilities.py` and compare the assigned Compatibility sets and rank what set may bes fit in a new role that will match the Permission Set. It does this by looking at the capability Sets individual capabilitys and then matches thos to the ones in the permission set. The fallowing data will be added:
142-
143-
**Total** - Total number of capabilities in the set
144-
145-
**Matching** - Number of matching Capabilities to the permission set
127+
- **Total**: Total number of capabilities in the set.
128+
- **Matching**: Number of matching capabilities to the permission set.
129+
- **Ranking**: Based on the percentage of total number of capabilities that match. Items with a rank of 0 or lower than X will be ignored.
146130

147-
**Ranking** - based on the percentage of total number of capabilities that match
148-
149-
Items with a rank of 0 or lower then X will be ignored.
150-
151-
### Files generated:
131+
#### Files generated:
152132

153-
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data
154-
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set
133+
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES`: JSON version of the expanded data.
134+
- `FILE_COMPARED_CURRENT_TO_CAPABILITIES_CSV`: CSV version of the same data set.
155135

156136
## Build Web Interface - FOLIO Roles Simulator
157-
158-
This script will take the data produced in the previous scripts and generate a web interface that allows a user to pull up a current Permission Set and rebuild it using Capability Sets and Capabilities. No server is required to run this page it runs entirely in the users browser.
137+
This script will take the data produced in the previous scripts and generate a web interface that allows a user to pull up a current permission set and rebuild it using capability sets and capabilities. No server is required to run this page; it runs entirely in the user's browser.
159138

160139
### How to use
161-
162-
- Open the generated HTML in the browser of you choice (tested with Chrome)
163-
- Select a Permission Set from the drop down in the left hand side of the screen. (red arrow)
164-
- Using the interface on the right side of the screen first start to select Capability sets to fill in the majority of your missing capabilities, for your permission set. (blue arrow)
165-
- Use the Capabilities section to fill any smaller gaps. (blue arrow)
140+
- Open the generated HTML in the browser of your choice (tested with Chrome).
141+
- Select a permission set from the drop-down on the left-hand side of the screen (red arrow).
142+
- Using the interface on the right side of the screen, start by selecting capability sets to fill in the majority of your missing capabilities for your permission set (blue arrow).
143+
- Use the capabilities section to fill any smaller gaps (blue arrow).
166144

167145
![Overview of the web interface](References/image.png)
168146

169-
In this image you can see that the Permission Set "Acq Unopen Reopen" has been selected. The three sections under the selection box are:
170-
- Missing Capabilities: Theres are the capabilites that the scripts have identifed that are needed to re-create the permission set, btu are currently missing. In this example since no Capability Sets or Capabilities are selected all sub Capabilities are displayed.
171-
- Extra Capabilities: These are capabilities that where added by selecting either Capability Sets or Capabilities on the left.
172-
- Assigned Capabilities: These are the currently assigned capabilities based on what has been selected on the left.
147+
In this image, you can see that the permission set "Acq Unopen Reopen" has been selected. The three sections under the selection box are:
148+
149+
- **Missing Capabilities**: These are the capabilities that the scripts have identified as needed to recreate the permission set but are currently missing. In this example, since no capability sets or capabilities are selected, all sub-capabilities are displayed.
150+
- **Extra Capabilities**: These are capabilities that were added by selecting either capability sets or capabilities on the left.
151+
- **Assigned Capabilities**: These are the currently assigned capabilities based on what has been selected on the left.
173152

174153
![Overview of the web interface](References/image1.png)
175154

176-
This image depicts what happens after a user has selected a Capability Set on the left. The 3 areas are adjusted to show the most current information.
155+
This image depicts what happens after a user has selected a capability set on the left. The three areas are adjusted to show the most current information.
177156

178157
![Overview of the web interface](References/image2.png)
179158

@@ -182,16 +161,12 @@ This image depicts what happens after a user has selected a Capability Set on th
182161

183162
# Contributing
184163

185-
Pull requests are welcome. For major changes, please open an issue first
186-
to discuss what you would like to change.
187-
188-
Please also fork as needed.
164+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please also fork as needed.
189165

190166
# .env File
191167

192168
## OKAPI Env
193-
194-
These env variables are for your OKAPI reference environment. I suggest using bugfest as you want this data to be as up-to-date as possible.
169+
These environment variables are for your OKAPI reference environment. I suggest using BugFest as you want this data to be as up-to-date as possible.
195170

196171
`OKAPI_URL` =
197172

@@ -202,8 +177,7 @@ These env variables are for your OKAPI reference environment. I suggest using bu
202177
`OKAPI_PASSWORD` =
203178

204179
## Eureka Env
205-
206-
These env variables are for your Eureka reference environment. I suggest using snapshot or bugfest as you want this data to be as up-to-date as possible.
180+
These environment variables are for your Eureka reference environment. I suggest using Snapshot or BugFest as you want this data to be as up-to-date as possible.
207181

208182
`EUREKA_URL` =
209183

@@ -215,7 +189,7 @@ These env variables are for your Eureka reference environment. I suggest using s
215189

216190
## Reference OKAPI Env
217191

218-
These env variables are for your production or test environment. They user accout will need permissions to read Permission data. This connection is used to pull your current Permission Sets.
192+
These environment variables are for your production or test environment. The user account will need permissions to read permission data. This connection is used to pull your current permission sets.
219193

220194
`REF_OKAPI_URL` =
221195

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ rich==13.9.4
3030
rich-toolkit==0.13.2
3131
setuptools==75.8.0
3232
shellingham==1.5.4
33+
simple-term-menu==1.6.6
3334
sniffio==1.3.1
3435
starlette==0.45.3
3536
typer==0.15.1

0 commit comments

Comments
 (0)