PRSW, the RIPE Stat Wrapper, is a Python package that allows for simple access to the RIPEstat Data API.
RIPEstat can be instantiated with a few options. For details see the documentation.
- Instantiate a basic instance of RIPEstat:
import prsw
ripe = prsw.RIPEstat()- With the
ripeinstance you can interact with the RIPEstat API as python objects:
# 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.
pip install prsw
Install the latest development version:
pip install --upgrade https://github.com/jvoss/prsw/archive/master.zip
uv add prsw
Install the latest development version:
uv add git+https://github.com/jvoss/prsw.git
Contributions are encouraged. Please see CONTRIBUTING.md for details.
Inspiration for several elements of this project originally came from PRAW, the Python Reddit API Wrapper.
PRSW is licensed under the Simplified BSD License.