Skip to main content

Fetch satellite TLEs from various online sources

Project description

The python package satellitetle provides functions to fetch TLEs from various online sources (currently CelesTrak (SatNOGS), CalPoly and AMSAT) and allows using custom ones or Space-Track.org.

It was forked from the python package orbit.

Usage

Fetch TLEs for a single satellite from Celestrak:

from satellite_tle import fetch_tle_from_celestrak

norad_id_iss = 25544 # ISS (ZARYA)
print(fetch_tle_from_celestrak(norad_id_iss))

Fetch a large set of TLEs for a list of satllites from all available sources:

from satellite_tle import fetch_all_tles, fetch_latest_tles
norad_ids = [25544, # ISS (ZARYA)
             48274, # CSS (Tianhe)
             40043] # TIGRISAT

# Uses default sources and compares TLE set from each source and
# returns the latest one for each satellite
tles = fetch_latest_tles(norad_ids)

for norad_id, (source, tle) in tles.items():
    print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

# Uses default sources and returns the TLE sets from all source for
# each satellite
tles = fetch_all_tles(norad_ids)

for norad_id, tle_list in tles.items():
    for source, tle in tle_list:
        print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

# Defines custom sources
sources = [
    ('CalPoly','http://mstl.atl.calpoly.edu/~ops/keps/kepler.txt'),
    ('Celestrak (active)','https://celestrak.org/NORAD/elements/active.txt')
]

# Uses custom sources (fetch_all_tles can also be used with the same
# parameters)
tles = fetch_latest_tles(norad_ids, sources=sources)

for norad_id, (source, tle) in tles.items():
    print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

spacetrack_config= {
    'identity': 'my_username',
    'password': 'my_secret_password'
}

# Uses default sources and Space-Track.org (fetch_all_tles can also
# be used with the same parameters)
tles = fetch_latest_tles(norad_ids, spacetrack_config=spacetrack_config)

for norad_id, (source, tle) in tles.items():
    print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

# Uses only Space-Track.org (fetch_all_tles can also be used with the
# same parameters)
tles = fetch_latest_tles(norad_ids, sources=[], spacetrack_config=spacetrack_config)

for norad_id, (source, tle) in tles.items():
    print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

# Uses custom sources and Space-Track.org (fetch_all_tles can also be
# used with the same parameters)
tles = fetch_latest_tles(norad_ids, sources=sources, spacetrack_config=spacetrack_config)

for norad_id, (source, tle) in tles.items():
    print('{:5d} {:23s}: {:23s}'.format(norad_id, tle[0], source))

NOTE: fetch_latest_tles and fetch_all_tles download the TLE sets from all known sources, so they should only be used when fetching TLEs for a large set of satellites.

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 Distribution

satellitetle-0.17.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

satellitetle-0.17.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file satellitetle-0.17.0.tar.gz.

File metadata

  • Download URL: satellitetle-0.17.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.12.0 requests/2.32.3 setuptools/75.8.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.9.12

File hashes

Hashes for satellitetle-0.17.0.tar.gz
Algorithm Hash digest
SHA256 1dc75180aeb782e71001d3ec953e189dc516b4c14b8c6bb16ebd77f12661f189
MD5 c83ee6e6c02adf270a2feed8024e0964
BLAKE2b-256 223a4e7be364eac4e3b0604412a87f8d8fda7bb755e75d510df52940f72441a7

See more details on using hashes here.

File details

Details for the file satellitetle-0.17.0-py3-none-any.whl.

File metadata

  • Download URL: satellitetle-0.17.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.12.0 requests/2.32.3 setuptools/75.8.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.9.12

File hashes

Hashes for satellitetle-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23980711cc967b4d952989a15177c93b82bd36b31ff4dc6394914a341724e272
MD5 8d78d4a04b450fb0d98a73574af57112
BLAKE2b-256 533317ba4e6fcd9a0a847c877d615ef61f16ed7c700a41729debd6bb0e623d94

See more details on using hashes here.

Supported by

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