-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
740 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import requests | ||
import argparse | ||
|
||
def get_catalogs(token): | ||
def get_catalogs(token, page): | ||
headers = { | ||
'Authorization': f'Token {token}' | ||
} | ||
api_url = "https://bh-tom2.astrolabs.pl/calibration/get-catalogs/" | ||
api_url = f'https://bh-tom2.astrolabs.pl/calibration/get-catalogs/?page={page}', | ||
response = requests.get(api_url, headers=headers) | ||
print(response.json()) | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Retrieve catalogs from the BHTOM2 API") | ||
parser.add_argument("token", type=str, help="Authentication token") | ||
parser.add_argument("page", type=int, help="Page") | ||
|
||
args = parser.parse_args() | ||
|
||
get_catalogs(args.token) | ||
get_catalogs(args.token, args.page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.