Skip to content

Instantly share code, notes, and snippets.

Paul Downey psd

Block or report user

Report or block psd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@psd
psd / wfs.py
Created Jun 4, 2018
Grab GML from a WFS server
View wfs.py
#!/usr/bin/env python3
"""
https://geopython.github.io/OWSLib/
"""
from owslib.wfs import WebFeatureService
url='http://inspire.misoportal.com/geoserver/mid_sussex_district_council_msdc_3830_tpo_point/wfs?service=wfs&version=2.0.0&request=GetCapabilities'
url='http://environment.data.gov.uk/ds/wfs?INTERFACE=ENVIRONMENTWFS--7a955570-d465-11e4-a37c-f0def148f590'
@psd
psd / wms.py
Created Apr 12, 2018
Get Land Registry Inspire polygons as an image from their WMS service
View wms.py
#!/usr/bin/env python3
from owslib.wms import WebMapService
wms = WebMapService('http://inspire.landregistry.gov.uk/inspire/ows?Service=WMS&Request=Getcapabilities', version='1.1.1')
print(wms.identification.type)
layers = list(wms.contents)
layer=layers[0]
View split.sh
#!/bin/bash
awk -F' ' \
-v artist="Underworld" \
-v album="Everything Everything" \
'BEGIN {
total=0;
n=0;
}
{
View portfolio-form.json
{
"type": "object",
"required": [
"name",
"shoesizeLeft"
],
"properties": {
"name": {
"title": "Name",
"description": "Gimme yea name lad",
View portfolio-form.json
{
"type": "object",
"required": [
"name",
"shoesizeLeft"
],
"properties": {
"name": {
"title": "Name",
"description": "Gimme yea name lad",
@psd
psd / README.md
Last active Nov 11, 2017
Form explorer data for the MoJ
View README.md
View gist:1d4cc608f543901795f7f4436ef6182a
import io
import csv
import requests
class Records:
"Minimal register client"
records = {}
url = 'https://%s.register.gov.uk/records.tsv?page-size=5000'
View count-attachments.sh
#!/bin/bash
# 10 /government/uploads/system/uploads/attachment_data/file/98864/thumbnail_emr-2010-11.pdf.png GET 200 origin,2
find daily -type d -name '20??????' |
while read dir
do
date=$(echo "$dir" | sed -e 's/^.*\(20[0-9]*\).*$/\1/')
zcat $dir/count_cdn-govuk.log-20*.csv.gz |
sed -e 's/^[0-9][0-9] //' \
@psd
psd / show-and-tell.html
Created Feb 2, 2017
Links for a show and tell
View show-and-tell.html
http://www.openregister.org/
https://gds.blog.gov.uk/2015/09/01/registers-authoritative-lists-you-can-trust/
https://twitter.com/search?q=from%3Apsd%20%22list%20of%20the%20day%22&src=typd
https://www.gov.uk/government/publications/list-of-gov-uk-domain-names
https://www.gov.uk/government/publications/current-registered-providers-of-social-housing
https://data.gov.uk/dataset/list-of-internal-drainage-boards
https://www.gov.uk/government/publications/list-of-authorised-isa-managers/isas-authorised-managers
http://openregister.github.io/country-data/lists/report.html
https://reports.ofsted.gov.uk/
https://github.com/psd/doctate
@psd
psd / read-tsv.py
Created Aug 2, 2016
Read a TSV file looking for names with double-quotes
View read-tsv.py
#!/usr/bin/env python3
import sys
import csv
for row in csv.DictReader(sys.stdin, delimiter='\t'):
if '"' in row['name']:
print(row['name'])
You can’t perform that action at this time.