Skip to content

Commit 9a65bc8

Browse files
author
James Campbell
committed
updates to include pre-req infor for polyglot and ICU c library
1 parent 6b63ee1 commit 9a65bc8

File tree

7 files changed

+29
-7
lines changed

7 files changed

+29
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
- checkout # checkout source code to working directory
1111
- run:
1212
command: | # use pipenv to install dependencies
13+
sudo apt-get install python-numpy libicu-dev
1314
sudo pip install pipenv
1415
mkdir reports
1516
pipenv install

Pipfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pinboard = "*"
4040
webdriver-manager = "*"
4141
scapy = "*"
4242
matplotlib = "*"
43+
xlrd = "*"
44+
pyicu = "*"
4345

4446
[requires]
4547
python_version = "3.7"

Pipfile.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polyglot-example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# requires pyicu and pycld2 and pre-req brew install icu4c
12
from polyglot.detect import Detector
23

34
arabic_text = u"""

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ pypdf2
2828
pinboard
2929
webdriver_manager
3030
scapy
31-
matplotlib
31+
matplotlib
32+
xlrd
33+
pyicu

rethinkdb-example.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#!/usr/bin/python3
21
"""
32
Author: James Campbell
43
Date: July 3rd 2016
5-
Date Updated: July 4th 2016
4+
Date Updated: 3 July 2019
65
What: RethinkDB python example create and put data into it from pastebin site.
76
Documentation on RethinkDB: https://rethinkdb.com/api/python/
7+
Pre: Must brew install rethinkdb and start it up first
88
"""
9-
import rethinkdb as r # standard nomenclature to use
109
import json
10+
import rethinkdb as rdb
11+
r = rdb.RethinkDB()
1112

1213
# for url implementation instead of json file (comment out example file open below -jc
1314
# url = 'http://psbdmp.com/api/dump/daily'
@@ -19,14 +20,14 @@
1920
info, total, dumped, formated, removed, textdata, spID
2021
"""
2122
# open example file
22-
with open('pastedumpexample.json', 'rU', encoding='utf-8') as json_data:
23+
with open('assets/pastedumpexample.json', 'rU', encoding='utf-8') as json_data:
2324
d = json.load(json_data)
2425

2526
i = 0
2627

2728
# list of tables to check if they exist
2829
tables = ['hellopaste'] # you can check multiple tables here by adding more in list
29-
conn = r.connect('localhost', 28015).repl()
30+
conn = r.connect('127.0.0.1', 28015).repl()
3031
for table in tables:
3132
if not r.db('test').table_list().contains(table).run(conn):
3233
r.db('test').table_create(table).run(conn)

0 commit comments

Comments
 (0)