Skip to main content

Python library for parse, save and work with Wialon and EGTS data

Project description

gpswe

gpswe - this module is a Python client library for work with GPS Trackers (Wialon IPS, EGTS)

Installation

Install the current version with PyPI:

pip install gpswe

Usage

First fill in the module Settings with your data

from gpswe.config.settings import settings as gpswe_settings

#The port on which the server will be started
gpswe_settings.PORT = 10500
#The host on which the server will be started
gpswe_settings.HOST = "0.0.0.0"
#Supported version of WialonIPS
gpswe_settings.WIALON_PROTOCOL_VERSION = "2.0"
#Host where the database is deployed
gpswe_settings.POSTGRES_HOST = "0.0.0.0"
#The port on which the database is deployed
gpswe_settings.POSTGRES_PORT = 5432
#The name of the database itself
gpswe_settings.POSTGRES_DB = "gpswe"
#The user's name to connect to the database
gpswe_settings.POSTGRES_USER = "test_user"
#The user's password to connect to the database
gpswe_settings.POSTGRES_PASSWORD = "123"

Next, you need to "initialize" your database (create all the necessary libraries in it)

from gpswe.gps_server import init_db

init_db()

OK, now you can start the server

from gpswe.gps_server import start_server

start_server()

To get extended information about your data, you need to use the method get_coordinates (imei, from_datetime, to_datetime), where "imei" is the id of your tracker from which the data comes, "from_datetime" and "to_datetime" are the time interval in which you want to receive the data

import datetime
from gpswe.gps_server import get_coordinates

data = get_coordinates(
    imei="1231233123", 
    from_datetime=datetime.datetime(2022, 5, 15), 
    to_datetime=datetime.datetime(2024, 5, 25)
)

The data comes in json format

{
  "speed": 20.0, 
  "distance": 248.4, 
  "coordinates": [
    {
      "latitude": 61.2296333, 
      "longitude": 50.8259626
    }, 
    {
      "latitude": 63.4578954564, 
      "longitude": 50.87545689874458
    }
  ]
}

speed - average speed over a period of time
distance - distance traveled
coordinates - coordinates with latitude and longitude

All messages will be written to the console via the standard logging python library

Contributing

Bug reports and/or pull requests are welcome

License

The module is available as open source under the terms of the The MIT License (MIT)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpswe-0.0.4-py3.10.egg (7.7 kB view details)

Uploaded Egg

File details

Details for the file gpswe-0.0.4-py3.10.egg.

File metadata

  • Download URL: gpswe-0.0.4-py3.10.egg
  • Upload date:
  • Size: 7.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for gpswe-0.0.4-py3.10.egg
Algorithm Hash digest
SHA256 241d259984b8fcdc731957e8e315ba3565f806504279390be6b3d7bbfd18b3ef
MD5 952d2303a2a8c75bc60322a72cae41f6
BLAKE2b-256 96f374ea2be51db138a94c514abe29cbd08bed68c3e1107bf0e9ce8cd63fffc3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page