Skip to content

Commit a496448

Browse files
authored
Turn into workspace (#2)
1 parent 95176c7 commit a496448

20 files changed

+100
-82
lines changed

CLAUDE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# readap
22

3-
readap is a rust library for reading OpenDAP DAP2 datasets. It does not aim to be a library for downloading data, just for parsing the metadata and data payloads from a DAP2 server.
3+
## Repository Structure
44

5-
## About Dap2
5+
- readap: The parser library for reading OpenDAP datasets
66

7-
Dap2 is a protocol for accessing scientific data. This project is a sparse implementation of the dap2 specification.
87

Cargo.toml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
[package]
2-
name = "readap"
3-
description = "A parser for the OpenDAP DAP2 protocol"
4-
version = "0.1.0"
5-
edition = "2021"
6-
authors = ["Matthew Iannucci <mpiannucci@gmail.com>"]
7-
license = "MIT"
8-
readme = "README.md"
9-
keywords = ["dap", "opendap", "scientific", "data"]
10-
categories = ["encoding", "parser-implementations", "parsing", "science", "science::geo"]
11-
repository = "https://github.com/mpiannucci/readap"
12-
13-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14-
15-
[dependencies]
16-
nom = "7"
17-
thiserror = "1.0"
1+
[workspace]
2+
resolver = "3"
3+
members = ["readap"]

README.md

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,8 @@
11
# readap
22

3-
Read OpenDAP binary data with pure rust
3+
Read OpenDAP data with Rust
44

5-
## Install
5+
## Packages
66

7-
with `cargo add`:
7+
- [readap](./readap/README.md): Parse OpenDAP data
88

9-
```bash
10-
cargo add readap
11-
```
12-
13-
or `Cargo.toml`:
14-
15-
```toml
16-
[dependencies]
17-
readap = "0.1.0"
18-
```
19-
20-
## Getting Started
21-
22-
#### Read DAS metadata
23-
24-
```rs
25-
let attrs = parse_das_attributes(input).unwrap();
26-
```
27-
28-
This returns a `HashMap` containing all of the attributes and their children, within another hashmap
29-
30-
```rs
31-
let units: String = attrs["time"]["units"].clone().try_into().unwrap();
32-
```
33-
34-
### Read a DDS dataset
35-
36-
```rs
37-
let dataset = DdsDataset::from_bytes(&input).unwrap();
38-
```
39-
40-
### Read a DODS dataset
41-
42-
```rs
43-
let dataset = DodsDataset::from_bytes(&input).unwrap();
44-
```
45-
46-
Then extract the data and coordinates for a given variable
47-
48-
```rs
49-
let mwd = if let DataArray::Int32(mwd) = dataset.variable_data("mean_wave_dir").unwrap() {
50-
mwd
51-
} else {
52-
vec![]
53-
};
54-
55-
let coords = dataset.variable_coords("mean_wave_dir").unwrap();
56-
let time_data: Vec<i32> = coords[0].1.try_into().unwrap();
57-
```
58-
59-
For concrete examples, see the [parse tests](tests/parse.rs)
60-
61-
## What this library is
62-
63-
This library is an OpenDAP binary data and metadata parser. It *is not* a data downloader. It is a lower level tool to be used in higher level data access applications.
64-
65-
## License
66-
67-
[MIT](LICENSE) - 2025 Matthew Iannucci

readap/CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# readap
2+
3+
readap is a rust library for reading OpenDAP DAP2 datasets. It does not aim to be a library for downloading data, just for parsing the metadata and data payloads from a DAP2 server.
4+
5+
## About Dap2
6+
7+
Dap2 is a protocol for accessing scientific data. This project is a sparse implementation of the dap2 specification.
8+

readap/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "readap"
3+
description = "A parser for the OpenDAP DAP2 protocol"
4+
version = "0.2.0"
5+
edition = "2021"
6+
authors = ["Matthew Iannucci <mpiannucci@gmail.com>"]
7+
license = "MIT"
8+
readme = "README.md"
9+
keywords = ["dap", "opendap", "scientific", "data"]
10+
categories = ["encoding", "parser-implementations", "parsing", "science", "science::geo"]
11+
repository = "https://github.com/mpiannucci/readap/readap"
12+
13+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14+
15+
[dependencies]
16+
nom = "7"
17+
thiserror = "1.0"
File renamed without changes.

readap/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# readap
2+
3+
Read OpenDAP binary data with pure rust
4+
5+
## Install
6+
7+
with `cargo add`:
8+
9+
```bash
10+
cargo add readap
11+
```
12+
13+
or `Cargo.toml`:
14+
15+
```toml
16+
[dependencies]
17+
readap = "0.1.0"
18+
```
19+
20+
## Getting Started
21+
22+
#### Read DAS metadata
23+
24+
```rs
25+
let attrs = parse_das_attributes(input).unwrap();
26+
```
27+
28+
This returns a `HashMap` containing all of the attributes and their children, within another hashmap
29+
30+
```rs
31+
let units: String = attrs["time"]["units"].clone().try_into().unwrap();
32+
```
33+
34+
### Read a DDS dataset
35+
36+
```rs
37+
let dataset = DdsDataset::from_bytes(&input).unwrap();
38+
```
39+
40+
### Read a DODS dataset
41+
42+
```rs
43+
let dataset = DodsDataset::from_bytes(&input).unwrap();
44+
```
45+
46+
Then extract the data and coordinates for a given variable
47+
48+
```rs
49+
let mwd = if let DataArray::Int32(mwd) = dataset.variable_data("mean_wave_dir").unwrap() {
50+
mwd
51+
} else {
52+
vec![]
53+
};
54+
55+
let coords = dataset.variable_coords("mean_wave_dir").unwrap();
56+
let time_data: Vec<i32> = coords[0].1.try_into().unwrap();
57+
```
58+
59+
For concrete examples, see the [parse tests](tests/parse.rs)
60+
61+
## What this library is
62+
63+
This library is an OpenDAP binary data and metadata parser. It *is not* a data downloader. It is a lower level tool to be used in higher level data access applications.
64+
65+
## License
66+
67+
[MIT](LICENSE) - 2025 Matthew Iannucci
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)