diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index f9e9cd1..0000000 --- a/MANIFEST +++ /dev/null @@ -1,34 +0,0 @@ -# file GENERATED by distutils, do NOT edit -CONTRIBUTING.rst -README.rst -gitbook -requirements.pip -setup.py -gitenberg/.book.py.swp -gitenberg/.fetch.py.swp -gitenberg/.get.py.swp -gitenberg/.test.py.swp -gitenberg/__init__.py -gitenberg/__init__.pyc -gitenberg/book.py -gitenberg/book.pyc -gitenberg/fetch.py -gitenberg/fetch.pyc -gitenberg/loop.py -gitenberg/make.py -gitenberg/make.pyc -gitenberg/push.py -gitenberg/push.pyc -gitenberg/secrets.py -gitenberg/secrets.pyc -gitenberg/test.py -gitenberg/__pycache__/test.cpython-27-PYTEST.pyc -gitenberg/templates/CONTRIBUTING.rst -gitenberg/templates/LICENSE -gitenberg/templates/README.rst.j2 -gitenberg/util/__init__.py -gitenberg/util/__init__.pyc -gitenberg/util/catalog.py -gitenberg/util/catalog.pyc -gitenberg/util/filetypes.py -gitenberg/util/filetypes.pyc diff --git a/gitenberg/__init__.py b/gitenberg/__init__.py index 28c0106..108c6d0 100644 --- a/gitenberg/__init__.py +++ b/gitenberg/__init__.py @@ -11,6 +11,6 @@ __title__ = 'gitberg' __appname__ = 'gitberg' -__version__ = '0.2.0' +__version__ = '0.2.3' __copyright__ = 'Copyright 2012-2016 Seth Woodworth and the Free Ebook Foundation' diff --git a/assets/GITenberg_repo_list.tsv b/gitenberg/data/GITenberg_repo_list.tsv similarity index 98% rename from assets/GITenberg_repo_list.tsv rename to gitenberg/data/GITenberg_repo_list.tsv index 59e199e..26d474e 100644 --- a/assets/GITenberg_repo_list.tsv +++ b/gitenberg/data/GITenberg_repo_list.tsv @@ -6028,11 +6028,6 @@ 6197 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-03_6197 6198 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-04_6198 6199 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-05_6199 -6199 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-05_6199 -6199 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-05_6199 -6199 Cumner-s-Son-and-Other-South-Sea-Folk-Volume-05_6199 -6200 The-Greek-View-of-Life_6200 -6200 The-Greek-View-of-Life_6200 6200 The-Greek-View-of-Life_6200 6201 Cumner-s-Son-and-Other-South-Sea-Folk---Complete_6201 6202 When-Valmond-Came-to-Pontiac-The-Story-of-a-Lost-Napoleon-Volume-1_6202 @@ -6553,7 +6548,6 @@ 6747 The-Log-of-the-Empire-State_6747 6748 Fulco-de-Minstreel--Een-historisch-verhaal-uit-den-tijd-van-Graaf-Jan-I-voor-jongelieden_6748 6749 Voyages-of-Samuel-De-Champlain-Volume-02_6749 -6749 Voyages-of-Samuel-De-Champlain-Volume-02_6749 6750 The-Hawaiian-Archipelago_6750 6751 The-Winds-of-the-World_6751 6752 Study-and-Stimulants-Or-the-Use-of-Intoxicants-and-Narcotics-in-Relation-to-Intellectual-Life-__6752 @@ -7066,7 +7060,6 @@ 7266 ----_7266 7267 Cardello_7267 7268 Monsieur-Bergeret-a-Paris-Histoire-Contemporaine_7268 -7268 Monsieur-Bergeret-a-Paris-Histoire-Contemporaine_7268 7269 Macbeth_7269 7270 ----volume-4-10_7270 7271 ----volume-11-14_7271 @@ -7430,7 +7423,6 @@ 7631 The-Disowned-Volume-01_7631 7632 The-Disowned-Volume-02_7632 7633 The-Disowned-Volume-03_7633 -7633 The-Disowned-Volume-03_7633 7634 The-Disowned-Volume-04_7634 7635 The-Disowned-Volume-05_7635 7636 The-Disowned-Volume-06_7636 @@ -7443,7 +7435,6 @@ 7643 Ernest-Maltravers-Volume-04_7643 7644 Ernest-Maltravers-Volume-05_7644 7645 Ernest-Maltravers-Volume-06_7645 -7645 Ernest-Maltravers-Volume-06_7645 7646 Ernest-Maltravers-Volume-07_7646 7647 Ernest-Maltravers-Volume-08_7647 7648 Ernest-Maltravers-Volume-09_7648 @@ -7457,15 +7448,10 @@ 7656 Kenelm-Chillingly-Volume-07_7656 7657 Kenelm-Chillingly-Volume-08_7657 7657 Kenelm-Chillingly-Volume-08_7657 -7657 Kenelm-Chillingly-Volume-08_7657 7658 Kenelm-Chillingly---Complete_7658 7659 What-Will-He-Do-with-It-Volume-01_7659 -7659 What-Will-He-Do-with-It-Volume-01_7659 -7660 What-Will-He-Do-with-It-Volume-02_7660 7660 What-Will-He-Do-with-It-Volume-02_7660 7661 What-Will-He-Do-with-It-Volume-03_7661 -7661 What-Will-He-Do-with-It-Volume-03_7661 -7662 What-Will-He-Do-with-It-Volume-04_7662 7662 What-Will-He-Do-with-It-Volume-04_7662 7663 What-Will-He-Do-with-It-Volume-05_7663 7664 What-Will-He-Do-with-It-Volume-06_7664 @@ -7474,7 +7460,6 @@ 7667 What-Will-He-Do-with-It-Volume-09_7667 7668 What-Will-He-Do-with-It-Volume-10_7668 7669 What-Will-He-Do-with-It-Volume-11_7669 -7669 What-Will-He-Do-with-It-Volume-11_7669 7670 What-Will-He-Do-with-It-Volume-12_7670 7671 What-Will-He-Do-with-It----Complete_7671 7672 Harold-the-Last-of-the-Saxon-Kings-Volume-01_7672 diff --git a/assets/gutenberg_descriptions.json b/gitenberg/data/gutenberg_descriptions.json similarity index 100% rename from assets/gutenberg_descriptions.json rename to gitenberg/data/gutenberg_descriptions.json diff --git a/gitenberg/util/catalog.py b/gitenberg/util/catalog.py index a704e52..7346aa9 100644 --- a/gitenberg/util/catalog.py +++ b/gitenberg/util/catalog.py @@ -7,6 +7,7 @@ import sh import json import os +import csv from gitenberg.metadata.pg_rdf import pg_rdf_to_json from gitenberg.metadata.pandata import Pandata from gitenberg import pg_wikipedia @@ -15,12 +16,16 @@ # sourced from http://www.gutenberg.org/MIRRORS.ALL MIRRORS = {'default': 'ftp://gutenberg.pglaf.org/mirrors/gutenberg/'} -with open(os.path.join(os.path.dirname(__file__), '../../assets/gutenberg_descriptions.json')) as descfile: +with open(os.path.join(os.path.dirname(__file__), '../data/gutenberg_descriptions.json')) as descfile: DESCS= json.load(descfile) descs = {} for desc in DESCS: descs[desc['identifier'][32:]]=desc['description'] +repo_list = [] +with open(os.path.join(os.path.dirname(__file__), '../data/GITenberg_repo_list.tsv')) as repofile: + for row in csv.reader(repofile, delimiter='\t', quotechar='"'): + repo_list.append(row) class CdContext(): """ A context manager using `os` to cd to a directory and back diff --git a/notebooks/delete repos.ipynb b/notebooks/delete repos.ipynb index 79883a5..4305130 100644 --- a/notebooks/delete repos.ipynb +++ b/notebooks/delete repos.ipynb @@ -1221,7 +1221,7 @@ " removed_ids.add(pg_id)\n", "with open('../assets/GITenberg_repo_list_out.tsv','wb') as out:\n", " writer=csv.writer(out,delimiter='\\t', quotechar='\"')\n", - " with open('../assets/GITenberg_repo_list.tsv','r') as f:\n", + " with open('../gitenberg/data/GITenberg_repo_list.tsv','r') as f:\n", " for (pg_id, reponame) in csv.reader(f,delimiter='\\t', quotechar='\"'):\n", " if pg_id not in removed_ids:\n", " writer.writerow([pg_id, reponame])" diff --git a/notebooks/find_missing_repos.ipynb b/notebooks/find_missing_repos.ipynb index 6dd3edf..5d5504e 100644 --- a/notebooks/find_missing_repos.ipynb +++ b/notebooks/find_missing_repos.ipynb @@ -214,7 +214,7 @@ " def __init__(self,_id):\n", " self.book_id = _id\n", "pg_ids=set()\n", - "with open('../assets/GITenberg_repo_list.tsv','r') as f:\n", + "with open('../gitenberg/data/GITenberg_repo_list.tsv','r') as f:\n", " for vals in csv.reader(f,delimiter='\\t', quotechar='\"'):\n", " pg_ids.add(int(vals[0]))\n", "missing=[]\n", diff --git a/notebooks/remove_duplicates.ipynb b/notebooks/remove_duplicates.ipynb index 620a32d..164a37d 100644 --- a/notebooks/remove_duplicates.ipynb +++ b/notebooks/remove_duplicates.ipynb @@ -617,7 +617,7 @@ "\n", "pg_ids={}\n", "dups=set()\n", - "with open('/Users/eric/github/local/giten_site/assets/GITenberg_repo_list_2016.02.12.tsv','r') as f:\n", + "with open('../gitenberg/data/GITenberg_repo_list.tsv','r') as f:\n", " for vals in csv.reader(f,delimiter='\\t', quotechar='\"'):\n", " if int(vals[0]) in pg_ids:\n", " prev=pg_ids[int(vals[0])]\n", @@ -645,7 +645,7 @@ " pg_ids[key] = newest.name\n", " \n", " \n", - "with open('/Users/eric/github/local/giten_site/assets/GITenberg_repo_list.tsv','r+w') as out:\n", + "with open('../assets/GITenberg_repo_list_out.tsv','r+w') as out:\n", " csv.writer(out,delimiter='\\t', quotechar='\"').writerows([(key,pg_ids[key]) for key in pg_ids.keys()])" ] }, diff --git a/requirements.pip b/requirements.pip index 708b517..bec38d7 100644 --- a/requirements.pip +++ b/requirements.pip @@ -23,4 +23,3 @@ isodate==0.5.1 pyparsing==2.0.3 rdflib==4.2.0 rdflib-jsonld==0.3 -requests==2.7.0 \ No newline at end of file diff --git a/setup.py b/setup.py index a415958..791fb6d 100755 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ 'rdflib==4.2.0', 'rdflib-jsonld==0.3', ], - + test_suite='nose.collector', tests_require=['nose'], classifiers=[