Coder Social home page Coder Social logo

fcomuniz / opensky-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openskynetwork/opensky-api

0.0 1.0 0.0 243 KB

Python and Java bindings for the OpenSky Network REST API

License: GNU General Public License v3.0

Java 68.10% Python 31.90%

opensky-api's Introduction

The official OpenSky Network API

This repository contains API client implementations for the OpenSky Network in Python and Java as well as the sources for the documentation. By using the OpenSky API, you agree with our terms of use.

Python API

Installation

sudo python setup.py install

or with pip (recommended)

pip install -e /path/to/repository/python

Usage

from opensky_api import OpenSkyApi
api = OpenSkyApi()
s = api.get_states()
print(s)

will output something like this:

{
  'states': [
    StateVector(dict_values(['c04049', '', 'Canada', 1507203246, 1507203249, -81.126, 37.774, 10980.42, False, 245.93, 186.49, 0.33, None, 10972.8, None, False, 0])),
    StateVector(dict_values(['4240eb', 'UTA716  ', 'United Kingdom', 1507202967, 1507202981, 37.4429, 55.6265, 609.6, True, 92.52, 281.87, -3.25, None, None, '4325', False, 0])),
    StateVector(dict_values(['aa8c39', 'UAL534  ', 'United States', 1507203250, 1507203250, -118.0869, 33.8656, 1760.22, False, 111.31, 343.07, -5.2, None, 1752.6, '2643', False, 0])),
    StateVector(dict_values(['7800ed', 'CES5124 ', 'China', 1507203250, 1507203250, 116.8199, 40.2763, 3459.48, False, 181.88, 84.64, 11.7, None, 3566.16, '5632', False, 0])),...
  ],
  'time': 1507203250
}

Java API

  • Maven project (not yet in a public repository)
  • Uses OkHttp for HTTP requests

Installation

For usage with Maven

mvn clean install

Add the following dependency to your project

<dependency>
    <groupId>org.opensky</groupId>
    <artifactId>opensky-api</artifactId>
    <version>1.3.0</version>
</dependency>

Usage

OpenSkyStates states = new OpenSkyApi().getStates(0);
System.out.println("Number of states: " + states.getStates().size());

Using the API within Android Apps

Build and install the OpenSky API in your local repository as described above. You can use it within your Android App by telling gradle to lookup the local repository and adding the dependencies.

In build.gradle, add the following lines

dependencies {
    /* do not delete the other entries, just add this one */
    compile 'org.opensky:opensky-api:1.3.0'
}

repositories {
    mavenLocal()
    mavenCentral()
}

Also note, that you need the INTERNET permission in your manifest to use the API.

Running behind a Proxy

If you need to use a proxy server, set the http.proxyHost and http.proxyPort flags when starting your application:

java -Dhttp.proxyHost=10.0.0.10 -Dhttp.proxyPort=9090 ...

Resources

opensky-api's People

Contributors

fixje avatar affitz avatar masorx avatar dependabot[bot] avatar mrksngl avatar fabland avatar seants avatar it-berater avatar jaluebbe avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.