You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-21Lines changed: 18 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,34 @@
1
1
# regulation-digest
2
2
3
-
Retrieving and processing Federal Register documents for the GW Regulatory Studies Center [Regulation Digest](https://regulatorystudies.columbian.gwu.edu/newsletters).
3
+
Retrieving and processing Federal Register (FR) documents for the GW Regulatory Studies Center [Regulation Digest](https://regulatorystudies.columbian.gwu.edu/newsletters).
4
4
5
5
## Installation
6
6
7
7
There are two options for running the program:
8
8
9
-
1. Download a Python interpreter, create the environment, and run script (Python required).
10
-
2.Download the compiled program file (created using [Nuitka](https://nuitka.net/)), unzip, and run (Python not required).
9
+
1. Download a Python interpreter, create the virtual environment, and run script (Python required).
10
+
2.Access the [web app](https://regulatorystudies.shinyapps.io/regulation-digest/)and either browse or download the FR documents in .csv format (Python not required).
11
11
12
-
This README document focuses on option 1. Please reach out to <[email protected]> for access to the compiled program.
12
+
This README document focuses on option 1.
13
13
14
-
First, install a Python interpreter to run the code. Some suggested download options are from [Anaconda](https://www.anaconda.com/download) or [Python.org](https://www.python.org/downloads/). The program was developed using Python 3.10, so that is the recommended version.
14
+
First, install a Python interpreter to run the code. Some suggested download options are from [Anaconda](https://www.anaconda.com/download) or [Python.org](https://www.python.org/downloads/). The program was requires Python 3.10 or higher.
15
15
16
16
Second, download the code by [cloning](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this Github repository.
17
17
18
-
Third, create a separate environment for running the program. This is easy to do with conda using the environment.yml contained in this repository. Enter the following commands in Anaconda Powershell Prompt:
18
+
Third, create a separate virtual environment for running the program. This is easy to do with the `venv` module in the [Python standard library](https://docs.python.org/3/library/venv.html) and the `requirements.txt` file in this repository. Enter the following commands in the terminal / command line:
19
19
20
20
```{cmd}
21
-
cd "PATH/TO/YOUR/DIRECTORY/WITH/YML"
21
+
cd "PATH/TO/YOUR/LOCAL/PROJECT/DIRECTORY/"
22
22
23
-
conda env create -f environment.yml
23
+
python -m venv myenv # where myenv is your virtual environment's name
24
+
25
+
myvenv/scripts/activate # activate on Windows
26
+
source myvenv/bin/activate # activate on macOS/linux
27
+
28
+
python -m pip install -r requirements.txt
24
29
```
25
30
26
-
Your environment can be activated from the command line using `conda activate regdigest`, and the program is now ready to run on your computer. Run the program with your choice of IDE or from the command line using one of the following approaches:
31
+
After activating your virtual environment and installing the requirements, the program is now ready to run on your computer. You can run the program with your choice of IDE or from the command line using one of the following approaches:
27
32
28
33
- Run `retrieve_documents.py` as a script from an IDE or the command line:
29
34
@@ -53,7 +58,7 @@ The `input/` sub-folder is where you place the input file, if it is being used.
53
58
54
59
The `output/` sub-folder is where the output data will be located. It creates data files in comma separated values (CSV) format with the naming convention `federal_register_clips_YYYY-MM-DD`, where the date is the current date. If more than one file is created in a day, it will be overwritten. If the output folder does not exist at runtime, it will be automatically created for you.
55
60
56
-
The `regdigest/` sub-folder is the module where the program itself is located. The file, `retrieve_clips_program.py`, contains the code needed to run the program.
61
+
The `regdigest/` sub-folder is the module where the program itself is located. The file, `retrieve_documents.py`, contains the code needed to run the program.
57
62
58
63
## Usage
59
64
@@ -76,19 +81,11 @@ Either supply the end date or press enter to proceed. If an invalid response is
76
81
77
82
Finally, the program will retrieve the documents from the Federal Register, format them, and create an CSV file with today's date in the `output/` sub-folder.
78
83
79
-
## Compiling the Program
84
+
## Deploying the Web App
80
85
81
-
The program is compiled for distribution using the Nuitka python package (see [Use Case 4 - Program Distribution](https://nuitka.net/doc/user-manual.html#use-case-4-program-distribution) in the User Manual). Standalone mode produces a folder for distribution to other systems.
86
+
The program was developed as a [web app](https://regulatorystudies.shinyapps.io/regulation-digest/) for distribution using the [Shiny for Python](https://shiny.posit.co/py/) package. The app is deployed using the [shinyapps.io hosted service](https://regulatorystudies.shinyapps.io/regulation-digest/).
82
87
83
-
The following commands create a `.dist` folder containing the executable `retrieve_clips_program.exe`. The `--include-data-files` flag is used to include the metadata required to identify parent agencies associated with each document. You can specify the source of the data files and the end location of the files in the compiled dist using `--include-data-files=<source>=<target>`.
After installing and configuring the `rsconnect-python` package (see instructions [here](https://docs.posit.co/shinyapps.io/guide/getting_started/#working-with-shiny-for-python)), you can deploy updates to the app using the `deploy.bat` script in the repository.
0 commit comments