Skip to content

Commit 59fb6d4

Browse files
committed
Initial commit
0 parents  commit 59fb6d4

File tree

10 files changed

+282
-0
lines changed

10 files changed

+282
-0
lines changed

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Getme Limited (http://getme.co.uk)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Include the license file
2+
include LICENSE
3+
include README.md

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# GeoUK Python Library
2+
3+
The GeoUK Python library provides a pythonic interface to the GeoUK API. It includes an API client class, and a set of resource classes.
4+
5+
6+
## Installation
7+
8+
```
9+
pip install geouk
10+
```
11+
12+
## Requirements
13+
14+
- Python 3.7+
15+
16+
17+
# Usage
18+
19+
```Python
20+
21+
import geouk
22+
23+
24+
client = geouk.Client('your_api_key...')
25+
26+
# Get a list of place names and postcodes starting with the query string's
27+
# first 2 characters (ideal for use with a typeahead).
28+
suggestions = geouk.resources.Place.typeahead(client, 'wo...')
29+
30+
# Fetch a list of `Place`s that match the given query string
31+
places = geouk.resources.Place.search(client, 'worcester')
32+
33+
print(places.humanized_name, places[0].geo_coords)
34+
35+
>> Worcester [52.18935, -2.22001]
36+
37+
# Fetch all the (data) sources
38+
sources = geouk.resources.Source.all(client)
39+
40+
# Fetch a single (data) source
41+
source = geouk.resources.Source.one(client, 'geonames')
42+
43+
```

geouk/__init__.py

Whitespace-only changes.

geouk/client.py

Whitespace-only changes.

geouk/exceptions.py

Whitespace-only changes.

geouk/resources.py

Whitespace-only changes.

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
"""
2+
Setup instuctions for h51.
3+
"""
4+
5+
# Always prefer setuptools over distutils
6+
from setuptools import setup, find_packages
7+
8+
# To use a consistent encoding
9+
from codecs import open
10+
from os import path
11+
12+
here = path.abspath(path.dirname(__file__))
13+
14+
# Get the long description from the README file
15+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
16+
long_description = f.read()
17+
18+
setup(
19+
name='GeoUK',
20+
21+
# Versions should comply with PEP440. For a discussion on single-sourcing
22+
# the version across setup.py and the project code, see
23+
# https://packaging.python.org/en/latest/single_source_version.html
24+
version='0.0.1',
25+
description=(
26+
'The GeoUK Python library provides a pythonic interface to the GeoUK '
27+
'API.',
28+
),
29+
long_description=long_description,
30+
long_description_content_type='text/markdown',
31+
32+
# The project's main homepage.
33+
url='https://github.com/GetmeUK/geouk-python',
34+
35+
# Author details
36+
author='Anthony Blackshaw',
37+
author_email='ant@getme.co.uk',
38+
39+
# Maintainer
40+
maintainer='Anthony Blackshaw',
41+
maintainer_email='ant@getme.co.uk',
42+
43+
# Choose your license
44+
license='MIT',
45+
46+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
47+
classifiers=[
48+
# How mature is this project? Common values are
49+
# 3 - Alpha
50+
# 4 - Beta
51+
# 5 - Production/Stable
52+
'Development Status :: 4 - Beta',
53+
54+
# Indicate who your project is intended for
55+
'Intended Audience :: Developers',
56+
'Topic :: Database',
57+
58+
# Pick your license as you wish (should match "license" above)
59+
'License :: OSI Approved :: MIT License',
60+
61+
# Operating systems
62+
"Operating System :: MacOS :: MacOS X",
63+
"Operating System :: Microsoft :: Windows",
64+
"Operating System :: POSIX",
65+
66+
# Specify the Python versions you support here. In particular, ensure
67+
# that you indicate whether you support Python 2, Python 3 or both.
68+
'Programming Language :: Python :: 3.7'
69+
],
70+
71+
# What does your project relate to?
72+
keywords='api geouk',
73+
74+
# You can just specify the packages manually here if your project is
75+
# simple. Or you can use find_packages().
76+
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
77+
78+
# Alternatively, if you want to distribute just a my_module.py, uncomment
79+
# this:
80+
# py_modules=["my_module"],
81+
82+
# List run-time dependencies here. These will be installed by pip when
83+
# your project is installed. For an analysis of "install_requires" vs pip's
84+
# requirements files see:
85+
# https://packaging.python.org/en/latest/requirements.html
86+
install_requires=['requests>=2.22.0'],
87+
88+
# List additional groups of dependencies here (e.g. development
89+
# dependencies). You can install these using the following syntax,
90+
# for example:
91+
# $ pip install -e .[dev,test]
92+
extras_require={},
93+
94+
# If there are data files included in your packages that need to be
95+
# installed, specify them here. If using Python 2.6 or less, then these
96+
# have to be included in MANIFEST.in as well.
97+
package_data={},
98+
99+
# Although 'package_data' is the preferred approach, in some case you may
100+
# need to place data files outside of your packages. See:
101+
# http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
102+
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
103+
data_files=[],
104+
105+
# To provide executable scripts, use entry points in preference to the
106+
# "scripts" keyword. Entry points provide cross-platform support and allow
107+
# pip to create the appropriate form of executable for the target platform.
108+
entry_points={}
109+
)

0 commit comments

Comments
 (0)