n2yo-api-wrapper 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
n2yo/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ __title__ = "n2yo-api-wrapper"
2
+ __version__ = "0.0.1"
3
+ __author__ = "Giampy"
4
+ __license__ = "MIT"
5
+
6
+ from .n2yo import n2yo
n2yo/exceptions.py ADDED
@@ -0,0 +1,2 @@
1
+ class InvalidApiKey(Exception):
2
+ pass
File without changes
n2yo/models/search.py ADDED
@@ -0,0 +1,87 @@
1
+ from dataclasses import dataclass
2
+ from typing import List, Optional
3
+
4
+
5
+ @dataclass
6
+ class SatelliteInfo:
7
+ category: Optional[str] # Category name (ANY if category id requested was 0)
8
+ satid: Optional[int] # NORAD id used in input
9
+ satcount : Optional[int] # Count of satellites returned
10
+ satname: Optional[str] # Satellite name
11
+ transactionscount: int # Count of transactions performed with this API key in last 60 minutes
12
+ passescount: Optional[int] # Count of passes returned
13
+
14
+ @dataclass
15
+ class SatellitePosition:
16
+ satlatitude: float # Satellite footprint latitude (decimal degrees format)
17
+ satlongitude: float # Satellite footprint longitude (decimal degrees format)
18
+ azimuth: float # Satellite azimuth with respect to observer's location (degrees)
19
+ elevation: float # Satellite elevation with respect to observer's location (degrees)
20
+ ra: float # Satellite right ascension (degrees)
21
+ dec: float # Satellite declination (degrees)
22
+ timestamp: int # Unix time for this position (seconds). You should convert this UTC value to observer's time zone
23
+
24
+ @dataclass
25
+ class VisualPass:
26
+ startAz: float # Satellite azimuth for the start of this pass (relative to the observer, in degrees)
27
+ startAzCompass: str # Satellite azimuth for the start of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
28
+ startEl: float # Satellite elevation for the start of this pass (relative to the observer, in degrees)
29
+ startUTC: int # Unix time for the start of this pass. You should convert this UTC value to observer's time zone
30
+ maxAz: float # Satellite azimuth for the max elevation of this pass (relative to the observer, in degrees)
31
+ maxAzCompass: str # Satellite azimuth for the max elevation of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
32
+ maxEl: float # Satellite max elevation for this pass (relative to the observer, in degrees)
33
+ maxUTC: int # Unix time for the max elevation of this pass. You should convert this UTC value to observer's time zone
34
+ endAz: float # Satellite azimuth for the end of this pass (relative to the observer, in degrees)
35
+ endAzCompass: str # Satellite azimuth for the end of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
36
+ endEl: float #Satellite elevation for the end of this pass (relative to the observer, in degrees)
37
+ endUTC: int # Unix time for the end of this pass. You should convert this UTC value to observer's time zone
38
+ mag: float # Max visual magnitude of the pass, same scale as star brightness. If magnitude cannot be determined, the value is 100000
39
+ duration: int # Total visible duration of this pass (in seconds)
40
+
41
+ @dataclass
42
+ class RadioPass:
43
+ startAz: float # Satellite azimuth for the start of this pass (relative to the observer, in degrees)
44
+ startAzCompass: str # Satellite azimuth for the start of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
45
+ startUTC: int # Unix time for the start of this pass. You should convert this UTC value to observer's time zone
46
+ maxAz: float # Satellite azimuth for the max elevation of this pass (relative to the observer, in degrees)
47
+ maxAzCompass: str # Satellite azimuth for the max elevation of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
48
+ maxEl: float # Satellite max elevation for this pass (relative to the observer, in degrees)
49
+ maxUTC: int # Unix time for the max elevation of this pass. You should convert this UTC value to observer's time zone
50
+ endAz: float # Satellite azimuth for the end of this pass (relative to the observer, in degrees)
51
+ endAzCompass: str # Satellite azimuth for the end of this pass (relative to the observer). Possible values: N, NE, E, SE, S, SW, W, NW
52
+ endUTC: int # Unix time for the end of this pass. You should convert this UTC value to observer's time zone
53
+
54
+ @dataclass
55
+ class SatelliteAbove:
56
+ satid: int # Satellite NORAD id
57
+ intDesignator: str # Satellite international designator
58
+ satname: str # Satellite name
59
+ launchDate: str # Satellite launch date (YYYY-MM-DD)
60
+ satlat: float # Satellite footprint latitude (decimal degrees format)
61
+ satlng: float # Satellite footprint longitude (decimal degrees format)
62
+ satalt: float # Satellite altitude (km)
63
+
64
+ @dataclass
65
+ class TleData:
66
+ info: SatelliteInfo
67
+ tle: str # TLE on single line string. Split the line in two by \r\n to get original two lines
68
+
69
+ @dataclass
70
+ class SatellitePositionsData:
71
+ info: SatelliteInfo
72
+ positions: List[SatellitePosition]
73
+
74
+ @dataclass
75
+ class VisualPassesData:
76
+ info: SatelliteInfo
77
+ passes: List[VisualPass]
78
+
79
+ @dataclass
80
+ class RadioPassesData:
81
+ info: SatelliteInfo
82
+ passes: List[RadioPass]
83
+
84
+ @dataclass
85
+ class SatellitesAboveData:
86
+ info: SatelliteInfo
87
+ above: List[SatelliteAbove]
n2yo/n2yo.py ADDED
@@ -0,0 +1,264 @@
1
+ import logging, requests
2
+ from dacite import from_dict
3
+
4
+ from .models.search import TleData, SatellitePositionsData, VisualPassesData, RadioPassesData, SatellitesAboveData
5
+ from .exceptions import InvalidApiKey
6
+
7
+
8
+ # Set up logging - datetime format, level, and format
9
+ # Default to INFO level
10
+
11
+ logging.basicConfig(
12
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
13
+ datefmt="%Y-%m-%d %H:%M:%S",
14
+ level=logging.INFO,
15
+ )
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ class n2yo:
21
+ def __init__(self, api_key: str)-> None:
22
+
23
+ self.apiKey = api_key
24
+ self.params = {'apiKey': self.apiKey}
25
+
26
+ self.base_url = f"https://api.n2yo.com"
27
+ self.api_url = f"{self.base_url}/rest/v1/satellite/"
28
+
29
+ logger.info("n2yo client initialization completed successfully")
30
+
31
+ def get_tle(self,
32
+ id: int) -> TleData:
33
+
34
+ """
35
+ Retrieve the Two Line Elements (TLE) for a satellite identified by NORAD id.
36
+
37
+
38
+ **API Endpoint**
39
+ `/tle/{id}`
40
+
41
+ **Parameters:**
42
+ `id` (int): NORAD satellite ID (**required**)
43
+
44
+ **Returns:**
45
+ TleData: A structured object containing satellite data.
46
+
47
+ **Response Fields:**
48
+ `satid` (int): NORAD ID used in the request
49
+ `satname` (str): Satellite name
50
+ `transactionscount` (int): API transaction count in the past 60 minutes
51
+ `tle` (str): Full Two Line Element set for the satellite
52
+ """
53
+
54
+ response = requests.get(url=f'{self.api_url}tle/{id}/', params=self.params)
55
+ data = response.json()
56
+
57
+ if data.get("error") == "Invalid API Key!":
58
+ raise InvalidApiKey("The API key is invalid or missing.")
59
+
60
+ result = from_dict(data_class=TleData, data=data)
61
+ return result
62
+
63
+ def get_satellite_positions(self,
64
+ id: int,
65
+ observer_lat: float,
66
+ observer_lng: float,
67
+ observer_alt: float,
68
+ seconds: float) -> SatellitePositionsData:
69
+
70
+ """
71
+ Retrieve the future positions of any satellite as footprints (latitude, longitude) to display orbits on maps. Also return the satellite's azimuth and elevation with respect to the observer location. Each element in the response array is one second of calculation. First element is calculated for current UTC time.
72
+
73
+
74
+ **API Endpoint**
75
+ `/positions/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{seconds}`
76
+
77
+ **Parameters:**
78
+ `id` (int): NORAD satellite ID
79
+ `observer_lat` (float): Observer's latitude (decimal degrees)
80
+ `observer_lng` (float): Observer's longitude (decimal degrees)
81
+ `observer_alt` (float): Altitude above sea level (meters)
82
+ `seconds` (int): Number of future seconds to calculate (max 300)
83
+
84
+ **Returns:**
85
+ SatellitePositionsData: A structured object containing satellite positions data.
86
+
87
+ **Response Fields:**
88
+ `satid` (int): NORAD ID used in request
89
+ `satname` (str): Satellite name
90
+ `transactionscount` (int): API usage in the past 60 minutes
91
+ `satlatitude` (float): Satellite latitude projection on Earth's surface
92
+ `satlongitude` (float): Satellite longitude projection on Earth's surface
93
+ `azimuth` (float): Azimuth angle from observer to satellite (degrees)
94
+ `elevation` (float): Elevation angle from observer to satellite (degrees)
95
+ `ra` (float): Right ascension in celestial coordinates (degrees)
96
+ `dec` (float): Declination in celestial coordinates (degrees)
97
+ `timestamp` (int): UNIX timestamp for this position (UTC)
98
+ """
99
+
100
+ response = requests.get(url=f'{self.api_url}positions/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{seconds}/', params=self.params)
101
+ data = response.json()
102
+
103
+ if data.get("error") == "Invalid API Key!":
104
+ raise InvalidApiKey("The API key is invalid or missing.")
105
+
106
+ result = from_dict(data_class=SatellitePositionsData, data=data)
107
+ return result
108
+
109
+ def get_visual_passes(self,
110
+ id: int,
111
+ observer_lat: float,
112
+ observer_lng: float,
113
+ observer_alt: float,
114
+ days: int,
115
+ min_visibility: int) -> VisualPassesData:
116
+
117
+ """
118
+ Get predicted visual passes for any satellite relative to a location on Earth. A 'visual pass' is a pass that should be optically visible on the entire (or partial) duration of crossing the sky. For that to happen, the satellite must be above the horizon, illumintaed by Sun (not in Earth shadow), and the sky dark enough to allow visual satellite observation.
119
+
120
+
121
+ **API Endpoint**
122
+ `/visualpasses/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{days}/{min_visibility}`
123
+
124
+ **Parameters:**
125
+ `id` (int): NORAD satellite ID
126
+ `observer_lat` (float): Observer's latitude (decimal degrees)
127
+ `observer_lng` (float): Observer's longitude (decimal degrees)
128
+ `observer_alt` (float): Observer's altitude (meters)
129
+ `days` (int): Number of days to search (max 10)
130
+ `min_visibility` (int): Minimum number of seconds satellite must be visible to include the pass
131
+
132
+ **Returns:**
133
+ VisualPassesData: A structured object containing visual passes data.
134
+
135
+ **Response Fields:**
136
+ `satid` (int): Same NORAD ID provided in input
137
+ `satname` (str): Name of the satellite
138
+ `transactionscount` (int): Number of API calls in the last 60 minutes
139
+ `passescount` (int): Number of passes returned
140
+ `startAz` (float): Azimuth at start of pass (degrees)
141
+ `startAzCompass` (str): Cardinal direction of start azimuth (e.g., N, NE, E, SE, ...)
142
+ `startEl` (float): Elevation at start of pass (degrees)
143
+ `startUTC` (int): UNIX timestamp for start of pass (UTC)
144
+ `maxAz` (float): Azimuth at max elevation point
145
+ `maxAzCompass` (str): Cardinal direction of max azimuth
146
+ `maxEl` (float): Maximum elevation during pass (degrees)
147
+ `maxUTC` (int): UNIX timestamp for max elevation point (UTC)
148
+ `endAz` (float): Azimuth at end of pass
149
+ `endAzCompass` (str): Cardinal direction of end azimuth
150
+ `endEl` (float): Elevation at end of pass (degrees)
151
+ `endUTC` (int): UNIX timestamp for end of pass (UTC)
152
+ `mag` (float): Maximum visual magnitude (smaller = brighter; 100000 = unknown)
153
+ `duration` (int): Total visible duration of the pass (in seconds)
154
+ """
155
+
156
+ response = requests.get(url=f'{self.api_url}visualpasses/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{days}/{min_visibility}/', params=self.params)
157
+ data = response.json()
158
+
159
+ if data.get("error") == "Invalid API Key!":
160
+ raise InvalidApiKey("The API key is invalid or missing.")
161
+
162
+ result = from_dict(data_class=VisualPassesData, data=data)
163
+ return result
164
+
165
+ def get_radio_passes(self,
166
+ id: int,
167
+ observer_lat: float,
168
+ observer_lng: float,
169
+ observer_alt: float,
170
+ days: int,
171
+ min_elevation: int) -> RadioPassesData:
172
+
173
+ """
174
+ The 'radio passes' are similar to 'visual passes', the only difference being the requirement for the objects to be optically visible for observers. This function is useful mainly for predicting satellite passes to be used for radio communications. The quality of the pass depends essentially on the highest elevation value during the pass, which is one of the input parameters.
175
+
176
+
177
+ **API Endpoint**
178
+ `/radiopasses/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{days}/{min_elevation}`
179
+
180
+ **Parameters:**
181
+ `id` (int): NORAD ID of the satellite
182
+ `observer_lat` (float): Observer's latitude in decimal degrees
183
+ `observer_lng` (float): Observer's longitude in decimal degrees
184
+ `observer_alt` (float): Observer's altitude in meters
185
+ `days` (int): Number of days to search for passes
186
+ `min_elevation` (int): Minimum elevation angle (in degrees) to consider the pass valid
187
+
188
+ **Returns:**
189
+ RadioPassesData: A structured object containing radio passes data.
190
+
191
+ **Response Fields:**
192
+ `satid` (int): Same NORAD ID provided in input
193
+ `satname` (str): Name of the satellite
194
+ `transactionscount` (int): Number of API transactions in the last hour
195
+ `passescount` (int): Number of passes returned
196
+ `startAz` (float): Azimuth at start of pass (degrees)
197
+ `startAzCompass` (str): Cardinal direction of start azimuth (e.g., N, NE, E)
198
+ `startUTC` (int): UNIX timestamp of pass start (UTC)
199
+ `maxAz` (float): Azimuth at max elevation point
200
+ `maxAzCompass` (str): Cardinal direction of max azimuth
201
+ `maxEl` (float): Maximum elevation during pass (degrees)
202
+ `maxUTC` (int): UNIX timestamp of max elevation point (UTC)
203
+ `endAz` (float): Azimuth at end of pass
204
+ `endAzCompass` (str): Cardinal direction of end azimuth
205
+ `endUTC` (int): UNIX timestamp of pass end (UTC)
206
+ """
207
+
208
+ response = requests.get(url=f'{self.api_url}radiopasses/{id}/{observer_lat}/{observer_lng}/{observer_alt}/{days}/{min_elevation}/', params=self.params)
209
+ data = response.json()
210
+
211
+ if data.get("error") == "Invalid API Key!":
212
+ raise InvalidApiKey("The API key is invalid or missing.")
213
+
214
+ result = from_dict(data_class=RadioPassesData, data=data)
215
+ return result
216
+
217
+ def get_above(
218
+ self,
219
+ observer_lat: float,
220
+ observer_lng: float,
221
+ observer_alt: float,
222
+ search_radius: int,
223
+ category_id: int) -> SatellitesAboveData:
224
+
225
+ """
226
+ The 'above' function will return all objects within a given search radius above observer's location. The radius (ΞΈ), expressed in degrees, is measured relative to the point in the sky directly above an observer (azimuth).
227
+
228
+
229
+ **API Endpoint**
230
+ /above/{observer_lat}/{observer_lng}/{observer_alt}/{search_radius}/{category_id}
231
+
232
+ **Parameters:**
233
+ observer_lat (float): Latitude in decimal degrees.
234
+ observer_lng (float): Longitude in decimal degrees.
235
+ observer_alt (float): Altitude above sea level (in meters).
236
+ search_radius (int): Search radius in degrees (0–90).
237
+ category_id (int): Satellite category ID (use 0 for all categories).
238
+
239
+ **Returns:**
240
+ SatellitesAboveData: A structured object containing satellite pass data.
241
+
242
+ **Response Fields:**
243
+ category (str): Category name (e.g., "ANY" if ID = 0)
244
+ transactionscount (int): API calls in the last 60 minutes
245
+ satcount (int): Number of satellites returned
246
+ startAz (float): Start azimuth in degrees
247
+ satid (int): NORAD satellite ID
248
+ intDesignator (str): International designator
249
+ satname (str): Satellite name
250
+ launchDate (str): Format YYYY-MM-DD
251
+ satlat (float): Satellite latitude
252
+ satlng (float): Satellite longitude
253
+ satalt (float): Satellite altitude (km)
254
+ """
255
+
256
+ response = requests.get(url=f'{self.api_url}above/{observer_lat}/{observer_lng}/{observer_alt}/{search_radius}/{category_id}/', params=self.params)
257
+ data = response.json()
258
+
259
+ if data.get("error") == "Invalid API Key!":
260
+ raise InvalidApiKey("The API key is invalid or missing.")
261
+
262
+ result = from_dict(data_class=SatellitesAboveData, data=data)
263
+
264
+ return result
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Giampy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,255 @@
1
+ Metadata-Version: 2.1
2
+ Name: n2yo-api-wrapper
3
+ Version: 0.0.1
4
+ Summary: Unofficial Wrapper for N2YO.com API
5
+ Home-page: https://github.com/g1ampy/n2yo-api-wrapper
6
+ Author: Giampy
7
+ Author-email: g1ampy@proton.me
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE.txt
17
+ Requires-Dist: requests
18
+ Requires-Dist: dacite
19
+ Requires-Dist: beautifulsoup4
20
+
21
+ <!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
22
+ <a id="readme-top"></a>
23
+ <!--
24
+ *** Thanks for checking out the Best-README-Template. If you have a suggestion
25
+ *** that would make this better, please fork the repo and create a pull request
26
+ *** or simply open an issue with the tag "enhancement".
27
+ *** Don't forget to give the project a star!
28
+ *** Thanks again! Now go create something AMAZING! :D
29
+ -->
30
+
31
+
32
+
33
+ <!-- PROJECT SHIELDS -->
34
+ <!--
35
+ *** I'm using markdown "reference style" links for readability.
36
+ *** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
37
+ *** See the bottom of this document for the declaration of the reference variables
38
+ *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
39
+ *** https://www.markdownguide.org/basic-syntax/#reference-style-links
40
+ -->
41
+ [![Forks][forks-shield]][forks-url]
42
+ [![Stargazers][stars-shield]][stars-url]
43
+ [![Contributors][contributors-shield]][contributors-url]
44
+ [![Issues][issues-shield]][issues-url]
45
+ [![PyPi][pypi-shield]][pypi-url]
46
+ [![MIT][license-shield]][license-url]
47
+
48
+
49
+ <!-- PROJECT LOGO -->
50
+ <br />
51
+ <div align="center">
52
+ <a href="https://github.com/g1ampy/n2yo-api-wrapper">
53
+ <img src="images/logo.png" alt="Logo" width="400">
54
+ </a>
55
+
56
+ <h3 align="center">N2YO.com API Wrapper</h3>
57
+
58
+ <p align="center">
59
+ A lightweight and easy-to-use Python wrapper for the N2YO.com API
60
+ <br />
61
+ <a href="https://github.com/g1ampy/n2yo-api-wrapper"><strong>Β« Explore the docs Β»</strong></a>
62
+ <br />
63
+ <br />
64
+ <a href="https://github.com/g1ampy/n2yo-api-wrapper/issues/new?labels=bug&template=bug-report---.yml">Report Bug</a>
65
+ &middot;
66
+ <a href="https://github.com/g1ampy/n2yo-api-wrapper/issues/new?labels=enhancement&template=feature-request---.yml">Request Feature</a>
67
+ </p>
68
+ </div>
69
+
70
+
71
+
72
+ <!-- TABLE OF CONTENTS -->
73
+ <details>
74
+ <summary>Table of Contents</summary>
75
+ <ol>
76
+ <li>
77
+ <a href="#about-the-project">About The Project</a>
78
+ <ul>
79
+ <li><a href="#built-with">Built With</a></li>
80
+ </ul>
81
+ </li>
82
+ <li>
83
+ <a href="#getting-started">Getting Started</a>
84
+ <ul>
85
+ <li><a href="#prerequisites">Prerequisites</a></li>
86
+ <li><a href="#installation">Installation</a></li>
87
+ </ul>
88
+ </li>
89
+ <li><a href="#usage">Usage</a></li>
90
+ <li><a href="#contributing">Contributing</a></li>
91
+ <li><a href="#license">License</a></li>
92
+ <li><a href="#contact">Contact</a></li>
93
+ </ol>
94
+ </details>
95
+
96
+
97
+
98
+ <!-- ABOUT THE PROJECT -->
99
+ ## ℹ️ About The Project
100
+
101
+ The N2YO API Wrapper is a Python tool designed to interact with the N2YO satellite tracking API. It simplifies API requests, handles API keys and parses JSON responses into structured Python objects, providing methods to fetch real-time satellite positions, visible passes and orbital data. This makes it easy for developers to quickly and efficiently integrate satellite tracking and space data into their applications.
102
+
103
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
104
+
105
+
106
+
107
+ ### Built With
108
+
109
+ [![Python][Python]][Python-url]
110
+ [![requests][requests]][requests-url]
111
+ [![dacite][dacite]][dacite-url]
112
+
113
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
114
+
115
+
116
+
117
+ <!-- GETTING STARTED -->
118
+ ## 🟒 Getting Started
119
+
120
+ To use the N2YO.com API Wrapper you can clone the repository or use `pip` package (recommended)
121
+
122
+ ### Prerequisites
123
+
124
+ - Python 3.10 or higher
125
+ - A free API key from [https://www.n2yo.com](https://www.n2yo.com)
126
+
127
+ ### Installation
128
+ ```sh
129
+ pip install n2yo-api-wrapper
130
+ ```
131
+
132
+ <p align="right">(<a href="#readme-top">back to top ⬆️</a>)</p>
133
+
134
+
135
+
136
+ <!-- USAGE EXAMPLES -->
137
+ ## ❓ Usage
138
+
139
+ Here’s a basic example of how to use the N2YO API wrapper to track a satellite (e.g., the ISS):
140
+
141
+ ```python
142
+ from n2yo import n2yo
143
+
144
+ # Initialize the API client with your key
145
+ wrapper = n2yo(api_key="YOUR_API_KEY")
146
+
147
+ # Get real-time position of the ISS (satellite ID: 25544)
148
+ position = wrapper.get_satellite_positions(
149
+ id=25544,
150
+ observer_lat=41.9028, # Latitude (e.g., Rome)
151
+ observer_lng=12.4964, # Longitude
152
+ observer_alt=100, # Altitude in meters
153
+ seconds=1
154
+ )
155
+
156
+ print(position)
157
+ ```
158
+
159
+ ### πŸ“Œ Available Methods
160
+
161
+ - `get_satellite_positions(...)` – Get current position of a satellite
162
+ - `get_tle(satellite_id)` – Retrieve the TLE data
163
+ - `get_visual_passes(...)` – Get upcoming visible passes
164
+ - `get_radio_passes(...)` – Get upcoming radio passes
165
+ - `get_above(...)` – List satellites currently above a location
166
+
167
+ _For more examples, please refer to the [Documentation](https://www.n2yo.com/api/)_
168
+
169
+ <p align="right">(<a href="#readme-top">back to top ⬆️</a>)</p>
170
+
171
+
172
+
173
+ <!-- CONTRIBUTING -->
174
+ ## 🌱 Contributing
175
+
176
+ Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
177
+
178
+ If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
179
+ Don't forget to give the project a star! Thanks again!
180
+
181
+ 1. Fork the Project
182
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
183
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
184
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
185
+ 5. Open a Pull Request
186
+
187
+ <p align="right">(<a href="#readme-top">back to top ⬆️</a>)</p>
188
+
189
+
190
+
191
+ ### Top contributors:
192
+
193
+ <a href="https://github.com/g1ampy/n2yo-api-wrapper/graphs/contributors">
194
+ <img src="https://contrib.rocks/image?repo=g1ampy/n2yo-api-wrapper" alt="contrib.rocks image" />
195
+ </a>
196
+
197
+
198
+
199
+ <!-- LICENSE -->
200
+ ## πŸ“œ License
201
+
202
+ Distributed under the MIT. See `LICENSE.txt` for more information.
203
+
204
+ <p align="right">(<a href="#readme-top">back to top ⬆️</a>)</p>
205
+
206
+
207
+
208
+ <!-- CONTACT -->
209
+ ## πŸ“₯ Contact
210
+
211
+ <a href="mailto:g1ampy@proton.me">
212
+ <img src="https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white" alt="Gmail">
213
+ </a>
214
+
215
+ <p align="right">(<a href="#readme-top">back to top ⬆️</a>)</p>
216
+
217
+
218
+
219
+ <!-- MARKDOWN LINKS & IMAGES -->
220
+ <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
221
+ [contributors-shield]: https://img.shields.io/github/contributors/g1ampy/n2yo-api-wrapper.svg
222
+ [contributors-url]: https://github.com/g1ampy/n2yo-api-wrapper/graphs/contributors
223
+ [forks-shield]: https://img.shields.io/github/forks/g1ampy/n2yo-api-wrapper.svg
224
+ [forks-url]: https://github.com/g1ampy/n2yo-api-wrapper/network/members
225
+ [stars-shield]: https://img.shields.io/github/stars/g1ampy/n2yo-api-wrapper.svg
226
+ [stars-url]: https://github.com/g1ampy/n2yo-api-wrapper/stargazers
227
+ [issues-shield]: https://img.shields.io/github/issues/g1ampy/n2yo-api-wrapper.svg
228
+ [issues-url]: https://github.com/g1ampy/n2yo-api-wrapper/issues
229
+ [pypi-shield]: https://img.shields.io/pypi/v/n2yo-api-wrapper
230
+ [pypi-url]: https://pypi.org/project/n2yo-api-wrapper/
231
+ [license-shield]: https://img.shields.io/github/license/g1ampy/n2yo-api-wrapper.svg
232
+ [license-url]: https://github.com/g1ampy/n2yo-api-wrapper/blob/stable/LICENSE.txt
233
+ [product-screenshot]: images/screenshot.png
234
+ [Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
235
+ [Next-url]: https://nextjs.org/
236
+ [React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
237
+ [React-url]: https://reactjs.org/
238
+ [Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
239
+ [Vue-url]: https://vuejs.org/
240
+ [Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
241
+ [Angular-url]: https://angular.io/
242
+ [Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
243
+ [Svelte-url]: https://svelte.dev/
244
+ [Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
245
+ [Laravel-url]: https://laravel.com
246
+ [Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
247
+ [Bootstrap-url]: https://getbootstrap.com
248
+ [JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
249
+ [JQuery-url]: https://jquery.com
250
+ [Python]: https://img.shields.io/badge/python-000000?style=for-the-badge&logo=python&logoColor=white
251
+ [Python-url]: https://python.org/
252
+ [dacite]: https://img.shields.io/badge/dacite-20232A?style=for-the-badge&logo=github&logoColor=61DAFB
253
+ [dacite-url]: https://github.com/konradhalas/dacite
254
+ [requests]: https://img.shields.io/badge/requests-35495E?style=for-the-badge&logo=github&logoColor=4FC08D
255
+ [requests-url]: https://github.com/psf/requests
@@ -0,0 +1,10 @@
1
+ n2yo/__init__.py,sha256=uZp9NRDAZK9M8vmAV-nz1_rD10Iis7jdRweNKM6P1xQ,119
2
+ n2yo/exceptions.py,sha256=W61iNM2utXJ3twxlqlGF8insKISsoKd-J3jvLMzL6uA,40
3
+ n2yo/n2yo.py,sha256=JZjoawa_NGxI9OAxUVXr7NcwwzK9cmsi22NWGa188S4,12182
4
+ n2yo/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ n2yo/models/search.py,sha256=2WMBbBlARzw-oqursCh1v0gmVgMvgne59OOzdg2cUlQ,4883
6
+ n2yo_api_wrapper-0.0.1.dist-info/LICENSE.txt,sha256=KrOVT7b9AFqez4zOs87D00B6dTAQCoeA_-4BXsJw5k0,1063
7
+ n2yo_api_wrapper-0.0.1.dist-info/METADATA,sha256=0k2tUZQkEiuLW4u6biE7_BlIGiA3ekp45NJjU9jzjlQ,9332
8
+ n2yo_api_wrapper-0.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
+ n2yo_api_wrapper-0.0.1.dist-info/top_level.txt,sha256=SzJLCYGYdl8bqgadcbj6EAqoadsVsYxc4UX0VEXWFGw,5
10
+ n2yo_api_wrapper-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.45.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ n2yo