Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 7cccbc6

Browse files
committed
Updating the README with some examples
1 parent de31c01 commit 7cccbc6

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
# SDS-access-lib
22

3-
This is a simple python script that allows a user to upload, query, and download data from a a Science Data System as set up from: https://github.com/IMAP-Science-Operations-Center/sds-data-manager
3+
This is a simple python script that allows a user to upload, query, and download data from a a Science Data System as set up from: https://github.com/IMAP-Science-Operations-Center/sds-data-manager
4+
5+
## Uploading Data Example
6+
7+
```
8+
>>> import sds_api
9+
>>> response = sds_api.upload(file_location='helloworld.txt', file_name='imap_l0_sci_mag_2024_2_ThisWillMakeThingsFail.pkts')
10+
Could not generate an upload URL with the following error: "A pre-signed URL could not be generated. Please ensure that the file name matches mission file naming conventions."
11+
>>> response = sds_api.upload(file_location='helloworld.txt', file_name='imap_l0_sci_mag_2024_2.pkts')
12+
```
13+
14+
## Querying Data Example
15+
```
16+
>>> results = sds_api.query(instrument='imap-lo')
17+
>>> print(results)
18+
[]
19+
>>> results = sds_api.query(instrument='mag')
20+
>>> print(results)
21+
[{'_index': 'metadata', '_type': '_doc', '_source': {'date': '2024', 'mission': 'imap', 'extension': 'pkts', 'level': 'l0', 'instrument': 'mag', 'type': 'sci', 'version': '2'}, '_id': 's3://sds-data-harter-upload-testing/imap/l0/imap_l0_sci_mag_2024_2.pkts', '_score': 0.18232156}, {'_index': 'metadata', '_type': '_doc', '_source': {'date': '2024', 'mission': 'imap', 'extension': 'pkts', 'level': 'l0', 'instrument': 'mag', 'type': 'sci', 'version': ''}, '_id': 's3://sds-data-harter-upload-testing/imap/l0/imap_l0_sci_mag_2024_.pkts', '_score': 0.18232156}]
22+
```
23+
24+
## Downloading Data Example
25+
```
26+
>>> response = sds_api.download(results[0]['_id'])
27+
Downloading sds-data-harter-upload-testing/imap/l0/imap_l0_sci_mag_2024_2.pkts
28+
```

0 commit comments

Comments
 (0)