rudimk / PyPplAPI

A Python wrapper around pplapi | http://pplapi.com
MIT License
1 stars 1 forks source link

Refactoring to support all API endpoints #4

Open sudhirmishra opened 7 years ago

sudhirmishra commented 7 years ago

Background

Going through the API documentation, following are the REST APIs endpoints supported by PplApi,

  1. GET /(int: id).json
  2. GET /random.json
  3. GET /country/(string: country_code)/random.json
  4. GET /batch/(int: quantity)/sample.json
  5. GET /batch/(int: quantity)/country/(string: country_code)/sample.json
  6. GET /metrics.json

Proposition

Three functions,

Here,

class Agent:
    #Agent attributes like
    age
    country_name
    country_tld
    date_of_birth
    id
    id_str
    income
    internet
    language
    religion
    sex
    __str__(self)
    __parse_response(self)

class Metric:
    checksum_agent_space
    checksum_algorithm
    checksum_parameters
    database_size
    population
    __str__(self)
    __parse_response(self)
rudimk commented 7 years ago

Sorry, got real busy with some other stuff. So this looks real good. I think I'd like to keep aside an entire day to code this up, and that's either going to be Thursday or Saturday. Also want to set up some basic tests as well as Travis CI integration - will tackle everything in one go.

Thanks! :)