index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
54,024 | tylhhh/API_qianchengdai | refs/heads/master | /扩展学习/04_request请求操作.py | import requests
# url = "http://api.lemonban.com/futureloan/member/login"
# data = {"mobile_phone":"18600001112","pwd":"123456789"}
# headers = {"X-Lemonban-Media-Type": "lemonban.v2","Content-Type":"application/json"}
# resp = requests.post(url, json=data, headers=headers)
# # 响应状态码
# print(resp.status_code)
# # 响应头
#... | {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,025 | tylhhh/API_qianchengdai | refs/heads/master | /TestCases/test_update_name.py | import unittest
import json
from Common.handle_excel import HandleExcel
from Common.myddt import ddt,data
from Common.handle_path import datas_dir
from Common.handle_log import logger
from Common.handle_requests import send_requests
from Common.handle_data import replace_case_by_regular,EnvData,clear_EnvData_atts
from ... | {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,026 | tylhhh/API_qianchengdai | refs/heads/master | /扩展学习/07_动态设置类属性.py | """
反射:指通过“字符串”对 对象的属性和方法进行操作(查找/获取/删除/添加)
反射常常用在动态加载的模块中
hasattr:通过“字符串”判断对象的属性或方法是否存在
getattr:通过“字符串”获取对象的属性或方法
setattr:通过“字符串”设置对象的属性或方法
delattr:通过“字符串”删除对象的属性或方法
"""
class AAA:
name = "小明"
pass
s = AAA()
setattr(s, "age", 18)
setattr(s, "name", "哈哈哈")
setattr(AAA,"age", 20)
print(getattr(s, "age"))
print(... | {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,027 | tylhhh/API_qianchengdai | refs/heads/master | /main.py | import unittest
from BeautifulReport import BeautifulReport
from Common.handle_path import cases_dir,reports_dir
s = unittest.TestLoader().discover(cases_dir)
br = BeautifulReport(s)
br.report("前程贷接口自动化测试报告","report_html",reports_dir)
| {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,028 | tylhhh/API_qianchengdai | refs/heads/master | /扩展学习/12_随机生成手机号码.py | """
随机字符:random.choice('abcdefghijklmnopqrstuvwxyz!@#$%^&*()')
生成指定数量的随机字符:random.sqmple('zyxwvutsrqponmlkjihgfedcba',5)
从a-zA-Z0-9生成指定数量的随机字符:ran_str = ''.join(random.sample(string.ascii_letters + string.digits,8))
"""
# 第一种方法
import string
import random
num_start = ['134', '135', '136', '137', '138', '139', '150', ... | {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,029 | tylhhh/API_qianchengdai | refs/heads/master | /扩展学习/06_jsonpath应用.py | """
文章地址:
http://www.lemfix.com/topics/63
安装:pip install jsonpath
使用方式:jsonpath.jsonpath(字典对象,jsonpath表达式)
返回值:列表。
jsonpath用来解析多层嵌套的json数据
使用方法如下:
import jsonpath
res = jsonpath.jsonpath(dic_name,'$..key_name')
嵌套n层也能取到所有key_name信息,其中“$”表示最外层{},“..”表示模块匹配,当不传入不存在的key_name时,程序会返回false
"""
import jsonpath
d={
"... | {"/Common/handle_phone.py": ["/Common/handle_db.py", "/Common/handle_requests.py", "/Common/handle_config.py"], "/Common/handle_db.py": ["/Common/handle_config.py"], "/TestCases/test_withdraw.py": ["/Common/handle_path.py", "/Common/handle_db.py", "/Common/handle_log.py", "/Common/handle_phone.py", "/Common/handle_requ... |
54,050 | ngpham/petits | refs/heads/master | /rrtl/rrtl/__init__.py | from .parser import Parser
from .symbol import SymbolType, Symbol
from .vertex import Vertex, VertexCluster
from .edge import Edge
from .graph import Graph
from .debug import Debug
from .clause import Clause, ClausesSet, Cycle, Verifier
from . import transform as __just_for_execution_of_the_module
| {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,051 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/util.py | import functools
def overrides(*classes):
def overrider(method):
assert(method.__name__ in
functools.reduce(lambda a, b: set(a) | set(b), map(dir, classes), set()))
return method
return overrider
| {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,052 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/command.py | import enum
import pmdbpy
import functools
class Command:
class CommandType(enum.Enum):
CREATE = 1
SELECT = 2
INSERT = 3
def __init__(self, cmdType):
self.cmdType = cmdType
self.cmd = None
self.attributes = []
def addAttribute(self, atb):
self.attributes.append(atb)
... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,053 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/dbsys.py | import pmdbpy
class DbSys:
def __init__(self):
self.dataDict = pmdbpy.DataDictionary(self)
self.parser = pmdbpy.Parser(self)
def executeSQL(self, sql):
sql.execute(self)
def shutdown(self):
pass
| {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,054 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/__init__.py | from .util import overrides
from .relation import (
Relation, BaseRelation, Attribute,
CrossProductTupleIterator, AttributeValue)
from .dbfile import DbFile
from .dbsys import DbSys
from .datadict import DataDictionary
from .datatype import (
ByteOrderSetting, DataTypeFormat, DataType, DataTypeSize,... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,055 | ngpham/petits | refs/heads/master | /rrtl/rrtl/symbol.py | import enum
class SymbolType(enum.Enum):
Function = 1
FreeVar = 2
SkolemConst = 3
class Symbol:
@classmethod
def default_free_var(cls):
return cls('x', SymbolType.FreeVar)
def __init__(self, name, sym_type):
self.name = name
self.sym_type = sym_type
def __repr__(self):
return '{}({}, ... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,056 | ngpham/petits | refs/heads/master | /rrtl/rrtl/parser.py | """BCNF Grammar
<identifier> ::= <alphanumeric>
<op> ::= "+" | "-"
<fun> ::= <identifier> "(" <identifier> ")"
<atom> ::= <fun> <op> <number> "<=" <fun>
| <fun> "<=" <fun>
<clause> ::= <atom>
| <atom> "or" <clause>
<formula> ::= <clause> "\n"
| <clause> "\n" <formula>
"""
import pyparsi... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,057 | ngpham/petits | refs/heads/master | /pmdbpy/main.py | import pmdbpy
import itertools
import cmd
samples = [
"Create employee (id INT, name STRING, division STRING)",
"Create salary (id INT, salary INT)",
"Create head (boss INT, division STRING)",
"INSERT INTO employee (1, 'Alicia', 'Direction')",
"INSERT INTO salary( 1, 100000)",
"INSERT... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,058 | ngpham/petits | refs/heads/master | /rrtl/rrtl/clause.py | from rrtl import *
class Clause:
def __init__(self): self.literals = []
def add_literal(self, literal):
if not isinstance(literal, Edge): raise RuntimeError()
self.literals.append(literal)
def __repr__(self):
s = [self.__class__.__qualname__ + '(']
for l in self.literals:
s.append(repr(l)... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,059 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/datadict.py | import pmdbpy
class DataDictionary:
def __init__(self, dbs):
self.dbs = dbs
self.baseRelationMap = {}
self.initMasterRelation('master')
def initMasterRelation(self, masterName):
atbs = list([
pmdbpy.Attribute(masterName, 'table', pmdbpy.DataType.String),
pmdbpy.Attribute(mas... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,060 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/datatype.py | import pmdbpy
import enum
class DataType(enum.Enum):
Integer = 1
String = 2
String2DataType = {
'S': DataType.String,
'I': DataType.Integer,
'STRING': DataType.String,
'INT': DataType.Integer
}
DataTypeFormat = {
DataType.Integer: 'i',
DataType.String: '64p'
}
DataTypeSize = {
... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,061 | ngpham/petits | refs/heads/master | /rrtl/main.py | import sys
import argparse
import rrtl
def main():
argp = argparse.ArgumentParser()
argp.add_argument('--input', '-i', default='input.txt')
argp.add_argument('--debug', dest='debug', action='store_true')
argp.add_argument('--no-debug', dest='debug', action='store_false')
argp.set_defaults(debug=False)
arg... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,062 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/parser.py | import pmdbpy
import pyparsing as pp
import pprint
""" The BNF Grammar
<select> ::= "SELECT" <select list> <table expression>
<select list> ::= "*" | <select sublist>
<select sublist> ::= <column-identifier> | <column-identifier> "," <select sublist>
<table expression> ::= <from clause> [<where clause>... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,063 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/dbfile.py | import pmdbpy
import struct
class DbFile:
def __init__(self, relation):
if not isinstance(relation, pmdbpy.BaseRelation):
raise Exception('BaseRelation expected')
self.filename = relation.filename
self.fmt = pmdbpy.ByteOrderSetting
self.recordSize = 0
for atb in relation.attribu... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,064 | ngpham/petits | refs/heads/master | /rrtl/rrtl/debug.py |
class Debug:
debug_on = True
@classmethod
def trace(self, *args):
if Debug.debug_on:
s = 'Debug: '
for a in args: s += str(a) + ' '
print(s)
| {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,065 | ngpham/petits | refs/heads/master | /pmdbpy/pmdbpy/relation.py | import pmdbpy
import copy
import itertools
import functools
class Attribute:
def __init__(self, relationName, name, dtype):
self.name = name
self.dtype = dtype
self.relationName = relationName
def __hash__(self):
return hash((self.name, self.dtype, self.relationName))
def __eq__(s... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,066 | ngpham/petits | refs/heads/master | /rrtl/rrtl/transform.py | from rrtl import *
# unify functions: alpha-rewrite of free variable, or overwrite with Skolem constant.
class Unifier:
def __init__(self, sym1, sym2):
if not isinstance(sym1, Symbol) or not isinstance(sym2, Symbol): raise RuntimeError()
symbol = None
if sym1.sym_type == SymbolType.SkolemConst:
if ... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,067 | ngpham/petits | refs/heads/master | /rrtl/rrtl/edge.py | from rrtl import *
class Edge:
def __init__(self, src, dst, weight):
if not isinstance(src, Vertex) or not isinstance(dst, Vertex): raise RuntimeError()
self.src = src
self.dst = dst
self.weight = weight
def contains(self, vertex):
return self.src == vertex or self.dst == vertex
def __eq__(... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,068 | ngpham/petits | refs/heads/master | /rrtl/rrtl/vertex.py | from rrtl import *
class Vertex:
def __init__(self, fun_sym, var_sym):
if (not isinstance(fun_sym, Symbol) or
not isinstance(var_sym, Symbol)): raise RuntimeError()
self.fun_sym = fun_sym
self.var_sym = var_sym
def __repr__(self):
return '{}({}, {})'.format(
self.__class__.__qualname... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,069 | ngpham/petits | refs/heads/master | /rrtl/rrtl/graph.py |
from rrtl import *
class Graph:
def __init__(self):
self.fun_sym_cluster = {} # {vertex.fun_sym : cluster}
self.edges = []
def _add_vertex(self, v):
if not isinstance(v, Vertex): raise RuntimeError()
(self.fun_sym_cluster
.setdefault(v.fun_sym, VertexCluster(v.fun_sym))
.add_vertex(v... | {"/rrtl/rrtl/__init__.py": ["/rrtl/rrtl/parser.py", "/rrtl/rrtl/symbol.py", "/rrtl/rrtl/vertex.py", "/rrtl/rrtl/edge.py", "/rrtl/rrtl/graph.py", "/rrtl/rrtl/debug.py", "/rrtl/rrtl/clause.py"], "/pmdbpy/pmdbpy/__init__.py": ["/pmdbpy/pmdbpy/util.py", "/pmdbpy/pmdbpy/relation.py", "/pmdbpy/pmdbpy/dbfile.py", "/pmdbpy/pmd... |
54,070 | ucldc/harvester | refs/heads/master | /scripts/populate_harvested_images_redis.py | '''one time script to populate redis with harvested image object data'''
from harvester.config import config
from harvester.couchdb_init import get_couchdb
from harvester.couchdb_pager import couchdb_pager
from redis import Redis
import redis_collections
_config = config()
_redis = Redis(host=_config['redis_host'],
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,071 | ucldc/harvester | refs/heads/master | /scripts/queue_image_harvest_on_doc_id_list.py | #! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.image_harvest import harvest_image_for_doc
EMAIL_RETURN_ADDRESS = os.environ.get('EMAIL_RETURN_ADDRESS',
'example@example.com')
# csv delim email addresses... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,072 | ucldc/harvester | refs/heads/master | /scripts/grab_missing_object_vals_from_solr.py | import sys
py_version = sys.version_info
if py_version.major == 2 and py_version.minor == 7 and py_version.micro > 8:
#disable ssl verification
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
import os
from harvester.post_processing.run_transform_on_couchdb_docs im... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,073 | ucldc/harvester | refs/heads/master | /harvester/config.py | '''Configuration for the harvester and associated code.
UCLDC specfic information comes from environment variables and the
values are filled in directly in returned namedtuple.
DPLA values are contained in a ConfigParser object that is returned in the
namedtuple.
'''
import os
from collections import namedtuple
import... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,074 | ucldc/harvester | refs/heads/master | /test/test_oai_fetcher.py | # -*- coding: utf-8 -*-
import shutil
from unittest import TestCase
from test.utils import ConfigFileOverrideMixin, LogOverrideMixin
from test.utils import DIR_FIXTURES
from harvester.collection_registry_client import Collection
import harvester.fetcher as fetcher
from mypretty import httpretty
import pprint
# import h... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,075 | ucldc/harvester | refs/heads/master | /harvester/post_processing/couchdb_runner.py | import datetime
import time
from redis import Redis
from rq import Queue
from harvester.config import config
from harvester.couchdb_init import get_couchdb
from harvester.couchdb_pager import couchdb_pager
COUCHDB_VIEW = 'all_provider_docs/by_provider_name'
def get_collection_doc_ids(collection_id, url_couchdb_sour... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,076 | ucldc/harvester | refs/heads/master | /scripts/run_new_collection_all_docs.py | #! /bin/env python
'''run grabbing of new collection and updating in couch docs locally.
'''
import sys
import argparse
import Queue
import threading
import requests
import json
url_api_base = 'https://registry.cdlib.org/api/v1/collection/'
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harve... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,077 | ucldc/harvester | refs/heads/master | /scripts/remove_object_and_harvest_image_26094.py | #! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.image_harvest import harvest_image_for_doc
from harvester.couchdb_init import get_couchdb
import couchdb #couchdb-python
from ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,078 | ucldc/harvester | refs/heads/master | /scripts/external-redirect-generate-URL-redirect-map.py | #! /bin/env python
# -*- coding: utf-8 -*-
# Use when Calisphere Object URLs for a collection change, to generate
# a redirect file mapping 'old' (on SOLR-PROD) to 'new' (on SOLR-TEST) URLs.
#
# This script takes the JSON file generated by
# external-redirect-get-solr_prod-id.py as input and queries SOLR-TEST to find
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,079 | ucldc/harvester | refs/heads/master | /scripts/queue_image_harvest.py | #! /bin/env python
""""
Usage:
$ python queue_image_harvest.py user-email url_collection_api
"""
import sys
import os
from harvester.config import config as config_harvest
from harvester.collection_registry_client import Collection
import logbook
from redis import Redis
from rq import Queue
EMAIL_RETURN_ADDRESS = ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,080 | ucldc/harvester | refs/heads/master | /harvester/fetcher/preservica_api_fetcher.py | # -*- coding: utf-8 -*-
import requests
import json
from requests.auth import HTTPBasicAuth
from xml.etree import ElementTree as ET
from xmljson import badgerfish
from .fetcher import Fetcher
class PreservicaFetcher(Fetcher):
'''Harvest from Preservica API
https://demo.preservica.com/api/entity/documentation.h... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,081 | ucldc/harvester | refs/heads/master | /harvester/run_ingest.py | """
Script to run the ingest process.
Usage:
$ python run_ingest.py user-email url_collection_api
"""
import sys
import os
from dplaingestion.scripts import enrich_records
from dplaingestion.scripts import save_records
from dplaingestion.scripts import remove_deleted_records
from dplaingestion.scripts import dash... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,082 | ucldc/harvester | refs/heads/master | /test/test_preservica_api_fetcher.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from mypretty import httpretty
# import httpretty
import harvester.fetcher as fetcher
from test.utils import LogOverrideMixin
from test.utils import DIR_FIXTURES
class PreservicaFetcherTestCase(LogOverrideMixin, TestCase):
@httpretty.activate
def testPrese... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,083 | ucldc/harvester | refs/heads/master | /scripts/harvest_ready_for_publication.py | import requests
from harvester.config import config
from harvester.scripts.queue_harvest import main as queue_harvest
env=config()
c_prod=[]
c_harvest=[]
url_reg = "https://registry.cdlib.org"
url_reg_api = '{}{}'.format(url_reg, "/api/v1/collection/")
url='{}{}'.format(url_reg_api, "?format=json&limit=1000")
resp=requ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,084 | ucldc/harvester | refs/heads/master | /scripts/harvest_all_images.py | #! /bin/env python
# harvest images for the given collection
# by this point the isShownBy value for the doc should be filled in.
# this should point at the highest fidelity object file available
# from the source.
# use brian's content md5s3stash to store the resulting image.
# should just be a call to md5s3stash
imp... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,085 | ucldc/harvester | refs/heads/master | /harvester/fetcher/cmis_atom_feed_fetcher.py | # -*- coding: utf-8 -*-
import requests
from requests.auth import HTTPBasicAuth
from xml.etree import ElementTree as ET
from xmljson import badgerfish
from .fetcher import Fetcher
class CMISAtomFeedFetcher(Fetcher):
'''harvest a CMIS Atom Feed. Don't know how generic this is, just working
with Oakland Public ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,086 | ucldc/harvester | refs/heads/master | /scripts/queue_collection_reenrich.py | '''Enqueue a collection's docuemnts for re-enriching.
'''
import sys
import argparse
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.config import parse_env
import harvester.post_processing.enrich_existing_couch_doc
def main(args):
parser = argparse.ArgumentParser(
de... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,087 | ucldc/harvester | refs/heads/master | /test/test_collection_registry_client.py | from unittest import TestCase
import json
import StringIO
from mypretty import httpretty
# import httpretty
from mock import patch
from harvester.collection_registry_client import Registry, Collection
from test.utils import DIR_FIXTURES
class RegistryApiTestCase(TestCase):
'''Test that the registry api works for o... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,088 | ucldc/harvester | refs/heads/master | /harvester/post_processing/batch_update_couchdb_by_collection.py | #! /bin/env python
import sys
from harvester.couchdb_init import get_couchdb
from harvester.post_processing.couchdb_runner import CouchDBCollectionFilter
from harvester.sns_message import publish_to_harvesting
from harvester.sns_message import format_results_subject
PATH_DELIM = '/'
def setprop(obj, path, val, subst... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,089 | ucldc/harvester | refs/heads/master | /test/test_image_harvest.py | import os
from unittest import TestCase
from collections import namedtuple
from mock import patch
from mock import MagicMock
from mypretty import httpretty
# import httpretty
from harvester import image_harvest
from harvester.image_harvest import FailsImageTest
from harvester.image_harvest import ImageHTTPError
from ha... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,090 | ucldc/harvester | refs/heads/master | /scripts/queue_deep_harvest_single_object_jobs.py | #! /bin/env python
# -*- coding: utf-8 -*-
import sys
import logbook
from rq import Queue
from redis import Redis
from harvester.config import parse_env
from harvester.collection_registry_client import Collection
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
JOB_TIMEOUT = 345600 # 96 hrs
def queue_deep_... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,091 | ucldc/harvester | refs/heads/master | /scripts/queue_image_harvest_by_doc.py | #! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.image_harvest import harvest_image_for_doc
EMAIL_RETURN_ADDRESS = os.environ.get('EMAIL_RETURN_ADDRESS',
'example@example.com')
# csv delim email addresses... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,092 | ucldc/harvester | refs/heads/master | /scripts/queue_image_harvest_for_doc_ids.py | # -*- coding: utf-8 -*-
#! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.image_harvest import harvest_image_for_doc
EMAIL_RETURN_ADDRESS = os.environ.get('EMAIL_RETURN_ADDRESS',
'example@example.com')
# c... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,093 | ucldc/harvester | refs/heads/master | /harvester/fetcher/flickr_fetcher.py | # -*- coding: utf-8 -*-
import os
import urllib
import re
from xml.etree import ElementTree as ET
from .fetcher import Fetcher
class Flickr_Fetcher(Fetcher):
'''A fetcher for the Flickr API.
NOTE: This fetcher DOES NOT use the url_harvest. The extra_data should
be a Flickr user id, such as 49487266@N07, ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,094 | ucldc/harvester | refs/heads/master | /scripts/delete_couchdb_collection.py | #! /bin/env python
import sys
import argparse
from harvester.couchdb_sync_db_by_collection import delete_collection
def confirm_deletion(cid):
prompt = "Are you sure you want to delete all couchdb " + \
"documents for %s? yes to confirm\n" % cid
while True:
ans = raw_input(prompt).lower()... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,095 | ucldc/harvester | refs/heads/master | /scripts/report_non_unicode_data.py | '''run grabbing of new collection and updating in couch docs locally.
'''
import sys
import argparse
import Queue
import threading
import requests
import json
url_api_base = 'https://registry.cdlib.org/api/v1/collection/'
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.fetcher import... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,096 | ucldc/harvester | refs/heads/master | /scripts/image_harvest_opl_preservica.py | # -*- coding: utf-8 -*-
import harvester.image_harvest
harvester.image_harvest.link_is_to_image = lambda x,y: True
from harvester.image_harvest import ImageHarvester
from harvester.image_harvest import COUCHDB_VIEW, BUCKET_BASES
class ImageHarvesterOPLPreservica(ImageHarvester):
def __init__(self, cdb=None,
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,097 | ucldc/harvester | refs/heads/master | /test/test_nuxeo_fetcher.py | # -*- coding: utf-8 -*-
import os
from unittest import TestCase
import pickle
import json
import re
import shutil
from mock import patch
from mypretty import httpretty
# import httpretty
import pynux.utils
from harvester.collection_registry_client import Collection
from test.utils import DIR_FIXTURES
from test.utils im... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,098 | ucldc/harvester | refs/heads/master | /harvester/couchdb_init.py | '''Return a couchdb Server object in a consistent way from the environment or
config file.
Preference the environment, fallback to ingest code akara.ini
'''
import couchdb
import os
import sys
from harvester.config import config
def parse_couchdb_url(url):
'''Return url, username , password for couchdb url'''
de... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,099 | ucldc/harvester | refs/heads/master | /harvester/collection_registry_client.py | '''Objects to wrap the avram collection api'''
import os
from os.path import expanduser
import json
import ConfigParser
import requests
api_host = os.environ.get('REGISTRY_HOST', 'registry.cdlib.org')
api_path = '/api/v1/'
url_base = os.environ.get('URL_REGISTRY_API', ''.join(('https://', api_host)))
class Resource... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,100 | ucldc/harvester | refs/heads/master | /harvester/fetcher/oac_fetcher.py | # -*- coding: utf-8 -*-
import urllib
from collections import defaultdict
from xml.etree import ElementTree as ET
import time
import logbook
import requests
from requests.packages.urllib3.exceptions import DecodeError
from .fetcher import Fetcher
CONTENT_SERVER = 'http://content.cdlib.org/'
class BunchDict(dict):
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,101 | ucldc/harvester | refs/heads/master | /scripts/delete_solr_collection.py | #! /bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import requests
from harvester.solr_updater import delete_solr_collection
def confirm_deletion(cid):
prompt = "Are you sure you want to delete all solr " + \
"documents for %s? yes to confirm\n" % cid
while True:
ans = ra... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,102 | ucldc/harvester | refs/heads/master | /scripts/copy_couchdb_fields.py | import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.image_harvest import harvest_image_for_doc
from harvester.couchdb_init import get_couchdb
import couchdb #couchdb-python
from dplaingestion.selector import getprop, setprop
EMAIL_RETURN_ADDRESS = os.environ.get('EMA... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,103 | ucldc/harvester | refs/heads/master | /test/test_harvestcontroller.py | import os
from unittest import TestCase
from unittest import skip
import shutil
import re
import json
import datetime
from mypretty import httpretty
# import httpretty
from mock import patch
from test.utils import ConfigFileOverrideMixin, LogOverrideMixin
from test.utils import DIR_FIXTURES, TEST_COUCH_DASHBOARD, TEST_... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,104 | ucldc/harvester | refs/heads/master | /harvester/rq_worker_sns_msgs.py | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
import os
import re
from rq.worker import HerokuWorker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
# need tuple of tuple pairs, regex string to msg template
# the regex needs to... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,105 | ucldc/harvester | refs/heads/master | /test/test_couchdb_runner.py | import os
from unittest import TestCase
import re
from mypretty import httpretty
# import httpretty
from mock import patch
from test.utils import DIR_FIXTURES
from harvester.config import config
from harvester.post_processing.couchdb_runner import COUCHDB_VIEW
from harvester.post_processing.couchdb_runner import CouchD... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,106 | ucldc/harvester | refs/heads/master | /harvester/sns_message.py | import os
import boto3
import botocore.exceptions
import logging
import requests
logger = logging.getLogger(__name__)
def format_results_subject(cid, registry_action):
'''Format the "subject" part of the harvesting message for
results from the various processes.
Results: [Action from Registry] on [Work... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,107 | ucldc/harvester | refs/heads/master | /harvester/ansible_run_pb.py | # execute a playbook from within python
# for use from an rqworker
# fullpath to playbook This is copied & modified from the
# ansible-playbook standalone script
import sys
import os
from ansible import errors
from ansible import utils
import ansible.playbook
import ansible.constants as C
from ansible import callbacks
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,108 | ucldc/harvester | refs/heads/master | /scripts/queue_delete_couchdb_collection.py | #! /bin/env python
# -*- coding: utf-8 -*-
import sys
import logbook
from harvester.config import config as config_harvest
from redis import Redis
from rq import Queue
JOB_TIMEOUT = 28800 # 8 hrs
def def_args():
import argparse
parser = argparse.ArgumentParser(description='Harvest a collection')
parser.a... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,109 | ucldc/harvester | refs/heads/master | /scripts/remove_field_list_from_collection_docs.py | #! /bin/env python
import sys
import os
from harvester.post_processing.couchdb_runner import CouchDBWorker
from harvester.image_harvest import harvest_image_for_doc
from harvester.couchdb_init import get_couchdb
import couchdb #couchdb-python
from dplaingestion.selector import delprop
EMAIL_RETURN_ADDRESS = os.enviro... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,110 | ucldc/harvester | refs/heads/master | /scripts/rollback_couchdb.py | # -*- coding: utf-8 -*-
'''Rollback docs to previous rev for given collection'''
import os
import json
import couchdb
from harvester.post_processing.couchdb_runner import get_collection_doc_ids
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
couch_stg = 'https://{}harvest-stg.cdlib.org/co... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,111 | ucldc/harvester | refs/heads/master | /test/test_cmisatomfeed_fetcher.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from mypretty import httpretty
# import httpretty
import harvester.fetcher as fetcher
from test.utils import LogOverrideMixin
from test.utils import DIR_FIXTURES
class CMISAtomFeedFetcherTestCase(LogOverrideMixin, TestCase):
@httpretty.activate
def testCMI... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,112 | ucldc/harvester | refs/heads/master | /test/test_marc_fetcher.py | # -*- coding: utf-8 -*-
from unittest import TestCase
import shutil
from mock import patch
from harvester.collection_registry_client import Collection
from test.utils import ConfigFileOverrideMixin, LogOverrideMixin
from test.utils import DIR_FIXTURES
from mypretty import httpretty
# import httpretty
import harvester.f... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,113 | ucldc/harvester | refs/heads/master | /scripts/redis_delete_harvested_images_script.py | #! /bin/env python
'''create a script to feed to the redis-cli to delete cached
harvested images information'''
import sys
import os
from harvester.post_processing.couchdb_runner import get_collection_doc_ids
redis_hash_key = 'ucldc:harvester:harvested-images'
def create_redis_deletion_script(url_remote_couchdb, col... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,114 | ucldc/harvester | refs/heads/master | /scripts/queue_document_reenrich.py | '''Enqueue a docuement for re-enriching.
'''
import sys
import argparse
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
import harvester.post_processing.enrich_existing_couch_doc
def main(args):
parser = argparse.ArgumentParser(
description='run an Akara enrichment chain on document... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,115 | ucldc/harvester | refs/heads/master | /harvester/post_processing/dedupe_sourceresource.py | from harvester.post_processing.run_transform_on_couchdb_docs import run_on_couchdb_by_collection
# pass in a Couchdb doc, get back one with de-duplicated sourceResource values
def dedupe_sourceresource(doc):
''' Look for duplicate values in the doc['sourceResource'] and
remove.
Values must be *exactly* th... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,116 | ucldc/harvester | refs/heads/master | /scripts/fix_lapl_isShownBy.py | import sys
from harvester.post_processing.run_transform_on_couchdb_docs import run_on_couchdb_by_collection
def fix_lapl_isShownBy(doc):
'''Some urls are broken but fixable.'''
if 'sola1' in doc.get('isShownBy', ''):
print 'Fixing {}'.format(doc['_id'])
doc['isShownBy'] = doc['isShownBy'].repla... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,117 | ucldc/harvester | refs/heads/master | /scripts/queue_reenrich_26094.py | from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.post_processing.enrich_existing_couch_doc import main as reenrich
enrichments = '''/lapl-marc-id,
/dpla_mapper?mapper_type=lapl_marc,
/strip_html,
/set_context,
/cleanup_value,
/move_... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,118 | ucldc/harvester | refs/heads/master | /harvester/fetcher/controller.py | # -*- coding: utf-8 -*-
import os
import tempfile
import urlparse
import datetime
import uuid
import json
import codecs
import boto3
from email.mime.text import MIMEText
import logbook
from logbook import FileHandler
import dplaingestion.couch
from ..collection_registry_client import Collection
from .. import config
fr... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,119 | ucldc/harvester | refs/heads/master | /setup.py | import os
import sys
import subprocess
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='UCLDC Harvester',
v... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,120 | ucldc/harvester | refs/heads/master | /test/test_flickr_fetcher.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from unittest import TestCase
import harvester.fetcher as fetcher
from test.utils import DIR_FIXTURES
from test.utils import LogOverrideMixin
from mypretty import httpretty
# import httpretty
class FlickrFetcherTestCase(LogOverrideMixin, TestCase):
'''... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,121 | ucldc/harvester | refs/heads/master | /scripts/queue_collections_from_file_reenrich.py | '''For collection ids in the file, queue the passed in enrichments
'''
import sys
import argparse
import Queue
import threading
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
import harvester.post_processing.enrich_existing_couch_doc
def q_collection(collection_id, enrichment):
timeout =... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,122 | ucldc/harvester | refs/heads/master | /scripts/report_harvested_to_solr.py | import sys, os
import argparse
import solr
from harvester.collection_registry_client import Collection
import csv
import codecs
import cStringIO
import datetime
from harvester.couchdb_init import get_couchdb
from harvester.fetcher import OAC_XML_Fetcher
py_version = sys.version_info
if py_version.major == 2 and py_ver... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,123 | ucldc/harvester | refs/heads/master | /test/test_copy_couchdb_fields.py | # test copying from one couchdb to another
# specify list of field names in "/" path style
# specify doc id
# specify source & dest couchdb
| {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,124 | ucldc/harvester | refs/heads/master | /scripts/queue_deep_harvest_single_object_with_components.py | #! /bin/env python
# -*- coding: utf-8 -*-
import sys
import logbook
from rq import Queue
from redis import Redis
from harvester.config import parse_env
JOB_TIMEOUT = 345600 # 96 hrs
def queue_deep_harvest(redis_host,
redis_port,
redis_password,
r... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,125 | ucldc/harvester | refs/heads/master | /harvester/grab_solr_index.py | # Use the ansible runnner to run the specific playbook
import os
import ansible_run_pb
def main():
dir_code = os.environ['DIR_CODE'] if 'DIR_CODE' in os.environ \
else \
os.path.join(os.path.join(os.environ.get('HOME', '~'),
'code/harvester'))
dir_code = os.pa... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,126 | ucldc/harvester | refs/heads/master | /harvester/fetcher/ia_fetcher.py | # -*- coding: utf-8 -*-
import urllib
import json
from .fetcher import Fetcher
class IA_Fetcher(Fetcher):
'''A fetcher for the Internet Archive.
Put a dummy URL in harvesturl field such as 'https://example.edu'
In the 'extra_data' field, put in the Lucene-formatted search parameters
to return whateve... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,127 | ucldc/harvester | refs/heads/master | /test/fixtures/get-a-doc-from-couchdb-and-pickle.py | # OUT: Python shell history and tab completion are enabled.
from couchdb import Server
s=Server('https://54.84.142.143/couchdb/')
db=s['ucldc']
resp=db.changes(since=288000)
results=resp['results']
doc=db.get(results[0]['id'])
dir(doc)
# OUT: ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__dic... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,128 | ucldc/harvester | refs/heads/master | /harvester/post_processing/run_transform_on_couchdb_docs.py | '''This allows running a bit of code on couchdb docs.
code should take a json python object, modify it and hand back to the code
Not quite that slick yet, need way to pass in code or make this a decorator
'''
import importlib
from harvester.collection_registry_client import Collection
from harvester.couchdb_init import... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,129 | ucldc/harvester | refs/heads/master | /harvester/fetcher/youtube_fetcher.py | # -*- coding: utf-8 -*-
import os
import urllib
import json
from .fetcher import Fetcher
class YouTube_Fetcher(Fetcher):
'''A fetcher for the youtube API.
Find and put one of the IDs in the 'extra_data' field, depending on the type of harvest you want:
PLAYLIST ID (for harvesting from a single playlist): ... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,130 | ucldc/harvester | refs/heads/master | /scripts/enq_date_fix.py | from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.post_processing.run_transform_on_couchdb_docs import run_on_couchdb_doc
from harvester.post_processing.fix_repeated_displayDate import fix_repeated_date
import harvester
import sys
fname = sys.argv[1]
cid_list = [ x.strip() for x i... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,131 | ucldc/harvester | refs/heads/master | /test/test_youtube_fetcher.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from unittest import TestCase
import harvester.fetcher as fetcher
from test.utils import DIR_FIXTURES
from test.utils import LogOverrideMixin
from mypretty import httpretty
# import httpretty
class YouTubeFetcherTestCase(LogOverrideMixin, TestCase):
'... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,132 | ucldc/harvester | refs/heads/master | /test/test_enrich_existing_couch_doc.py | import os
from unittest import TestCase
import json
import re
from mypretty import httpretty
# import httpretty
from mock import patch
from test.utils import DIR_FIXTURES
from harvester.config import config
from harvester.post_processing.enrich_existing_couch_doc import akara_enrich_doc
from harvester.post_processing.e... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,133 | ucldc/harvester | refs/heads/master | /harvester/fetcher/marc_fetcher.py | # -*- coding: utf-8 -*-
import urllib
import tempfile
from xml.etree import ElementTree as ET
from pymarc import MARCReader
import pymarc
from .fetcher import Fetcher
class MARCFetcher(Fetcher):
'''Harvest a MARC FILE. Can be local or at a URL'''
def __init__(self, url_harvest, extra_data, **kwargs):
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,134 | ucldc/harvester | refs/heads/master | /scripts/queue_harvest.py | #! /bin/env python
# queue a job on the rq queue
import sys
import datetime
import time
from redis import Redis
from redis.exceptions import ConnectionError as RedisConnectionError
from rq import Queue
from harvester.config import config
from harvester.config import RQ_Q_LIST
ID_EC2_INGEST = ''
ID_EC2_SOLR_BUILD = ''... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,135 | ucldc/harvester | refs/heads/master | /scripts/fix_rights_status.py | import sys
from harvester.post_processing.run_transform_on_couchdb_docs import run_on_couchdb_by_collection
RIGHTS_STATEMENT_DEFAULT = 'Please contact the contributing institution for more information regarding the copyright status of this object'
RIGHTS_STATEMENT_DEFAULT = 'Please contact the contributing institution... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,136 | ucldc/harvester | refs/heads/master | /setup_queuing_only.py | # Setup for machines that only need to queue jobs.
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='U... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,137 | ucldc/harvester | refs/heads/master | /harvester/post_processing/enrich_existing_couch_doc.py | from __future__ import print_function
import sys
import httplib
import json
import argparse
import couchdb
from harvester.couchdb_init import get_couchdb
def _get_source(doc):
'''Return the "source". For us use the registry collection url.
if collection or collection field not found, report and reraise error.
... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,138 | ucldc/harvester | refs/heads/master | /test/utils.py | import os
import unittest
import tempfile
import logbook
DIR_THIS_FILE = os.path.abspath(os.path.split(__file__)[0])
DIR_FIXTURES = os.path.join(DIR_THIS_FILE, 'fixtures')
# NOTE: these are used in integration test runs
TEST_COUCH_DB = 'test-ucldc'
TEST_COUCH_DASHBOARD = 'test-dashboard'
CONFIG_FILE_DPLA = '''
[Ak... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,139 | ucldc/harvester | refs/heads/master | /scripts/rerun_enrichments.py | #! /bin/env python
'''Rerun a collection's stored enrichments
'''
import sys
import argparse
from harvester.post_processing.couchdb_runner import CouchDBJobEnqueue
from harvester.collection_registry_client import Collection
import harvester.post_processing.enrich_existing_couch_doc
def main(args):
parser = argpar... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,140 | ucldc/harvester | refs/heads/master | /harvester/fetcher/ucsf_xml_fetcher.py | # -*- coding: utf-8 -*-
import urllib
import re
from xml.etree import ElementTree as ET
from collections import defaultdict
from .fetcher import Fetcher
class UCSF_XML_Fetcher(Fetcher):
def __init__(self, url_harvest, extra_data, page_size=100, **kwargs):
self.url_base = url_harvest
self.page_size... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,141 | ucldc/harvester | refs/heads/master | /scripts/delete_couchdocs_by_obj_checksum.py | #! /bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from harvester.couchdb_init import get_couchdb
from harvester.couchdb_sync_db_by_collection import delete_id_list
from harvester.post_processing.couchdb_runner import CouchDBCollectionFilter
def confirm_deletion(count, objChecksum, cid):
prompt... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,142 | ucldc/harvester | refs/heads/master | /harvester/fetcher/ucd_json_fetcher.py | # -*- coding: utf-8 -*-
from collections import defaultdict
from .fetcher import Fetcher
import urllib
import extruct
import requests
import re
from xml.etree import ElementTree as ET
from w3lib.html import get_base_url
from rdflib.plugin import register, Serializer
register('json-ld', Serializer, 'rdflib_jsonld.serial... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
54,143 | ucldc/harvester | refs/heads/master | /harvester/image_harvest.py | # harvest images for the given collection
# by this point the isShownBy value for the doc should be filled in.
# this should point at the highest fidelity object file available
# from the source.
# use brian's content md5s3stash to store the resulting image.
import os
import sys
import datetime
import time
import urlp... | {"/test/test_oai_fetcher.py": ["/test/utils.py", "/harvester/collection_registry_client.py", "/harvester/fetcher/__init__.py"], "/harvester/run_ingest.py": ["/harvester/config.py", "/harvester/collection_registry_client.py", "/harvester/sns_message.py", "/harvester/image_harvest.py", "/harvester/cleanup_dir.py"], "/tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.