Skip to main content

Fleetmon API wrapper for ship data

Project description

Fleetmonger

Python wrapper for the fleetmon.com ship-tracking API.

API Calls

Read the details of the API at Fleetmonger. * fleetmonger.myfleet * fleetmonger.vessel * fleetmonger.vesselparticulars * fleetmonger.vesselurl * fleetmonger.porturl * fleetmonger.weather * fleetmonger.containerschedule

Note that some API calls require the purchase of credits at Fleetmon. This package is unaffiliated with Fleetmon, use at your own risk.

Usage

from fleetmonger import Fleetmonger

fm = Fleetmonger('username', 'your key')

fleet = fm.myfleet()

for ship in fleet:
    print ship.name, ship.destination

Vessels

my_vessel = fleet[0]
# or
my_vessel = fm.vessel(mmsi='239725000')
# or
my_vessel = fm.vessel(imo='9197545')
# or
my_vessel = fm.vessel(name='MINNOW')

# Passing incomplete information will raise an error
my_vessel = fm.vessel()
# ValueError

my_vessel.name
# <SS MINNOW>

my_vessel.navigationstatus
# 'On a three hour tour'

my_vessel.etatime
# datetime.datetime(1964, 9, 26, 12, 0, tzinfo=<UTC>)

my_vessel.coords
# (3.469557, -167.255859)

# Missing attributes return None
my_vessel.location
# None

my_vessel.flag
# 'United States'

my_vessel.flag_so
# 'US'

# Some vessels have photos
myvessel.photos
# ["//img1.fleetmon.com/thumbnails/MINNOW_1.220x146.jpg", "//img1.fleetmon.com/thumbnails/MINNOW_2.570x1140.jpg"]

Minimum list of Vessel attributes:

coords (lat, lon), course, destination, draught, etatime, flag, heading, imo, last_port, latitude, location, longitude, mmsi, name, navigationstatus, photos, positionreceived, publicurl, speed, type

Ports

my_vessel.last_port
# <fleetmonger.port.Port object>

port = my_vessel.last_port

port.name
# 'Honolulu, HI'

port.duration
# datetime.timedelta(...)

Port urls and Vessel urls

Pass mmsi, imo or name to vessel methods. Pass locode or name to port methods.

fm.vesselurl(name='MINNOW')

fm.porturl(locode='USLAX')

# Porturl also takes an optional country isocode parameter
fm.porturl(name='new', country='US')
# [<Newark (New York)>, <Newburgh>, <Newburyport>, <Newport (OR)>]

Weather at Location

fm.weather(lat=3.469557, lon=-167.255859)

# You can also pass a vessel object to the weather call
fm.weather(vessel=my_vessel)

Parameters

In general, the parameters that Fleetmonger expects match those of the Fleetmon API, with the following exceptions:

instead of mmsinumber, use mmsi
...        imonumber   ... imo
...        q           ... name

Project details


Download files

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

Source Distribution

fleetmonger-0.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

fleetmonger-0.0.2-py2-none-any.whl (9.1 kB view details)

Uploaded Python 2

File details

Details for the file fleetmonger-0.0.2.tar.gz.

File metadata

  • Download URL: fleetmonger-0.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fleetmonger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6ab9d27f641cb5ca341c904a72325ff93a26bf1e74231aa478eefa22c5784870
MD5 928032a9b44b2552f6a36f4bf10e96d6
BLAKE2b-256 d5a31db934156942a8f3a432b92bc6ea049999ae44b93ccde4b7d84612d83e9b

See more details on using hashes here.

File details

Details for the file fleetmonger-0.0.2-py2-none-any.whl.

File metadata

File hashes

Hashes for fleetmonger-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 22ac9792a47036a96287c0f4d0a0c36a6eff96db9c21436321a91d21a3f6a06b
MD5 521622b53789c8b22a5aba50d1178128
BLAKE2b-256 28d96c76d7a9739d3a7a2168bee8936ca498c2ec06b49cdf9cfdb6516a3e4ca5

See more details on using hashes here.

Supported by

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