Publish OpenAhjo (https://github.com/City-of-Helsinki/openahjo) most recent agenda items in Activity Streams 2.0 format.
Requires Python 3.4
At the base level of the repository, create a python virtual environment using the pyvenv
tool:
> pyvenv venv
Activate the environment with (again from the base level of the repo):
> source venv/bin/activate
(You can return to your default Python environment by typing deactivate
at the command line)
Install development dependencies and run tests and linter with:
> ./pre_push.sh
At the repository root execute the following from the command line:
> python -m openahjo_activity_streams.server
The included Procfile
configures Heroku to use gunicorn to serve the site.
To provision the server, you will need make sure the ansible_ssh_host
variable in deployment.inventory is set to your server's IP address.
Then run ansible-playbook deployment_playbook.yml -i deployment.inventory
. This will install docker and a python3 docker image on your server.
First make sure to add the appropriate ssh private key.
Then, add the correct environment variables in the helsinkiAS.env
file that is in the ops/
directory.
Lastly, run the deploy script by first entering the ops/
directory by typing cd ops/
and running ./deploy.sh
with environment variables USER
and IP_ADDRESS
set according to your server's details.
There is not currently an obvious mapping from the data published by the OpenAhjo project, and the Activity Stream 2.0 standard. For term definitions relating to the OpenAhjo project, see this. For those relating to the Activity Streams standard, see this and this.
At a high level, each activity item has the following structure:
{
"@context": "http://www.w3.org/ns/activitystreams",
"published": "2015-08-28T11:06:47.879150",
"type": "Add",
"actor": { }, // json object representing the policy committee making a decision
"object": { }, // json object representing the meeting agenda item during which the decision was made
"target": { } // json object representing the issue about which the decision is being made
}
This represents a decision (the object) being made by a policy committee (the actor) about an issue (the target). The closest standard activity type we could identify in the Activity Stream 2.0 specifications was 'Add'.
At this point, the activity stream is served as an unwrapped json list of activity items, in preference to using the activity stream orderedCollection
types:
[
{...},
{...},
...
]
- Has the
Group
type, as this represents a group of entities capable of acting
- Has the
Content
type, representing an arbitrary piece of content - The
content
attribute of this object is populated from text contained in the first element of thecontent
list in the OpenAhjoAgendaItem
.
- Has the
Content
type, representing an arbitrary piece of content - The
content
attribute is populated from thesummary
field of theissue
record in theAgendaItem
, if thesummary
field exists; otherwise left blank.