Giter VIP home page Giter VIP logo

py-pnet's Introduction

py-pnet

A reusable client for the Phish.net API, written in Python3

Authors:Neal Duncan
Version:0.1.0

A Brief Overview

The reason this library is referred to as a 'client' as opposed to a script or wrapper, is that you import the module, then create a reusable client object. The client object has a few methods for making the actual API calls. This really becomes useful when you need to populate an array with the results from multiple API calls.

Quick-Start

'''The first thing you must do, as with most Python libraries, is import the required objects. With this library, there's actually only one object (so far), so you'll just import that'''



from py_pnet import PnetClient



'''Following the import, the only set-up you need to do before using the client is to create the client object. The constructor for ::class::PnetClient takes your API key as a keyword argument. The default value for ::kwarg::apikey is None. If you leave it as None, the client will still work, but will only be able to get responses from public API methods that phish.net makes available. To gain access to the private API methods, you'll need to supply you API key.'''



pnet = PnetClient(apikey='yourapikey')



'''From there, you're ready to make the individual API calls. In this example, we're going to make a simple GET request. When calling one of the client's methods, there are 4 arguments the function will take, only one of which is required. The required argument is the ::arg::query_method, which refers to the API methods made available by phish.net. With most of the API methods, there is an available field for a value for the API method being used. There is also a way to filter those results. We'll keep it simple and just fulfill the lone required argument in this example'''



response = pnet.get(pnet.shows.query)



'''The new ::variable::response contains the entire response object return by the API call. You may use it however your needs dictate.'''

For a list of all available API methods, please visit api.phish.net.

py-pnet's People

Contributors

ndun4 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.