Skip to main content

PRSW, the Python RIPE Stat Wrapper, is a python package that simplifies access to the RIPE Stat public data API.

Project description

Latest Version Supported Python Versions GitHub Actions Tests Coveralls Documentation Status

PRSW, the RIPE Stat Wrapper, is a Python package that allows for simple access to the RIPEstat Data API.

Installation

PRSW is supported on Python 3.7+ and can be installed via pip.

pip install prsw

To install the latest development version run the following instead:

pip install --upgrade https://github.com/jvoss/prsw/archive/master.zip

Quickstart

RIPEstat can be instantiated with a few options. For details see the documentation at https://prsw.readthedocs.io.

To instantiate a basic instance of RIPEstat:

import prsw

ripe = prsw.RIPEstat()

With the ripe instance you can interact with the RIPEstat API:

# Find all announced prefixes for a Autonomous System
prefixes = ripe.announced_prefixes(3333)

# Interact with the looking glass
for collector in ripe.looking_glass('140.78.0.0/16'):
  print(collector.location)

  for peer in collector.peers:
      print(
          peer.asn_origin,
          peer.as_path,
          peer.community,
          peer.last_update,
          peer.prefix,
          peer.peer,
          peer.origin,
          peer.next_hop,
          peer.latest_time
      )

# Check RPKI validation status
print(ripe.rpki_validation_status(3333, '193.0.0.0/21').status)

Please see the documentation for more options.

Contributing

Contributions are encouraged. Please see CONTRIBUTING for details.

Acknowledgements

Inspiration for several elements of this project came from PRAW, the Python Reddit API Wrapper.

License

PRSW is licened under the Simplified BSD License.

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

prsw-0.3.1.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

prsw-0.3.1-py3-none-any.whl (24.8 kB view hashes)

Uploaded Python 3

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