Initial Configuration¶
There are a few configuration variables that must be set before the project can be used.
Local Timezone¶
The local timezone must also be set. This can be done with the granicus-archiver --local-timezone
option, but will also be prompted for it.
$ granicus-archiver
Please enter the local timezone name: <your-timezone>
Root Directories¶
The root directories to downloaded files are set with the granicus-archiver --out-dir
and granicus-archiver --legistar-out-dir options. These can be set in the
configuration file, or passed as command line arguments.
$ granicus-archiver --out-dir <path/to/granicus/files> --legistar-out-dir <path/to/legistar/files>
Important
Both of these directories must be relative to the current working directory. It will be assumed that any invocations of the CLI will be done from the same working directory from this point forward.
The working directory will be checked on every invocation and will warn you if things don’t match:
$ granicus-archiver clips download --max-clips 5
Current working directory does not match your config. Continue? [y/N]
Granicus Data URL¶
This is the URL of the view created in the View Publishing URL section of the Granicus Setup.
It can be set with the granicus-archiver --granicus-data-url option.
$ granicus-archiver --granicus-data-url <view-url>
Google Drive¶
Note
This is optional and can be skipped or configured later.
The Google Drive integration requires setup of a Google Drive API project and OAuth2 credentials. This is a one-time setup and can be done at any time.
Account Setup¶
Create a new project in the Google APIs and Services Dashboard.
Enable an API in the Google API Library (e.g. the Google Drive API).
Create credentials in the Google Credentials Wizard.
Pick an API in the Google APIs Explorer and click “Authorize” to get the OAuth2 credentials.
OAuth2 Credentials¶
The credentials created above must be set as environment variables:
OAUTH_CLIENT_ID(e.g.1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com)OAUTH_CLIENT_SECRETOAUTH_CLIENT_EMAIL(the email address of the service account)
Setting these environment variables can be done in the shell or by using a .env file.
AWS S3¶
The S3 integration assumes that the necessary credentials are stored in the appropriate location. See the boto3 documentation for more information.
The S3 bucket name and other settings can be set with the granicus-archiver aws config command:
$ granicus-archiver aws config --bucket-name <bucket-name>