Skip to main content

FlyThings Client

Getting Started

To use this client is necesary:

  • Install Python (>=2.7, !=3.0., !=3.1., !=3.2., !=3.3)
  • Install pip
  • To Install our library:
    $ pip install flythings   

And now start to test the flythings clients.

Documentation

Configuration File

The general properties configuration in Configuration.properties:

  • user: (Optional) user email or identifier to login on the system.
  • password: (Optional) the user password to login, is not recommended use this configuration.
  • server: (Optional, Default beta.flythings.io/api) configure the server url to insert the data.
  • token: (Optional) the user token to send data into flythings plataform.
  • device: (Optional) the device which sends data.
  • sensor: (Optional) the sensor wich sends data.
  • login_type: (Optional) type of login to use.
  • timeout: (Optional) request timeout in seconds.
  • authorization: (Optional) authorization token.
  • Example of configuration file
    SERVER:beta.flythings.io/api  
    USER:<put your username here>  
    PASSWORD:<put your password here>  
    DEVICE:Python  
    SENSOR:Client  
    LOGIN_TYPE:USER or DEVICE
    TIMEOUT: 1000
    AUTHORIZATION: <put your token here>   

To load the data from the file call this function:

  • load_data_by_file(String file)
    Description: Loads data from the file.
    Return: Nothing.

Examples:

  • Loads config data from a file.
    </code></pre>
    </li>
    </ul>
    <p>You can also introduce this general properties using the library methods.</p>
    <h3><a href="#user-content-general-module-configuration-methods" aria-hidden="true" class="anchor" id="user-content-general-module-configuration-methods"></a>General Module Configuration Methods</h3>
    <ul>
    <li>
    <p><strong>set_server</strong>(String server)<br />
    <strong>Description</strong>: Sets the server to which the requests will be sent.<br />
    <strong>Return</strong>: Returns a string representing the server.</p>
    </li>
    <li>
    <p><strong>set_device</strong>(String device, (Optional) object=None, always_update=False)<br />
    <strong>Params</strong>:</p>
    <ul>
    <li>device: (Mandatory) Device name.</li>
    <li>object: (Optional) Object with extra device params.</li>
    <li>always_update: (Optional) Indicates if must send a request to create/update the device.
    <pre><code class="language-PYTHON">  object = {
        "type": "CUSTOM",
        "geom": {
        "type": "Point",
        "crs": "4326",
        "coordinates": [
        -19.323204, 27.611808
        ]
      } }
    

Description: Sets the device of the observation. Uses a file named .foiCache to get a fast access to most used devices.
Return: Returns a string representing the device.

  • set_sensor(String sensor)
    Description: Sets the sensor of the observation.
    Return: Returns a string representing the sensor.

  • set_token(String token)
    Description: Sets the x-auth-token to authenticate into the server.
    Return: Returns a string representing the token.

  • set_worskapce(Long workspace)
    Description: Sets user workspace
    Return: Returns the user workspace

  • set_custom_header(String header, String header_value)
    Description: Sets a custom header for server requests.
    Return: Returns a string representing the header.

  • get_headers(String header, String header_value)
    Description: Return current headers.
    Return: Return current headers.

  • set_timeout(int timeout)
    Description: Sets the timeout value in seconds to the server requests.
    Return: Returns an integer representing the timeout.

  • login(String user, String password, String login_type ['USER' or 'DEVICE'])
    Description: Authenticate against the server.
    Return: Returns a string representing the token or None if login fails.

  • logout() Description: Logout against the server.
    Return: Returns None.

  • set_authorization_token(token) Description: Sets bearer token on authorization hearer. Return: returns the authorization header value.

  • Modules documentation

    Tests

    In the test folder, after fill in the Configuration.Properties file write on bash:

        nosetests flythingsTest.py  
    

    (Nose python library is needed)

    Change log

    License

    Developed by ITG

    Release files for flythings 2.2.8

    For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

    Source distribution (sdist)

    Source distribution for flythings 2.2.8
    File Size Uploaded
    flythings-2.2.8.zip 29.1 kB Details

    Release files / flythings-2.2.8.zip

    Download URL flythings-2.2.8.zip
    Size 29.1 kB
    Tags Source
    SHA-256 checksum
    How to use checksums
    a23948f936c8ae406efddf647359f2a6901b647cf8e8246f12b5055dce8a36c3
    BLAKE2b-256 checksum
    How to use checksums
    af842ce53fcdaa9f7753e6ed0c5809dea823af4b42bfad48356bd9f03a421754
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/4.0.2 CPython/3.11.4

    Release history Release notifications | RSS feed

    This release

    2.2.8 This release

    1 release file

    2.2.7

    1 release file

    2.2.6

    1 release file

    2.2.5

    1 release file

    2.2.4

    1 release file

    2.2.3

    1 release file

    2.2.2

    1 release file

    2.2.1

    1 release file

    2.2.0

    1 release file

    2.1.1

    1 release file

    2.1.0

    1 release file

    2.0.2

    1 release file

    2.0.1

    1 release file

    2.0.0

    1 release file

    1.4.15

    1 release file

    1.4.14

    1 release file

    1.4.13

    1 release file

    1.4.12

    1 release file

    1.4.11

    1 release file

    1.4.10

    1 release file

    1.4.9

    1 release file

    1.4.8

    1 release file

    1.4.7

    1 release file

    1.4.6

    1 release file

    1.4.5

    1 release file

    1.4.3

    1 release file

    1.4.2

    1 release file

    1.4.1

    1 release file

    1.4.0

    1 release file

    1.3.0

    1 release file

    1.2.3

    1 release file

    1.2.2

    1 release file

    1.2.0

    1 release file

    1.1.0

    1 release file

    1.0.1

    1 release file

    1.0.0

    1 release file

    0.9.8.2

    1 release file

    0.9.7

    1 release file

    0.9.6

    1 release file

    0.9.5

    1 release file

    0.9.4

    1 release file

    0.9.3

    1 release file

    0.9.1

    1 release file

    0.9.0

    1 release file

    0.8.0

    1 release file

    0.7

    1 release file

    0.6.1

    1 release file

    0.6

    1 release file

    0.5

    1 release file

    Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page