Registry / data / pydap
library3.5.9pypypi✓ verified 87d ago

PyDAP is a pure Python implementation of the Data Access Protocol (DAP, also known as OPeNDAP), enabling access to scientific data over the internet. It acts as both a client for accessing remote OPeNDAP servers and a server for making local data available via OPeNDAP. A key feature is lazy data evaluation, where data is downloaded on-the-fly as needed, conserving bandwidth and time. The library is actively developed and maintained by the OPeNDAP community.

pip install pydap
INSTALL
IMPORT
SIG · PYDAP
P
pydap
datapythonv3.5.9
Install
10.0s avg
Import
1158ms
Disk
230MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.5.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/8 runs
✓ 10.91s
py 3.11
4/8 runs
✓ 10.61s
py 3.12
4/8 runs
✓ 10.66s
py 3.13
4/8 runs
✓ 10.56s
py 3.9
✓ —
✓ 7.08s
230MB installed
● package 230MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

open_url
from pydap.client import open_url
The primary function for accessing remote OPeNDAP datasets as a client.
DAPHandler
from pydap.handlers.dap import DAPHandler
Used for low-level interaction with DAP responses, typically for server implementations or advanced client use.
app
from pydap.wsgi import app
The WSGI application for running pydap as a server. Installed when using `pydap[server]`.

This quickstart demonstrates how to use PyDAP as a client to open a remote OPeNDAP dataset, inspect its variables, and retrieve a subset of data using lazy evaluation. Data is only downloaded when explicitly accessed or sliced.

from pydap.client import open_url # Example OPeNDAP URL for a publicly available dataset dataset_url = 'http://test.opendap.org/dap/data/nc/coads_climatology.nc' try: # Open the remote dataset dataset = open_url(dataset_url) print(f"Dataset keys: {list(dataset.keys())}") # Access a variable lazily (no data downloaded yet) sst_variable = dataset['SST'] print(f"SST variable shape: {sst_variable.shape}") print(f"SST variable data type: {sst_variable.dtype}") # Retrieve a small subset of data (data downloaded on-the-fly) # Example: first time step, subset of latitude/longitude data_subset = sst_variable[0, 10:14, 10:14] print("\nSubset of SST data (downloaded):") print(data_subset.data) except Exception as e: print(f"An error occurred: {e}")
pydap --version
Debug
Known issues
gotchaWhen accessing certain OPeNDAP servers, requesting even a small data subset can result in a 'Request too big' error. This often indicates a server-side parsing issue where the request is misinterpreted as a full array download, or a quirk in pydap's request building logic for specific grid maps.
fix
If encountered, try reducing the requested subset further. If the issue persists with small requests, it might be a server-specific limitation or a fundamental difference in how pydap constructs requests compared to other clients. Consider reporting to the pydap issue tracker.
affects: All versions
gotchaSome URLs, particularly those with complex query parameters or non-ASCII characters, may lead to a `UnicodeDecodeError` when used with `pydap.client.open_url`. This indicates an encoding problem during URL parsing or data retrieval.
fix
Ensure that any problematic parts of the URL are properly URL-encoded (e.g., using `urllib.parse.quote`) before passing them to `open_url`. Also, verify the encoding of your environment if possible.
affects: All versions
deprecatedOlder documentation, especially on third-party sites or unmaintained GitHub Pages, may contain outdated examples or instructions. Pydap has undergone updates, including dropping Python 2.7 support (and thus the `six` dependency).
fix
Always refer to the official PyDAP documentation linked from its main GitHub repository or PyPI page for the most up-to-date and accurate information. Update to Python 3.10+ for full compatibility.
affects: <3.3.0
Errors
Common errors & fixes
AttributeError: '<class 'pydap.model.DatasetType'>' object has no attribute 'iteritems'
This error typically occurred with older versions of the `xarray` library when attempting to use `pydap` as an engine, due to `pydap.model.DatasetType` changing its internal iteration methods (e.g., from `iteritems` to `items`) in later PyDAP versions.
fix
Upgrade your `xarray` library to a version compatible with `pydap` 3.x. Ensure both libraries are kept up-to-date to maintain compatibility. This issue is largely resolved in recent `xarray` releases.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x__ in position __: invalid continuation byte
Attempting to open a URL containing characters that are not correctly encoded for the system's default locale or the URL's intended encoding, leading to a decoding failure.
fix
Explicitly encode problematic URL components using `urllib.parse.quote` or verify the encoding of the URL source. Ensure your Python environment is configured for UTF-8 where possible, e.g., via `locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')` if applicable.
Request too big=XXXX.X Mbytes, max=YY.Y Mbytes (403 Forbidden)
The OPeNDAP server misinterpreted a subset request as a request for the entire dataset, exceeding its configured maximum download size. This can be due to how pydap constructs the OPeNDAP URL constraint expression for certain data types or server implementations.
fix
Double-check that the subsetting (slicing) in your `pydap` code is correct. If the issue persists even with very small subsets, the problem lies with the specific OPeNDAP server or `pydap`'s interaction with it. Consider fetching data in even smaller chunks, if possible, or consulting the server's documentation.
Upgrade
Version history
3.5.9latest on PyPI · released Mar 9, 2026
Audit
Dependencies
numpyrequiredFundamental for array handling in scientific datasets; often used with pydap's output.
netCDF4optionalRequired for the 'pydap[handlers.netcdf]' extra to serve NetCDF files, and often used in client applications.
h5pyoptionalRequired for the 'pydap[handlers.hdf5]' extra to serve HDF5 files.
SQLAlchemyoptionalRequired for the 'pydap[handlers.sql]' extra to serve data from relational databases.
xarrayoptionalPydap is a recognized backend for xarray, enabling more powerful data analysis and integration.
Agent activity
8 hits · last 30 days
node
8
Resources
pydap — pip install pydap · libregistry