https://github.com/jktujg/aero-svo-api
https://github.com/jktujg/aero-svo-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jktujg/aero-svo-api
- Owner: jktujg
- License: mit
- Created: 2024-03-11T11:12:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-13T09:27:53.000Z (about 1 year ago)
- Last Synced: 2024-04-12T20:48:55.093Z (about 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ipynb
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": [
"# aero-svo-api \n",
"Unofficial Sheremetyevo International Airport [website](https://www.svo.aero/ru/main) API wrapper \n",
"\n",
"* Sync/Async usage\n",
"* Pydantic models as a result\n"
],
"id": "352d9e828584d02e"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"## Installation\n",
"```commandline\n",
"pip install aero-svo-api\n",
"```\n",
"## Available methods\n",
"* `get_schedule` - List of flights for arrival/departure direction in a time range \n",
"* `get_flight` - Current flight details by its ID \n",
"\n",
"## Usage example"
],
"id": "ae08ae975aa3f74a"
},
{
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true
},
"source": [
"from datetime import datetime, timedelta\n",
"from aero_svo_api import SvoAPI\n",
"\n",
"# each *API instance creates own session with first request if session not provided in constructor\n",
"# by default: request.Session for SvoAPI and aiohttp.ClientSession for AsyncSvoAPI\n",
"\n",
"svo_api = SvoAPI()\n",
"\n",
"schedule = svo_api.get_schedule(\n",
" direction='departure',\n",
" date_start=datetime.now(),\n",
" date_end=datetime.now() + timedelta(hours=3),\n",
" # additional parameters (e.g. headers, cookies, ...) forwards to session request\n",
" headers={'User-Agent': 'Custom user-agent'}\n",
")"
],
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"cell_type": "markdown",
"source": "",
"id": "efc6b7a0b9471f34"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}