예제 #1
0
파일: scrape.py 프로젝트: beejhuff/mtg_data
import argparse
import os
import yaml

import eri.logging as logging

import cards
import common
import scgdecks

# ----------------------------- #
#   Module Constants            #
# ----------------------------- #

# logging and file IO constants
logging.getLogger("requests").setLevel(logging.WARNING)
logger = logging.getLogger("scrape")
logging.configure()

# ----------------------------- #
#   Main routine                #
# ----------------------------- #


def main(decksrc='scg', neo4jurl=common.NEO4J_URL):
    """do ery ol thang

    args:
        decksrc: string, the source of deck database elements we should parse
            into json for loading into our neo4j database. currently, only
            "scg" is a supported option (default: scg)
Usage:
    <usage>

"""

import chartkick
import eri.logging as logging

from flask import Blueprint
from .roger_plotz import app

# ----------------------------- #
#   Module Constants            #
# ----------------------------- #

logger = logging.getLogger(__name__)
logging.configure()

# ----------------------------- #
#   Main routine                #
# ----------------------------- #

# chartkick requires some additional configuration (registering the location
# of the chartkick javascript folder, as well as importing and extension)
ck = Blueprint('ck_page',
               __name__,
               static_folder=chartkick.js(),
               static_url_path='/static')
app.register_blueprint(ck, url_prefix='/ck')
app.jinja_env.add_extension("chartkick.ext.charts")
예제 #3
0
"""

import argparse
import os

import eri.logging as logging
import hug
import jinja2


# ----------------------------- #
#   Module Constants            #
# ----------------------------- #

logger = logging.getLogger(__name__)
logging.configure()

html = hug.get(output=hug.output_format.html)

HERE = os.path.dirname(os.path.realpath(__file__))
TEMP_DIR = os.path.join(HERE, 'templates')
JINJA_ENV = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMP_DIR))


# ----------------------------- #
#   routes                      #
# ----------------------------- #

@hug.cli()
@hug.get(examples='name=Zach&age=31')
예제 #4
0
import os
import yaml

import eri.logging as logging

import cards
import common
import scgdecks


# ----------------------------- #
#   Module Constants            #
# ----------------------------- #

# logging and file IO constants
logging.getLogger("requests").setLevel(logging.WARNING)
logger = logging.getLogger("scrape")
logging.configure()


# ----------------------------- #
#   Main routine                #
# ----------------------------- #

def main(decksrc='scg', neo4jurl=common.NEO4J_URL):
    """do ery ol thang

    args:
        decksrc: string, the source of deck database elements we should parse
            into json for loading into our neo4j database. currently, only
            "scg" is a supported option (default: scg)