Built and running using macOS 12.3.1 and Python 3.10.3.
- Install Mac dependencies.
- Configure Mac dependencies.
- Install Python dependencies.
- Set configurations in app.py.
Please double check all main sites before running code hardcorded here, just in case the maintainers' instructions have changed.
- Required for Homebrew.
xcode-select --install
- A package manager, in this case used for installing Python-related tools.
- Homebrew
- An open-source, relational database system.
- Postgres.app offers an easy installation.
- Used to install and manage different versions of Python.
- pyenv (install using Homebrew)
brew update
brew install pyenv
- Used to manage a virtual environment for this app's Python version and its specific dependencies.
- pyenv-virtualenv (install using Homebrew)
brew update
brew install pyenv-virtualenv
- After completing the Postgres.app install steps, start the PostgreSQL server.
- To create a new database, in your Terminal app, run:
createdb cscrub
See pyenv's COMMANDS.md for additional usage info.
-
View list of available Python versions and install 3.10.3 (or later, but not fully tested).
pyenv install --list pyenv install version # i.e. pyenv install 3.10.3
See pyenv-virtualenv's GitHub for additional usage info.
-
Create a new virtual environment specifying the preferred Python version from your installs.
pyenv virtualenv 3.10.3 name-of-virtualenv # i.e. pyenv virtualenv 3.10.3 cscrub3.10.3
-
In the cscrub directory, add a
.python-version
file. Inside this file, write the name of the virtual environment to auto-activate the virtualenv.# Inside .python-version, for example: cscrub3.10.3
- All dependencies below can be automatically installed using the
requirements.txt
file.
pip install -r requirements.txt
- To see what this command installs, or to install the components separately, please see below.
- Selenium is used to automate browser actions.
- Install the Selenium library for Python.
pip install selenium
- Webdriver Manager updates the webdriver version to remain compatible with the broswer version.
pip install webdriver-manager
- In
models/helpers/wd_connect.py
, please note to set the imports at the top based on the browser you intend to use (more info available from webdriver-manager's site).
- psycopg2-binary is an adapater for PostgreSQL.
pip install psycopg2-binary
- SQLAlchemy is an ORM to map Python objects to PostgreSQL tables.
pip install sqlalchemy
- feedparser helps parse an RSS feed.
pip install feedparser
- A
CONFIGURATIONS
section at the top of app.py allows for customizing the bot's actions.
TRUE
: creates tables in the database.- This should be run as
TRUE
at least once.
TRUE
: fetches and adds City Council members to theAlderpersons
table.
TRUE
: fetches and adds City Council meeetings to theMeetings
table.
TRUE
: fetches and adds legislation from each meeting to theLegislation
table.- This option can be further customized using
set_legislation_links_list
andlinks_list
.
FALSE
, by default: the bot will fetch legislation for every meeting in the database.- To override this behavior, and only fetch legislation from specific meetings, set this option to
TRUE
. - Use
links_list
to set which meetings to fetch legislation from.
- Accepts an
array
ofMeetings
links. - Each meeting in the database has a
link
column. - To set which meeting to fetch legislation from, obtain the meeting's link, and append to the
links_list
variable. - When
set_legislation_links_list
is set toTRUE
, the bot will only fetch legislation for the meetings appended tolinks_list
.