Querying neuromorpho.org database with Python requests
Project description
neuromorpho-api
Querying the neuromorpho.org database in Python with requests.
Installation
pip install neuromorpho-api
Quickstart
>>> from neuromorpho_api import requestor as requests
>>> neuron_endpoint = "https://neuromorpho.org/api/neuron/"
>>> resp = requests.get(neuron_endpoint + "fields")
>>> resp.json()
{'Neuron Fields': ['neuron_id',
'neuron_name',
'archive',
'age_scale',
'gender',
...
What is this package?
The neuromorpho-api
package provides a requests.Session
instance with a
custom SSLContext
needed for interacting with
neuromorpho.org.
Why can't I just use requests
directly?
You may see something like the following:
>>> import requests
>>> requests.get("https://neuromorpho.org/api/neuron/id/1")
Traceback (most recent call last)
...
SSLError: HTTPSConnectionPool(host='neuromorpho.org', port=443): Max retries exceeded with url: /api/neuron/id/1 (Caused by SSLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1006)')))
It appears the key provided by neuromorpho.org
is incompatible with the
default Python SSL cipher.
This package works around this issue using Robin De Schepper's solution
posted on Stack Overflow.
At some point in the future, the neuromorpho certificate may (hopefully) be
updated, at which point this package will be archived.
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
Built Distribution
File details
Details for the file neuromorpho_api-0.1.1.tar.gz
.
File metadata
- Download URL: neuromorpho_api-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f90a6ab7066dca7b91845df14d19519c2a54ece7585fd83406c9daa4c77aaacb |
|
MD5 | 8deb25668e8069b625a65843518e7ece |
|
BLAKE2b-256 | bd5f1539871d0f020822fcba0f6237f3a62e0328ea3ea14f2c0dcf15b75f5e7e |
File details
Details for the file neuromorpho_api-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: neuromorpho_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce4602bd2b7ca4025ebd581d4520456c963b4c614daf50221baed2419e998bef |
|
MD5 | 7b0ce9dd1500f9180e8819e56e472c0e |
|
BLAKE2b-256 | 095f72f522bcf89f0c3d233efda08ac0948e378bdd45b993b0ef02c5bef230ca |