Metadata-Version: 2.1
Name: pydap
Version: 3.5
Summary: A pure python implementation of the Data Access Protocol.
Author-email: Roberto De Almeida <roberto@dealmeida.net>
Maintainer-email: Miguel Jimenez-Urias <mjimenez@opendap.org>
License: The MIT License
        
        Copyright (c) 2003-2010 Roberto De Almeida
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Scientific/Engineering
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: Webob
Requires-Dist: Jinja2
Requires-Dist: docopt-ng
Requires-Dist: beautifulsoup4
Requires-Dist: lxml
Requires-Dist: requests
Requires-Dist: importlib-metadata
Requires-Dist: importlib-resources
Provides-Extra: cas
Requires-Dist: lxml; extra == "cas"
Provides-Extra: docs
Requires-Dist: Sphinx; extra == "docs"
Requires-Dist: Pygments; extra == "docs"
Requires-Dist: pandoc; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: numpydoc; extra == "docs"
Provides-Extra: functions
Requires-Dist: gsw==3.0.6; extra == "functions"
Requires-Dist: coards; extra == "functions"
Provides-Extra: handlers.netcdf
Requires-Dist: netCDF4; extra == "handlers-netcdf"
Provides-Extra: netcdf
Requires-Dist: netCDF4; extra == "netcdf"
Provides-Extra: server
Requires-Dist: gunicorn; extra == "server"
Requires-Dist: PasteDeploy; extra == "server"
Provides-Extra: tests
Requires-Dist: pytest>=3.6; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: pytest-attrib; extra == "tests"
Requires-Dist: requests-mock; extra == "tests"
Requires-Dist: WebTest; extra == "tests"
Requires-Dist: flake8; extra == "tests"
Requires-Dist: werkzeug>=2.2.2; extra == "tests"
Requires-Dist: gunicorn; extra == "tests"
Requires-Dist: cryptography; extra == "tests"
Requires-Dist: gsw; extra == "tests"
Requires-Dist: coards; extra == "tests"

pydap
=====

[![Python3](https://img.shields.io/badge/python-3-blue.svg)](https://www.python.org/downloads/)
[![PyPI](https://img.shields.io/pypi/v/pydap.svg?maxAge=2592000?style=plastic)](https://pypi.python.org/pypi/pydap/)
[![conda forge](https://anaconda.org/conda-forge/pydap/badges/version.svg)](https://anaconda.org/conda-forge/pydap)
[![Build Status](https://travis-ci.org/pydap/pydap.svg)](https://travis-ci.org/pydap/pydap)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/pydap/pydap)
[![pre-commit](https://results.pre-commit.ci/badge/github/pydap/pydap/master.svg)](https://results.pre-commit.ci/latest/github/pydap/pydap/master)



[pydap](https://pydap.github.io/pydap/) is an implementation of the
Opendap/DODS protocol, written from scratch in pure python.  You can
use pydap to access scientific data on the internet without having to
download it; instead, you work with special array and iterable objects
that download data on-the-fly as necessary, saving bandwidth and
time. The module also comes with a robust-but-lightweight Opendap
server, implemented as a WSGI application.


Quickstart
----------
pydap is a lighweight python package that you can use in either
of the two modalities: a client and as a server.
You can install the latest version using
[pip](http://pypi.python.org/pypi/pip). After [installing
pip](http://www.pip-installer.org/en/latest/installing.html) you can
install pydap with this command:

```bash
    $ pip install pydap
```
This will install pydap together with all the required
dependencies. pydap is also available through [Anaconda](https://www.anaconda.com/).
Below we install pydap and its required dependencies, along with common
additional packages in a fresh conda environment named pydap:

```bash
$ mamba create -n pydap -c conda-forge python=3.10 pydap numpy jupyterlab ipython netCDF4 scipy matplotlib
```
Now you simply activate the pydap environment:
```bash
mamba activate pydap
```

You can now use pydap as a client and open any remotely served
dataset, and pydap will download the accessed data on-the-fly as needed:

```python

    >>> from pydap.client import open_url
    >>> dataset = open_url('http://test.opendap.org/dap/data/nc/coads_climatology.nc')
    >>> var = dataset['SST']
    >>> var.shape
    (12, 90, 180)
    >>> var.dtype
    dtype('>f4')
    >>> data = var[0,10:14,10:14]  # this will download data from the server
    >>> data
    <GridType with array 'SST' and maps 'TIME', 'COADSY', 'COADSX'>
    >>> print(data.data)
    [array([[[ -1.26285708e+00,  -9.99999979e+33,  -9.99999979e+33,
              -9.99999979e+33],
            [ -7.69166648e-01,  -7.79999971e-01,  -6.75454497e-01,
              -5.95714271e-01],
            [  1.28333330e-01,  -5.00000156e-02,  -6.36363626e-02,
              -1.41666666e-01],
            [  6.38000011e-01,   8.95384610e-01,   7.21666634e-01,
               8.10000002e-01]]], dtype=float32), array([ 366.]), array([-69., -67., -65., -63.]), array([ 41.,  43.,  45.,  47.])]
```

For more information, please check the documentation on [using pydap
as a client](https://pydap.github.io/pydap/client.html).

pydap also comes with a simple server, implemented as a [WSGI]( http://wsgi.org/)
application. To use it, you first need to install the server and
optionally a data handler:

```bash
    $ pip install "pydap[server,handlers.netcdf]"
```

This will install support for
[netCDF](https://www.unidata.ucar.edu/software/netcdf/) files; more
[handlers](https://pydap.github.io/pydap/handlers.html) for
different formats are available, if necessary. Now create a directory
for your server data.

To run the server just issue the command:

```bash

    $ pydap --data ./myserver/data/ --port 8001 --workers 4 --threads 4
```

This will start a standalone server running on the default http://localhost:8001/,
serving netCDF files from ``./myserver/data/``, similar to the test
server at http://test.pydap.org/. Since the server uses the
[WSGI](http://wsgi.org/) standard, pydap uses by default 1 worker and 1
thread, but these can be defined by the user like in the case above (4 workers
and 4 threads). Pydap can also easily be run behind Apache. The [server
documentation](https://pydap.github.io/pydap/server.html) has
more information on how to better deploy pydap.

## Documentation

For more information, see [the pydap
documentation](https://pydap.github.io/pydap/).

## Help

If you need any help with pydap, please feel free to send an email to
the [mailing list](http://groups.google.com/group/pydap/)
