Skip to content

Commit 11c66df

Browse files
authored
Merge pull request #16 from regulatorystudies/deprecate_exe
Deprecate exe
2 parents 3718a5c + d3aa416 commit 11c66df

File tree

6 files changed

+18
-198
lines changed

6 files changed

+18
-198
lines changed

README.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
# regulation-digest
22

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).
44

55
## Installation
66

77
There are two options for running the program:
88

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).
1111

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.
1313

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.
1515

1616
Second, download the code by [cloning](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this Github repository.
1717

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:
1919

2020
```{cmd}
21-
cd "PATH/TO/YOUR/DIRECTORY/WITH/YML"
21+
cd "PATH/TO/YOUR/LOCAL/PROJECT/DIRECTORY/"
2222
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
2429
```
2530

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:
2732

2833
- Run `retrieve_documents.py` as a script from an IDE or the command line:
2934

@@ -53,7 +58,7 @@ The `input/` sub-folder is where you place the input file, if it is being used.
5358
5459
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.
5560
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.
5762
5863
## Usage
5964
@@ -76,19 +81,11 @@ Either supply the end date or press enter to proceed. If an invalid response is
7681
7782
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.
7883
79-
## Compiling the Program
84+
## Deploying the Web App
8085
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/).
8287
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>`.
84-
85-
```{cmd}
86-
cd "PATH/TO/PROJECT/ROOT"
87-
88-
conda activate regdigest
89-
90-
python -m nuitka --standalone --remove-output --include-data-files=./data/agencies_endpoint_metadata.json=data/agencies_endpoint_metadata.json retrieve_documents.py
91-
```
88+
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.
9289
9390
## Contact
9491

create_env_yml.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

create_program_zip.py

Lines changed: 0 additions & 121 deletions
This file was deleted.

environment.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

nuitka_standalone.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements.txt

-70 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)