pydap / pydap

A Python library implementing the Data Access Protocol (DAP, aka OPeNDAP).
https://pydap.github.io/pydap/
MIT License
138 stars 87 forks source link

Fixes #207: Pydap can now use PasterApp and serve data #318

Closed Mikejmnez closed 5 months ago

Mikejmnez commented 5 months ago

The following Pull Request is a continuation of PR #286 started by @raphaeljolivet (Thanks for the contribution!)

Usage: pydap [options]

Options: -h --help Show this help message and exit --version Show pydap version -i --init DIR Create directory with templates -b ADDRESS --bind ADDRESS The ip to listen to [default: 127.0.0.1] -p PORT --port PORT The port to connect [default: 8001] -d DIR --data DIR The directory with files [default: .] -t DIR --templates DIR The directory with templates --workers INT Number of workers [default: 1] --threads INT Number of threads [default: 1] --worker-class=CLASS Gunicorn worker class [default: sync]


With these changes, and gunicorn installed (any version), the following updated line in the README file works again:

```python
import multiprocessing
ncores = multiprocessing.cpu_count() * 2
pydap --data ./myserver/data/ --port 8001 --workers ncores
Mikejmnez commented 5 months ago

Do you think we can read data from DMR++ documents using this framework?

That's a good question. probably... Definitely an avenue worth exploring. I not super familiar with WSGI applications, nor Gunicorn, but I know that Gunicorn is lightweight, customizable, and that can handle concurrent requests efficiently. Definitely a good starting point.