caps
A simple, open database of local government climate action plan documents and emissions data.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A simple, open database of local government climate action plan documents and emissions data.
Basic Info
- Host: GitHub
- Owner: mysociety
- License: other
- Language: HTML
- Default Branch: master
- Homepage: https://cape.mysociety.org
- Size: 115 MB
Statistics
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 77
- Releases: 0
Topics
Metadata Files
README.md
caps - Climate Action Plans
Development Install
Clone the repository
git clone git@github.com:mysociety/caps.git
cd caps
script/bootstrap
You then have two options for a local development environment, Vagrant and Docker. These instructions don't cover installing and setting up these tools.
This application makes calls to MapIt. If you plan on making more than 50 calls a day, you'll need an API key.
Loading Data
The first time you stand-up a local development environment, you'll need to pull down the Council, plans and emissions data and import this into the database and search index. The instructions below provide details on how to do this for each environment.
This process can take some time, and a slightly faster update process is also available.
Docker
This project contains a Docker Compose file that uses the Django development server, enables debug mode and maps the local working copy into the container for testing.
If you are using a MapIt API key, add this to your .env file, e.g.: echo 'MAPIT_API_KEY=xxxaaa111222333zzz' >> .env.
Using the setup script
Warning running script/setup will remove all locally cached data and reset the environment to the default state!
Having rest the environment, script/setup will perform all the necessary setup steps, including loading all data. Once this has completed, you should have a functional environment.
This may take a long time to run!
Manual setup
Run docker-compose up. This will build an application container and stand-up this, together with PostgreSQL and Solr containers. These will run in the foreground, so you will see console output in the shell from the containers. You can stop the containers by hitting control-C. If you'd rather run in the background, add the -d switch; if you do this you can stop the environment with docker-compose down.
You can then run docker-compose exec app script/update --all to perform the initial data load. This will take a long time. Run the same command without the --all switch to run the short-cut data load.
You can rebuild the application container by running script/build. Bear in mind that when running the container in development mode, your local working copy will be included along with any local uncommitted changes.
The environment will be visible at http://localhost:8000 and the Solr admin interface at http://localhost:8983
Codespaces/VSCode
In your Github Codespaces settings, set up the relevant secrets (mostly MAPITAPIKEY) and give the caps repo access to this secret.
Then in the caps repo, click the code dropdown (top right), and select the codespaces tab, then create new codespace.
Once it has cloned and set up the docker configuration (it may prompt you to reload with the pylance extension, this is fine and takea a few seconds), you should have a set-up populated a recent version of the current data process.
If you have used one of the devcontainer options that doesn't use this repopulation:
- To run the data population from scratch run
script/setup-in-docker(as warned above, this takes a while). - To restore a previous database dump, run
script/restore-dev-data.
Once this is finished script/server will run the test server. You can access this by right clicking the 0.0.0.0:8000 link in the terminal, or follow the links in the ports page (where it can also be made public/shared to organisation).
Vagrant
Copy across some basic config. You may need to add a MapIt API key.
cp conf/config.py-example conf/config.py
A functional Vagrantfile is included for local development so you can create a Vagrant VM with:
vagrant up
Then SSH into the VM, and run subsequent commands from inside.
vagrant ssh
Importing data
Before running the development server for the first time, you'll need to import the data and set up the search index:
script/update --all
This process will take some time. Once you have done a full import, you can subsequently run script/update to take a few shortcuts in future.
Starting the development server
Then you can start the development server:
script/server
The site will be visible at http://localhost:8000.
The Solr server interface will be visible at http://localhost:8983
Updating the solr schema
If you want to update the solr schema then you'll need to edit the conf/schema.xml file and then run the script/updatesolrschema on the solr instance:
docker compose exec solr update_solr_schema
This will copy the new schema in to place and reload the core. You will then need to re-index for the changes to be useful. This will only work if you are adding to the schema, if you're altering an existing property then you should probably use the solr API to do so.
Code style
black is run for code tidying: python -m black .
This is monitored by a github action for pull requests.
Owner
- Name: mySociety
- Login: mysociety
- Kind: organization
- Location: UK
- Website: https://www.mysociety.org/
- Repositories: 353
- Profile: https://github.com/mysociety
We help people be active citizens
GitHub Events
Total
- Issues event: 59
- Watch event: 1
- Delete event: 8
- Issue comment event: 63
- Push event: 357
- Pull request review comment event: 12
- Pull request review event: 23
- Pull request event: 52
- Create event: 30
Last Year
- Issues event: 59
- Watch event: 1
- Delete event: 8
- Issue comment event: 63
- Push event: 357
- Pull request review comment event: 12
- Pull request review event: 23
- Pull request event: 52
- Create event: 30
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Struan Donald | s****n@e****k | 625 |
| Lucas | h****o@l****v | 377 |
| Zarino Zappia | m****l@z****k | 290 |
| Alex Parsons | a****s@m****g | 124 |
| Louise Crow | l****w@g****m | 109 |
| Sam Pearson | s****m@s****k | 49 |
| dependabot[bot] | 4****] | 46 |
| M Somerville | m****b@d****k | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 342
- Total pull requests: 446
- Average time to close issues: 3 months
- Average time to close pull requests: 15 days
- Total issue authors: 17
- Total pull request authors: 8
- Average comments per issue: 1.41
- Average comments per pull request: 1.06
- Merged pull requests: 361
- Bot issues: 0
- Bot pull requests: 70
Past Year
- Issues: 45
- Pull requests: 63
- Average time to close issues: 3 months
- Average time to close pull requests: 28 days
- Issue authors: 5
- Pull request authors: 4
- Average comments per issue: 0.67
- Average comments per pull request: 0.84
- Merged pull requests: 36
- Bot issues: 0
- Bot pull requests: 16
Top Authors
Issue Authors
- zarino (132)
- struan (75)
- crowbot (46)
- ajparsons (37)
- lucascumsille (23)
- JenMysoc (6)
- MyfanwyNixon (4)
- sequencefree (3)
- pmackay (2)
- RichardTaylor (1)
- sagepe (1)
- davea (1)
- alexander-griffen (1)
- mrchrisadams (1)
- emilyk383 (1)
Pull Request Authors
- struan (132)
- lucascumsille (99)
- dependabot[bot] (90)
- zarino (85)
- ajparsons (46)
- crowbot (21)
- sagepe (11)
- dracos (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- black ==21.12b0 development
- pylint ==2.12.2 development
- Django ==3.2.14
- Markdown ==2.6.8
- MarkupPy ==1.14
- Pillow ==9.0.1
- PyYAML ==5.4
- altair ==4.2.0
- asgiref ==3.3.2
- beautifulsoup4 ==4.9.3
- certifi ==2020.6.20
- chardet ==3.0.4
- cryptography ==36.0.1
- csscompressor ==0.9.4
- defusedxml ==0.6.0
- diff-match-patch ==20200713
- django-autoslug ==1.9.7
- django-bootstrap4 ==1.1.1
- django-debug-toolbar ==3.2.2
- django-filter ==2.4.0
- django-haystack ==3.0
- django-htmlmin ==0.11.0
- django-import-export ==2.0.2
- django-markitup ==4.0.0
- django-simple-history ==3.0.0
- django_hosts 55634e5dd5cce33619dcb641c5e3c6a9c85e7caa
- djangorestframework ==3.12.4
- et-xmlfile ==1.0.1
- feedparser ==5.2.1
- future-fstrings ==1.2.0
- gunicorn ==20.0.4
- html5lib ==1.1
- idna ==2.10
- jdcal ==1.4.1
- libsass ==0.12.3
- mailchimp_marketing a734b605fe457f429144ec81c7ba721f47ad4e57
- numpy ==1.22.0
- odfpy ==1.4.1
- olefile ==0.44
- openpyxl ==3.0.9
- pandas ==1.3.4
- pdftotext ==2.1.5
- psycopg2 ==2.8.5
- pysolr ==3.9.0
- python-dateutil ==2.8.1
- python-slugify ==4.0.1
- pytz ==2020.1
- requests ==2.25.1
- requests-cache ==0.5.2
- six ==1.10.0
- soupsieve ==2.0.1
- sqlparse ==0.4.2
- tablib ==2.0.0
- text-unidecode ==1.3
- tokenize-rt ==3.2.0
- urllib3 ==1.26.5
- webencodings ==0.5.1
- xlrd ==1.2.0
- xlwt ==1.3.0
- docker/login-action f054a8b539a109f9f41c372932f1ae047eff08c9 composite
- docker/metadata-action 98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 composite
- ./.github/actions/cached-build * composite
- ./.github/actions/cached-build * composite
- actions/checkout v2 composite
- actions/checkout v2 composite
- psf/black stable composite
- actions/checkout v3 composite
- mysociety/action-git-pusher v1.1.1 composite
- ./.github/actions/in-container * composite
- actions/checkout v2 composite
- ./.github/actions/in-container * composite
- actions/checkout v2 composite
- python 3.9.7 build
- python 3.9.7-slim build
- mysociety/caps ${TAG
- postgres 11
- solr 6.5