You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get a Nasa api key by clicking <ahref="https://api.nasa.gov/#signUp">here</a>.
4
+
5
+
## How to use
6
+
1. import the file
7
+
```python
8
+
import apod_object_parser
9
+
```
10
+
2. Now call the `get_data` function and pass the `nasa api key` as the argument. Note api_key is a string. The response returned will be a Dictionary. Now you can parse the dictionary too
11
+
12
+
```python
13
+
response = apod_object_parser.get_data(##Pass In Your API key here)
14
+
```
15
+
### get_date
16
+
17
+
the `get_date` function takes the dictionary we got above and returns the date.
18
+
19
+
```python
20
+
date= apod_object_parser.get_date(response)
21
+
```
22
+
### get_explaination
23
+
the `get_explaination` function takes the dictionary we got above and returns the explaintion.
the `get_hdurl` function takes the dictionary we got above and returns the High Definition url of the image.
30
+
31
+
```python
32
+
date= apod_object_parser.get_hdurl(response)
33
+
```
34
+
### get_title
35
+
the `get_title` function takes the dictionary we got above and returns the title of the image.
36
+
37
+
```python
38
+
date= apod_object_parser.get_title(response)
39
+
```
40
+
### get_url
41
+
the `get_url` function takes the dictionary we got above and returns the Standard definition url of the image.
42
+
43
+
```python
44
+
date= apod_object_parser.get_hdurl(response)
45
+
```
46
+
### get_media_type
47
+
the `get_media_type` function takes the dictionary we got above and returns the media type the file (might be a video of a image).
48
+
49
+
```python
50
+
date= apod_object_parser.get_hdurl(response)
51
+
```
52
+
53
+
## Other functions
54
+
there are also other functions that might help you in situations
55
+
56
+
### download_image
57
+
the `download_image` finction takes the url (hdurl or url) and the date from the function `get_date`and downloads the image in the current directory andwith the file name of the date. the image downloaded isin the .jpg format
58
+
```python
59
+
apod_object_parser.download_image(url, date)
60
+
```
61
+
62
+
### convert_image
63
+
sometimes the image we downloaded above might not be in the right format (.jpg) so you may call `convert_image` function to convert the image into .png. takes the `image_path` parameter which is the filepath.
0 commit comments