Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Adapter for created for biologists, bioinformatics etc.

Project description

Adapter for easy access to NDB resources directly from python (3.*).


Adapter offers 4 types of search: summary, advanced, dna and rna.


To get summary of structure, type:

>>> from ndb_adapter import NDB
>>> res = NDB.summary('4Z4B')
>>> res.ndb_id
>>> res.title
>>> res.description
>>> res.get_dict()
{'Molecular Description': "DNA (5'-D(*CP*GP*CP*AP*AP*AP*TP*TP*TP*GP*CP*G)-3')", ...}

As you see some properties are available for summary result. Full list of them is here.

Structure Download

Almost on every result of search you can download related files (.pdb, .cif, .xml etc.) to buffer or save.

>>> from ndb_adapter import NDB
>>> res = NDB.summary('4Z4B')
>>>  # .pdb is default
"HEADER DNA 01-APR-15 4Z4B ..."

>>> from ndb_adapter import DownloadType
'data_4Z4B\n# \   4Z4B ...'

>>> res = NDB.advanced_search()
>>> # saves n files in current directory
>>>, target_dir='/home/user/Downloads/')  # saves n files in ~/Downloads/

>>>[0].download(save=True) # saves first structure file in current directory

You can also search and download in one line:

>>> from ndb_adapter import NDB
>>> res ='4Z4B')   # like above .pdb is default
"HEADER DNA 01-APR-15 4Z4B ..."
# save and target dir is also available



To install, simply:

$ pip install ndb_adapter


Documentation is available at


Software is distributed under the MIT Licence.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ndb_adapter, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size (61.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page