예제 #1
0
# Lob Python Library

__version__ = '1.0'
__author__ = 'Siddharth Saha ([email protected])'

# Imports
import logging
import importer
from exceptions import *

json = importer.import_json()
_httplib, httplib = importer.import_requests()

log = logging.getLogger('lob')

# Could be set globally
api_key = None

class LobRequestor(object):
    _api_base_url = 'https://api.lob.com/v1/'
    _api_key = None
    
    # Define the method function map - TODO: have to do for urlfetch
    _method_fn_map = {
            'GET' : httplib.get,
            'POST' : httplib.post,
            'PUT' : httplib.put,
            'HEAD' : httplib.head,
            'DELETE' : httplib.delete
            }
예제 #2
0
  from setuptools import setup
except ImportError:
  from distutils.core import setup

# Don't import clever module here, since deps may not be installed
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'clever'))
import importer
import version

path, script = os.path.split(sys.argv[0])
os.chdir(os.path.abspath(path))

# Get simplejson if we don't already have json
install_requires = ['requests >= 0.8.8']
try:
  importer.import_json()
except ImportError:
  install_requires.append('simplejson')

try:
  import json
  _json_loaded = hasattr(json, 'loads')
except ImportError:
  pass

setup(name='clever',
      version=version.VERSION,
      description='Clever Python bindings',
      author='Clever',
      author_email='*****@*****.**',
      url='https://clever.com/',
예제 #3
0
# Lob Python Library

__version__ = '1.0'
__author__ = 'Siddharth Saha ([email protected])'

# Imports
import logging
import importer
from exceptions import (APIError, APIConnectionError, InvalidRequestError,
                        AuthenticationError)

json = importer.import_json()
_httplib, httplib = importer.import_requests()

log = logging.getLogger('lob')

# Could be set globally
api_key = None


class LobRequestor(object):
    _api_base_url = 'https://api.lob.com/v1/'
    _api_key = None

    # Define the method function map - TODO: have to do for urlfetch
    _method_fn_map = {
        'GET': httplib.get,
        'POST': httplib.post,
        'PUT': httplib.put,
        'HEAD': httplib.head,
        'DELETE': httplib.delete
예제 #4
0
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'easypost'))
import importer
import version

path, script = os.path.split(sys.argv[0])
os.chdir(os.path.abspath(path))

# Get simplejson if we don't already have json
install_requires = ['requests >= 1.0.0', 'six']
try:
    importer.import_json()
except ImportError:
    install_requires.append('simplejson')

try:
    import json
    _json_loaded = hasattr(json, 'loads')
except ImportError:
    pass

setup(name='easypost',
      version=version.VERSION,
      description='EasyPost Shipping API Client Library for Python',
      author='Sawyer Bateman',
      author_email='*****@*****.**',
      url='https://easypost.com/',