Skip to content

Commit b5cfc6d

Browse files
committed
readthedocs, fix #20
1 parent ed9b705 commit b5cfc6d

100 files changed

Lines changed: 19751 additions & 180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,13 @@
11
# python-geosupport
22

3-
[![Build status](https://ci.appveyor.com/api/projects/status/5uocynec8e3maeeq?svg=true)](https://ci.appveyor.com/project/ishiland/python-geosupport) [![Python 2.7](https://img.shields.io/badge/python-2.7-blue.svg)](https://www.python.org/downloads/release/python-2714/) [![Python 3.4+](https://img.shields.io/badge/python-3.4+-blue.svg)](https://www.python.org/downloads/release/python-360/) [![PyPI version](https://img.shields.io/pypi/v/python-geosupport.svg)](https://pypi.python.org/pypi/python-geosupport/)
3+
[![Build status](https://ci.appveyor.com/api/projects/status/5uocynec8e3maeeq?svg=true&branch=master)](https://ci.appveyor.com/project/ishiland/python-geosupport) [![PyPI version](https://img.shields.io/pypi/v/python-geosupport.svg)](https://pypi.python.org/pypi/python-geosupport/) [![Python 2.7 | 3.4+](https://img.shields.io/badge/python-2.7%20%7C%203.4+-blue.svg)](https://www.python.org/downloads/release/python-360/)
44

5-
Python bindings for NYC Planning's [Geosupport Desktop Edition](https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-gde-home.page).
6-
7-
## Installation
8-
### Prerequisites
9-
10-
Install Geosupport Desktop Edition (tested with version 18b):
11-
12-
* [Geosupport Desktop Edition for Windows (32-bit)](http://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/gde_18b.zip)
13-
* [Geosupport Desktop Edition for Windows (64-bit)](http://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/gde64_18b.zip)
14-
* [Geosupport Desktop Edition for Linux](https://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/gdelx_18b.zip)
15-
16-
#### Windows
17-
**Important**: Ensure you select the correct Geosupport installation that corresponds to the Python interpreter you are using. Ex., Python 32-bit will only work with Geosupport 32-bit.
18-
19-
Additionally, you should check that the following environmental variables are set:
20-
* `GEOFILES` = the `fls` directory of your Geosupport installation. (ex. `C:\Program Files (x86)\Geosupport Desktop Edition\fls\`)
21-
* The Geosupport `bin` directory is in the `PATH`. (ex. `C:\Program Files (x86)\Geosupport Desktop Edition\bin`)
22-
23-
#### Linux
24-
Extract the .zip to a folder of your choice and set the `GEOFILES` and `LD_LIBRARY_PATH` environmental variables of the `fls` and `lib` directories:
25-
26-
```shell
27-
$ export GEOFILES=/var/geosupport/version-17c/fls/
28-
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/geosupport/version-17c/lib/
29-
```
305

31-
### Install python-geosupport
32-
33-
Install via [pip](https://pip.readthedocs.io/en/latest/quickstart.html):
34-
35-
```shell
36-
$ pip install python-geosupport
37-
```
38-
39-
Or clone this repository and:
40-
41-
```shell
42-
$ python setup.py install
43-
```
44-
45-
## Usage
6+
Python bindings for NYC Planning's [Geosupport Desktop Edition](https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-gde-home.page).
467

47-
### Examples
8+
### [Read the docs](https://python-geosupport.readthedocs.io/en/latest/)
489

49-
#### Basic Usage
10+
## Quickstart
5011

5112
```python
5213
# Import the library and create a `Geosupport` object.
@@ -79,143 +40,6 @@ result = g.address(house_number=125, street_name='Worth St', borough_code='Mn')
7940
}
8041
```
8142

82-
#### Calling Geosupport functions
83-
84-
python-geosupport is flexible with how you call functions. You can use either
85-
Geosupport function codes or human readable alternate names, and access them
86-
either through python object attribute notation or dictionary item notation:
87-
88-
```python
89-
# Different ways of calling function 3S which processes street stretches
90-
g.street_stretch(...)
91-
g['street_stretch'](...)
92-
g['3S'](...)
93-
g.call({'function': '3S', ...})
94-
g.call(function='3S', ...)
95-
```
96-
97-
You can pass arguments as a dictionary, keyword arguments.
98-
99-
```python
100-
# Use a dictionary with short names
101-
g.street_stretch({'borough_code': 'MN', 'on': '1 Av', 'from': '1 st', 'to': '2 st'})
102-
# Use keyword arguments with short names
103-
g.street_stretch(
104-
borough_code='MN', street_name_1='1 Av',
105-
street_name_2='1 st', street_name_3='9 st'
106-
)
107-
# Use dictionary with full names
108-
g.street_stretch({
109-
'Borough Code-1': 'MN',
110-
'Street Name-1': '1 Av',
111-
'Street Name-2': '1 st',
112-
'Street Name-3': '9 st'
113-
})
114-
```
115-
116-
#### Mode
117-
118-
A number of Geosupport functions support several modes: Exetended, Long, and
119-
TPAD Long. You can set the flags individually as you would with using Geosupport
120-
directly, but python-geosupport makes it easier with the `mode` argument. `mode`
121-
can be one of `regular` (default), `extended`, `long` and `long+tpad`.
122-
123-
```python
124-
# Call BL (Block and Lot) function in long mode
125-
g.BL(mode='long', ...)
126-
g.BL(mode='long+tpad', ...) # With TPAD
127-
128-
# Call 3 (Street Segment) function in extended mode
129-
g.street_segment(mode='extended', ...)
130-
```
131-
132-
#### Interactive Help
133-
134-
Full function help can be viewed by calling `g.help()`.
135-
136-
```python
137-
# View an overview of all the functions available:
138-
g.help()
139-
140-
# View help for an individual function including a description, inputs, outputs,
141-
# and valid modes.
142-
g.address.help()
143-
g.help('address')
144-
145-
# View a list of all possible inputs to Geosupport
146-
g.help('input')
147-
```
148-
149-
#### Error Handling
150-
151-
python-geosupport will raise a `GeosupportError` when Geosupport returns an
152-
error code. Sometimes there is more information returned, in which case the
153-
exception will have a `result` dictionary.
154-
155-
```python
156-
from geosupport import GeosupportError
157-
158-
try:
159-
g.get_street_code(borough='MN', street='Wort Street')
160-
except GeosupportError as e:
161-
print(e) # 'WORT STREET' NOT RECOGNIZED. THERE ARE 010 SIMILAR NAMES.
162-
print(e.result['List of Street Names']) # List of suggested alternate names
163-
```
164-
165-
#### Switching Between Multiple Versions of Geosupport
166-
167-
:heavy_exclamation_mark: *This feature is Windows only. Linux doesn't support
168-
library path modifications during runtime.*
169-
170-
If you have multiple versions of geosupport and want to switch between them,
171-
you can either pass the installation path to `Geosupport`:
172-
173-
```python
174-
g = Geosupport(geosupport_path="C:\\Program Files\\Geosupport 18C")
175-
```
176-
177-
or create a `.python-geosupport.cfg` in your home directory that specifies
178-
the names and installation paths of the different versions.
179-
180-
The `.python-geosupport.cfg` file looks like:
181-
182-
```txt
183-
[versions]
184-
18b=C:\Program Files\Geosupport Desktop Edition
185-
18c=C:\Program Files\Geosupport 18C
186-
18c_32=C:\Program Files (x86)\Geosupport 18C
187-
```
188-
189-
Then you can select the version by name:
190-
191-
```python
192-
g = Geosupport(geosupport_version="18c")
193-
```
194-
195-
## Development
196-
197-
### Running tests
198-
```shell
199-
$ python setup.py test
200-
```
201-
202-
Installing the dev dependencies (`nosetests` and `invoke`) will give you more
203-
control over running tests. Install in develop mode with dev dependencies with:
204-
205-
```shell
206-
$ pip install -e .[dev]
207-
```
208-
209-
And then run tests with:
210-
211-
```shell
212-
$ invoke test unit
213-
$ invoke test functional
214-
$ invoke test all
215-
```
216-
217-
218-
21943
## License
22044

22145
This project is licensed under the MIT License - see the [license.txt](license.txt) file for details

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7.36 KB
Binary file not shown.
4.28 KB
Binary file not shown.
20.3 KB
Binary file not shown.
4.11 KB
Binary file not shown.

docs/_build/doctrees/help.doctree

3.7 KB
Binary file not shown.

docs/_build/doctrees/index.doctree

7 KB
Binary file not shown.
16.9 KB
Binary file not shown.
9.04 KB
Binary file not shown.

0 commit comments

Comments
 (0)