This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

About

APIs usually require access tokens to limit frequencies of requests.

If you want to request over limitations, you need to generate multiple tokens and roop over them.

Capybara is a simple wrapper for multiple tokens.

Send Pull Requests on GitHub to add available services!

Dependencies

Installation

pip install capybara

or

pip install git+https@github.com:AkihikoITOH/capybara.git

Available Services

Amazon

Wrapper of Amazon Product Advertising API.

楽天

Wrapper of 楽天商品検索API.

Usage

As a Python module

import capybara

c = capybara.Capybara(config_dir='/path/to/config/', tokens_dir='/path/to/tokens/')

# Amazon
result = c.get(service='amazon', item='B005CSYH5Y')
print result['raw']
print result['title']
print result['category']

# 楽天
result = c.get(service='rakuten', item='urutoragion:10000866')
print result['raw']
print result['title']
print result['url']
print result['category_id']
print result['category']

Setup

anywhere/you/like
   ├── config
   │   ├── amazon_config.json
   │   └── rakuten_config.json
   └── tokens
       ├── amazon_tokens.tsv
       └── rakuten_tokens.tsv

config directory

Set access frequency or other configurations in JSON format for each service.

attribute type description example
interval integer interval time between requests per token (in milli second) 1000
slow float extension ratio of interval 1.2

path/to/config/sample_config.json

{
    "interval": 1000,
    "slow": 1.2
}

Note: Attributes must be in lower cases and “double quoted”.

Note

  • Actual interval time per token will be [interval]*[slow]
  • Thus actual access frequency(per hour) will be [# of tokens]*3600/[interval]*[slow]

tokens directory

List access tokens and other required parameters in TSV format for each service.

See Product Advertising API to get new access tokens.

Amazon

parameter description
ACCESS_KEY access key
SECRET_KEY secret key
ASSOC_TAG associate tag
LOCALE locale

path/to/tokens/amazon_tokens.tsv

ACCESS_KEY1 SECRET_KEY1 ASSOC_TAG1  LOCALE
ACCESS_KEY2 SECRET_KEY2 ASSOC_TAG2  LOCALE
ACCESS_KEY3 SECRET_KEY3 ASSOC_TAG3  LOCALE
ACCESS_KEY4 SECRET_KEY4 ASSOC_TAG4  LOCALE

楽天

See 楽天商品検索API to get new access tokens.

parameter description
applicationId application id

lib/tokens/rakuten_tokens.tsv

applicationId1
applicationId2
applicationId3
applicationId4

License

Copyright &copy 2015 ITOH Akihiko

See LICENSE for details.

Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
capybara-0.2.0-py2.py3-none-any.whl (12.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 8, 2015
capybara-0.2.0.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Jun 8, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting