Python wrapper around the Nagareyama Open Data Web API
Project description
Sample
>>> from pyny import api
>>> data = api.get_by_id('c1161', 2)
>>>
>>> import pprint
>>> p = pprint.PrettyPrinter()
>>> p.pprint(data)
{'attrs': {'attr0': '市役所・出張所',
'attr1': '出張所',
'attr2': 'おおたかの森出張所',
'attr3': '流山市西初石6-185-2(流山おおたかの森S・C内3階)',
'attr6': '35.8706965',
'attr7': '139.9261438',
'attr8': '04-7154-0333 '},
'created': '2013/07/19 17:01:02',
'distance': 0,
'feature_id': 2,
'files': {},
'geometry': 'POINT(139.9261438 35.8706965)',
'layer_id': 'c1161',
'mid': 0,
'moduserid': 0,
'status': 0,
'user_id': 307}
>>>
>>> from pyny.models import Model
>>> from pyny.fields import DecimalField, StringField
>>>
>>> class SampleModel(Model):
... layer_id = StringField()
... longitude = DecimalField('attrs.attr7')
...
>>> data = SampleModel.get_by_id('c1161', 2)
>>> data.layer_id
'c1161'
>>> data.longitude
Decimal('139.9261438')
>>>
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyny-1.1.0.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pyny-1.1.0-py3-none-any.whl
(8.6 kB
view details)
File details
Details for the file pyny-1.1.0.tar.gz.
File metadata
- Download URL: pyny-1.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03b624131cfa6c27482bd2dafaa917495ddd205f9d2a3023601a87b85483660d
|
|
| MD5 |
db8bba7f8fc6980310dd6e1fdbade83c
|
|
| BLAKE2b-256 |
6296831db13a0a08f92381f2fa237f765c0b94188876d52f2be65b5e4a980340
|
File details
Details for the file pyny-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pyny-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d0a85419371385d2fabd3820ad081d2c8e960b4085a55a4839609ae0b11f9bd
|
|
| MD5 |
beea6e4088a8133b1dcf0539abbe52b0
|
|
| BLAKE2b-256 |
adf3c5b3b8f04a574ed80fb1bad70b26c0e1e16dac016bd6ae1a8e1aca240503
|