{"id":23440796,"url":"https://github.com/dabapps/postcodeserver","last_synced_at":"2025-04-13T09:12:57.281Z","repository":{"id":43047552,"uuid":"8581244","full_name":"dabapps/postcodeserver","owner":"dabapps","description":"A tiny JSON server for UK postcode lookups","archived":false,"fork":false,"pushed_at":"2023-05-01T21:36:49.000Z","size":131284,"stargazers_count":22,"open_issues_count":2,"forks_count":4,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-13T09:12:51.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dabapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-05T14:19:44.000Z","updated_at":"2025-03-16T11:22:58.000Z","dependencies_parsed_at":"2022-09-06T10:21:30.410Z","dependency_job_id":null,"html_url":"https://github.com/dabapps/postcodeserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Fpostcodeserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Fpostcodeserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Fpostcodeserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabapps%2Fpostcodeserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dabapps","download_url":"https://codeload.github.com/dabapps/postcodeserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688565,"owners_count":21145766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T16:18:42.328Z","updated_at":"2025-04-13T09:12:57.243Z","avatar_url":"https://github.com/dabapps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"postcodes\n=========\n\nA tiny JSON server for getting the latitude and longitude of a UK postcode.\n\nYou can see it running at [postcodes.herokuapp.com/?postcode=bn11ag](http://postcodes.herokuapp.com/?postcode=bn11ag).\n\nCreated by [Jamie Matthews](http://dabapps.com/community/people/jamie-matthews/). Follow me on Twitter: [@j4mie](https://twitter.com/j4mie)\n\nrunning locally\n---------------\n\n    git clone git@github.com:j4mie/postcodeserver.git\n    cd postcodeserver\n    python3 -m venv env\n    env/bin/pip install -r requirements.txt\n    env/bin/python server.py\n\nusing from another program\n--------------------------\n\n```pycon\n\u003e\u003e\u003e import requests\n\u003e\u003e\u003e requests.get('http://postcodes.herokuapp.com', params={'postcode': 'BN1 1AG'}).json()\n{u'lat': 50.82292196340859, u'lng': -0.14287104830145836, u'geohash': u'gcpchspbyz7d', u'postcode': u'BN11AG'}\n```\n\ndata source\n-----------\n\nLoaded with data from [here](http://www.doogal.co.uk/UKPostcodes.php). The original source is the [Ordnance Survey Code-Point Open](http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/).\n\nrebuilding the trie\n-------------------\n\nThe repository includes the postcode database encoded using [marisa-trie](https://github.com/kmike/marisa-trie) (the resulting file is approx. 19 MB). To rebuild this, you'll need a CSV file with at least three columns: postcode, latitude, longitude. The file linked above (under Data Source) matches this format:\n\n    $ head -5 postcodes.csv \n    Postcode,Latitude,Longitude,Easting,Northing,GridRef,County,District,Ward,DistrictCode,WardCode,Country,CountyCode\n    AB10 1AA,57.148235,-2.096648,394251,806376,NJ942063,\"\",\"Aberdeen City\",\"George St/Harbour Ward\", S12000033,S13002483,Scotland,\n    AB10 1AB,57.149079,-2.096964,394232,806470,NJ942064,\"\",\"Aberdeen City\",\"George St/Harbour Ward\", S12000033,S13002483,Scotland,\n    AB10 1AF,57.14871,-2.097806,394181,806429,NJ941064,\"\",\"Aberdeen City\",\"George St/Harbour Ward\", S12000033,S13002483,Scotland,\n    AB10 1AG,57.148235,-2.096648,394251,806376,NJ942063,\"\",\"Aberdeen City\",\"George St/Harbour Ward\", S12000033,S13002483,Scotland,\n\nTo import this file, run `env/bin/python rebuild.py path/to/postcodes.csv`\n\ndisclaimer\n----------\n\nIt goes without saying that this software (and the service running on Heroku) comes with no warranties or guarantees to its accuracy, availability or stability. Use at your own risk.\n\ncode license\n------------\n\n[unlicense.org](http://unlicense.org/)\n\n## Code of conduct\n\nFor guidelines regarding the code of conduct when contributing to this repository please review [https://www.dabapps.com/open-source/code-of-conduct/](https://www.dabapps.com/open-source/code-of-conduct/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabapps%2Fpostcodeserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabapps%2Fpostcodeserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabapps%2Fpostcodeserver/lists"}