├── tests ├── __init__.py ├── test.pdf └── español.pdf ├── .coveragerc ├── docs ├── _build │ ├── html │ │ ├── objects.inv │ │ ├── _static │ │ │ ├── up.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── comment.png │ │ │ ├── up-pressed.png │ │ │ ├── ajax-loader.gif │ │ │ ├── down-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── pygments.css │ │ │ ├── default.css │ │ │ ├── classic.css │ │ │ ├── sidebar.js │ │ │ ├── doctools.js │ │ │ ├── underscore.js │ │ │ └── basic.css │ │ ├── .buildinfo │ │ ├── _sources │ │ │ ├── credits.txt │ │ │ ├── index.txt │ │ │ ├── changelog.txt │ │ │ ├── otherobjects.txt │ │ │ ├── gettingstarted.txt │ │ │ ├── projects.txt │ │ │ └── documents.txt │ │ ├── search.html │ │ ├── credits.html │ │ ├── searchindex.js │ │ ├── index.html │ │ ├── changelog.html │ │ ├── otherobjects.html │ │ └── genindex.html │ └── doctrees │ │ ├── index.doctree │ │ ├── credits.doctree │ │ ├── changelog.doctree │ │ ├── documents.doctree │ │ ├── environment.pickle │ │ ├── projects.doctree │ │ ├── otherobjects.doctree │ │ └── gettingstarted.doctree ├── index.rst ├── changelog.rst ├── credits.rst ├── documents.rst ├── projects.rst ├── gettingstarted.rst ├── otherobjects.rst ├── Makefile ├── make.bat └── conf.py ├── tox.ini ├── setup.cfg ├── requirements.txt ├── .gitignore ├── Makefile ├── Pipfile ├── .travis.yml ├── README.md ├── setup.py ├── LICENSE ├── documentcloud ├── toolbox.py └── MultipartPostHandler.py └── Pipfile.lock /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | include = documentcloud/* 3 | -------------------------------------------------------------------------------- /tests/test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/tests/test.pdf -------------------------------------------------------------------------------- /tests/español.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/tests/español.pdf -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /docs/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/up.png -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist=py34 3 | 4 | [testenv] 5 | commands= 6 | python setup.py install 7 | python scratch.py 8 | -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/down.png -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/_build/doctrees/credits.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/credits.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/credits.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/documents.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/projects.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal = 1 3 | 4 | [flake8] 5 | max-line-length = 119 6 | 7 | [metadata] 8 | license-file = LICENSE 9 | -------------------------------------------------------------------------------- /docs/_build/doctrees/changelog.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/changelog.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/documents.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/documents.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/doctrees/projects.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/projects.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/gettingstarted.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/otherobjects.rst: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/_build/doctrees/otherobjects.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/otherobjects.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_build/doctrees/gettingstarted.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/doctrees/gettingstarted.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datadesk/python-documentcloud/HEAD/docs/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Required for the app 2 | six 3 | python-dateutil>=2.1 4 | 5 | # Required for development 6 | Sphinx 7 | flake8 8 | coverage 9 | python-coveralls 10 | twine 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .tox/ 2 | tests/scratch.py 3 | _sources/* 4 | sphinx/* 5 | doctrees/* 6 | examples.py 7 | build/* 8 | *.egg-info/* 9 | dist/* 10 | *.pyc 11 | private_settings.py 12 | .coverage 13 | scratch.py 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test ship 2 | 3 | 4 | test: 5 | flake8 documentcloud 6 | coverage run setup.py test 7 | coverage report -m 8 | 9 | 10 | ship: 11 | rm -rf build/ 12 | python setup.py sdist bdist_wheel 13 | twine upload dist/* --skip-existing 14 | -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 396417dd88b440092680b8a90d71e517 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.python.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | six = "*" 8 | python-dateutil = "*" 9 | "rfc3987" = "*" 10 | 11 | [dev-packages] 12 | Sphinx = "*" 13 | coverage = "*" 14 | flake8 = "*" 15 | python-coveralls = "*" 16 | tox = "*" 17 | 18 | [requires] 19 | python_version = "3.6" 20 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/credits.txt: -------------------------------------------------------------------------------- 1 | Credits 2 | ------- 3 | 4 | The lead developer of this project is `Ben Welsh `_. 5 | 6 | But it would not be possible without: 7 | 8 | * `The DocumentCloud team `_. 9 | * `Chris Amico `_, `Christopher Groskopf `_ and `Mitchell Kotler `_, who broke ground with code that I've adapted. 10 | * Fixes from friendly people like `Joe Germuska `_, `Shane Shifflet `_ and `Adi Eyal `_. 11 | 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | sudo: false 4 | 5 | python: 6 | - '2.7' 7 | - '3.7-dev' 8 | 9 | install: 10 | - pip install -r requirements.txt 11 | 12 | script: 13 | - flake8 documentcloud 14 | - coverage run setup.py test 15 | 16 | after_success: 17 | - coveralls 18 | 19 | env: 20 | global: 21 | # Encrypted DOCUMENTCLOUD_TEST_USERNAME 22 | - secure: "mt7PbdPrHREewNkZE+hV/HILK+67IYVl2F/SZi57VZYx7zBX2+jwZbAAbiWwGrOG9zqgqGiovH+Bx1NAPDm6V0vdlEaXzxhqpKxd4KKWCocL5tZP+6mXbN36Cifm04TIvFUBG0auCR2OMoewxgaY0a/vr6+KYYj37uAlUPhfBcA=" 23 | # Encrypted DOCUMENTCLOUD_TEST_PASSWORD 24 | - secure: "ZoGrJ9lPyDPDRwMcL5Wx+t+BNPnwpuRy2d4c6z/lTYhdyGwHycoQJCMcvgMkKm/VQP76iLR2efuwV4GUGPRD4YkIBqEgYrLtEvxHUAoLQoo3+uylPrmfZDQtLTmXN5ZKR+dSGFLs9mMQhU0zARpdgSIMFlz2xgFKMpjvzN3lHmc=" 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
  ____                                        _    ____ _                 _
 2 |  |  _ \  ___   ___ _   _ _ __ ___   ___ _ __ | |_ / ___| | ___  _   _  __| |
 3 |  | | | |/ _ \ / __| | | | '_ ` _ \ / _ \ '_ \| __| |   | |/ _ \| | | |/ _` |
 4 |  | |_| | (_) | (__| |_| | | | | | |  __/ | | | |_| |___| | (_) | |_| | (_| |
 5 |  |____/ \___/ \___|\__,_|_| |_| |_|\___|_| |_|\__|\____|_|\___/ \__,_|\__,_|/  
6 | 7 | A simple python wrapper for the DocumentCloud API 8 | 9 | > This repository has been deprecated. A newer version, adapted to fit DocumentCloud's latest API, is now maintained at [github.com/MuckRock/python-documentcloud/](https://github.com/MuckRock/python-documentcloud/). Due to changes in how DocumentCloud works, the code here will no longer work. You should upgrade to version 2.0 or higher. 10 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | 4 | setup( 5 | name='python-documentcloud', 6 | version='1.1.1', 7 | description='A simple Python wrapper for the DocumentCloud API', 8 | author='Ben Welsh', 9 | author_email='ben.welsh@gmail.com', 10 | url='http://datadesk.github.com/python-documentcloud/', 11 | license="MIT", 12 | packages=("documentcloud",), 13 | test_suite="tests.test_all", 14 | include_package_data=True, 15 | install_requires=( 16 | 'python-dateutil>=2.1', 17 | 'six>=1.4.1', 18 | 'rfc3987', 19 | ), 20 | classifiers=( 21 | 'Development Status :: 5 - Production/Stable', 22 | 'Intended Audience :: Developers', 23 | 'Operating System :: OS Independent', 24 | 'License :: OSI Approved :: MIT License', 25 | 'Programming Language :: Python', 26 | 'Programming Language :: Python :: 2', 27 | 'Programming Language :: Python :: 2.7', 28 | 'Programming Language :: Python :: 3', 29 | 'Programming Language :: Python :: 3.7', 30 | 'Topic :: Internet :: WWW/HTTP', 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Los Angeles Times 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | python-documentcloud 2 | ==================== 3 | 4 | A simple Python wrapper for the `DocumentCloud API `_ 5 | 6 | Features 7 | -------- 8 | 9 | * Retrieve and edit documents and projects, both public and private, from `documentcloud.org `_ 10 | * Upload PDFs into your documentcloud.org account and organize them into projects 11 | * Download text, images and entities extracted from your PDFs by DocumentCloud 12 | 13 | Documentation 14 | ------------- 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | 19 | gettingstarted 20 | documents 21 | projects 22 | otherobjects 23 | changelog 24 | credits 25 | 26 | Contributing 27 | ------------ 28 | 29 | * Code repository: `https://github.com/datadesk/python-documentcloud `_ 30 | * Issues: `https://github.com/datadesk/python-documentcloud/issues `_ 31 | * Packaging: `https://pypi.python.org/pypi/python-documentcloud `_ 32 | * Testing: `https://travis-ci.org/datadesk/python-documentcloud `_ 33 | * Coverage: `https://coveralls.io/r/datadesk/python-documentcloud `_ 34 | -------------------------------------------------------------------------------- /documentcloud/toolbox.py: -------------------------------------------------------------------------------- 1 | """ 2 | A few toys the API will use. 3 | """ 4 | import six 5 | import time 6 | from functools import wraps 7 | 8 | # 9 | # Exceptions 10 | # 11 | 12 | 13 | class CredentialsMissingError(Exception): 14 | """ 15 | Raised if an API call is attempted without the required login credentials 16 | """ 17 | pass 18 | 19 | 20 | class CredentialsFailedError(Exception): 21 | """ 22 | Raised if an API call fails because the login credentials are no good. 23 | """ 24 | pass 25 | 26 | 27 | class DoesNotExistError(Exception): 28 | """ 29 | Raised when the user asks the API for something it cannot find. 30 | """ 31 | pass 32 | 33 | 34 | class DuplicateObjectError(Exception): 35 | """ 36 | Raised when the user tries to add a duplicate to a distinct list. 37 | """ 38 | pass 39 | 40 | # 41 | # Decorators 42 | # 43 | 44 | 45 | def credentials_required(method_func): 46 | """ 47 | Decorator for methods that checks that the client has credentials. 48 | 49 | Throws a CredentialsMissingError when they are absent. 50 | """ 51 | def _checkcredentials(self, *args, **kwargs): 52 | if self.username and self.password: 53 | return method_func(self, *args, **kwargs) 54 | else: 55 | raise CredentialsMissingError("This is a private method. \ 56 | You must provide a username and password when you initialize the \ 57 | DocumentCloud client to attempt this type of request.") 58 | 59 | return wraps(method_func)(_checkcredentials) 60 | 61 | 62 | def retry(ExceptionToCheck, tries=3, delay=2, backoff=2): 63 | """ 64 | Retry decorator published by Saltry Crane. 65 | 66 | http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ 67 | """ 68 | def deco_retry(f): 69 | def f_retry(*args, **kwargs): 70 | mtries, mdelay = tries, delay 71 | try_one_last_time = True 72 | while mtries > 1: 73 | try: 74 | return f(*args, **kwargs) 75 | try_one_last_time = False 76 | break 77 | except ExceptionToCheck: 78 | six.print_("Retrying in %s seconds" % str(mdelay)) 79 | time.sleep(mdelay) 80 | mtries -= 1 81 | mdelay *= backoff 82 | if try_one_last_time: 83 | return f(*args, **kwargs) 84 | return 85 | return f_retry # true decorator 86 | return deco_retry 87 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/changelog.txt: -------------------------------------------------------------------------------- 1 | Changelog 2 | --------- 3 | 4 | 1.0.3 5 | ~~~~~ 6 | 7 | * Encoding bug fix for metadata associated with documents via API 8 | 9 | 10 | 1.0.2 11 | ~~~~~ 12 | 13 | * URLs to PDFs can now be submitted for upload 14 | * Refactored setup.py and tests to be less complex 15 | 16 | 1.0.1 17 | ~~~~~ 18 | 19 | * Python 3.4 testing 20 | * 400MB upload limit to match DocumentCloud's API restrictions 21 | 22 | 1.0.0 23 | ~~~~~ 24 | 25 | * Adopted `semantic versioning `_ without breaking existing packages on PyPI 26 | * Fixed bugs with ``get_page_text`` 27 | * Added keyword argument during initialization that allows you to override the ``BASE_URI`` and connect with independent clones of DocumentCloud. Contributed by `Adi Eyal `_. 28 | * Refactored unit tests to run more quickly and require fewer web requests 29 | * Documentation moved from the gh-pages branch to master and refactored to be published via `ReadTheDocs `_. 30 | 31 | 0.2 32 | ~~~ 33 | 34 | * Python 3 support 35 | * PEP8 and PyFlakes compliance 36 | * Coverage reports on testing via coveralls.io 37 | 38 | 39 | 0.16 40 | ~~~~ 41 | 42 | * Continuous integration testing with TravisCI 43 | * Fixed bug with empty strings in Document descriptions 44 | * Raise errors when a user tries to save a data keyword reserved by DocumentCloud 45 | * Allow all-caps file extensions 46 | * Retry requests that fail with an increasing backoff delay 47 | * Fixed a bug in how titles are assigned to a file object 48 | * Added access checks when retrieving txt, pdf, img about a document 49 | 50 | 0.15 51 | ~~~~ 52 | 53 | * File objects can now be submitted for uploading 54 | * Added more support for unicode data thanks to contributions by `Shane Shifflet `_. 55 | * Smarter lazy loading of Document attributes missing from a search 56 | 57 | 0.14 58 | ~~~~ 59 | 60 | * Added ``data`` attribute on Document for storing dictionaries of arbitrary metadata 61 | * Added ``secure`` option for Document uploads to prevent data from being sent to OpenCalais 62 | * Added ``save`` alias on Document and Project objects that uses the pre-existing ``put`` command 63 | * Fixed to url encoding to makes the system more unicode friendly 64 | * Added all Document upload arguments to ``upload_directory`` method 65 | 66 | 0.13 67 | ~~~~ 68 | 69 | * ``upload_directory`` method for documents 70 | 71 | 0.12 72 | ~~~~ 73 | 74 | * ``get_or_create_by_title`` method for projects 75 | * Document and project creation methods now return an object, not the new id. 76 | * Projects can pulled by id or by title 77 | 78 | 79 | 0.11 80 | ~~~~ 81 | 82 | * Document search now returns ``mentions`` of the keyword in the documents 83 | * ``related_url`` and ``published_url`` attributes now more easily accessible 84 | * ``normal`` sized images now available 85 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/otherobjects.txt: -------------------------------------------------------------------------------- 1 | Other objects 2 | ============= 3 | 4 | Other types of data provided by the DocumentCloud system. 5 | 6 | .. _annotations: 7 | 8 | Annotations 9 | ----------- 10 | 11 | Notes left in documents. 12 | 13 | .. attribute:: annotation_obj.access 14 | 15 | The privacy level of the resource within the DocumentCloud system. It will be either ``public`` or ``private``. 16 | 17 | .. attribute:: annotation_obj.description 18 | 19 | Space for a lengthy text block that will be published below the highlighted text in the DocumentCloud design. 20 | 21 | .. attribute:: annotation_obj.id 22 | 23 | The unique identifer of the document in DocumentCloud's system. 24 | 25 | .. attribute:: annotation_obj.location 26 | 27 | The location of where the annotation appears on the document's page. Defined by the :ref:`locations` class. 28 | 29 | .. attribute:: annotation_obj.page 30 | 31 | The page where the annotation appears. 32 | 33 | .. attribute:: annotation_obj.title 34 | 35 | The name of the annotation, which appears in the table of contents and above the highlighted text when published by DocumentCloud. 36 | 37 | .. _entities: 38 | 39 | Entities 40 | -------- 41 | 42 | Keywords extracted from documents with OpenCalais. 43 | 44 | .. attribute:: location_obj.relevance 45 | 46 | The weighting associated with this connection by OpenCalais. Higher numbers are supposed to be more relevant. 47 | 48 | .. attribute:: location_obj.type 49 | 50 | The category of entity the value belongs to. 51 | 52 | .. attribute:: location_obj.value 53 | 54 | The name of the entity extracted from the document (i.e. "Los Angeles" or "Museum of Modern Art") 55 | 56 | .. _locations: 57 | 58 | Locations 59 | --------- 60 | 61 | The location where :ref:`annotations` are placed within a document. 62 | 63 | .. attribute:: location_obj.bottom 64 | 65 | The value of the bottom edge of an annotation. 66 | 67 | .. attribute:: location_obj.left 68 | 69 | The value of the left edge of an annotation. 70 | 71 | .. attribute:: location_obj.right 72 | 73 | The value of the right edge of an annotation. 74 | 75 | .. attribute:: location_obj.top 76 | 77 | The value of the top edge of an annotation. 78 | 79 | .. _mentions: 80 | 81 | Mentions 82 | -------- 83 | 84 | Mentions of a search keyword found in one of the documents. 85 | 86 | .. attribute:: mention_obj.page 87 | 88 | The page where the mention occurs. 89 | 90 | .. attribute:: mention_obj.text 91 | 92 | The text surrounding the mention of the keyword. 93 | 94 | .. _sections: 95 | 96 | Sections 97 | -------- 98 | 99 | Sections of the documents earmarked by users. 100 | 101 | .. attribute:: section_obj.title 102 | 103 | The name of the section. 104 | 105 | .. attribute:: section_obj.page 106 | 107 | The page where the section begins. 108 | -------------------------------------------------------------------------------- /docs/_build/html/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — python-documentcloud 1.0.3 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |

Search

53 |
54 | 55 |

56 | Please activate JavaScript to enable the search 57 | functionality. 58 |

59 |
60 |

61 | From here you can search these documents. Enter your search 62 | words into the box below and click "search". Note that the search 63 | function will automatically search for all of the words. Pages 64 | containing fewer words won't appear in the result list. 65 |

66 |
67 | 68 | 69 | 70 |
71 | 72 |
73 | 74 |
75 | 76 |
77 |
78 |
79 | 83 |
84 |
85 | 94 | 98 | 99 | -------------------------------------------------------------------------------- /docs/_build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #333333 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 44 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 45 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 46 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 47 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 48 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 49 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 50 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 51 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 52 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 53 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 54 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 55 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 56 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 57 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 58 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 59 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 60 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 61 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 62 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 63 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_build/html/_sources/gettingstarted.txt: -------------------------------------------------------------------------------- 1 | Getting started 2 | =============== 3 | 4 | This tutorial will walk you through the process of installing python-documentcloud and making your first requests. 5 | 6 | Installation 7 | ------------ 8 | 9 | Provided that you have `pip `_ installed, you can install the library like so: :: 10 | 11 | $ pip install python-documentcloud 12 | 13 | Creating a client 14 | ----------------- 15 | 16 | Before you can interact with DocumentCloud, you first must import the library and initialize a client to talk with the site on your behalf. :: 17 | 18 | >>> from documentcloud import DocumentCloud 19 | >>> client = DocumentCloud() 20 | 21 | Since we didn't provide any log-in credentials, the client above will only be able to access published documents. If have an account at DocumentCloud and want to use that, you can provide the crendentials to the client. :: 22 | 23 | >>> client = DocumentCloud(USERNAME, PASSWORD) 24 | 25 | Searching for documents 26 | ----------------------- 27 | 28 | You can now you use client to interact with DocumentCloud. A search for documents about `journalist Ruben Salazar `_ would look like this: :: 29 | 30 | >>> obj_list = client.documents.search("Ruben Salazar") 31 | >>> # Let's grab the first one and look at it 32 | >>> obj = obj_list[0] 33 | >>> obj 34 | 35 | 36 | Interacting with a document 37 | --------------------------- 38 | 39 | Once you have you hands on a document object, you can interact with the metadata stored at documentcloud.org. Here's a sample: :: 40 | 41 | >>> print obj.title 42 | Final OIR Report 43 | >>> print obj.id 44 | 71072-oir-final-report 45 | >>> print obj.contributor_organization 46 | Los Angeles Times 47 | >>> print obj.canonical_url 48 | http://www.documentcloud.org/documents/71072-oir-final-report.html 49 | 50 | You can even download the PDF, page images and full text. :: 51 | 52 | >>> obj.large_image_url 53 | ... 54 | >>> obj.large_image 55 | ... 56 | >>> obj.full_text 57 | ... 58 | >>> obj.pdf 59 | ... 60 | 61 | Uploading a document 62 | -------------------- 63 | 64 | You can upload a PDF document from your local machine to documentcloud.org. Here's how: :: 65 | 66 | >>> from documentcloud import DocumentCloud 67 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 68 | >>> obj = client.documents.upload("/home/ben/pdfs/myfile.pdf") 69 | 70 | And you don't have to provide a path, you can also upload a file object. :: 71 | 72 | >>> from documentcloud import DocumentCloud 73 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 74 | >>> pdf = open("/home/ben/pdfs/myfile.pdf", "rb") 75 | >>> obj = client.documents.upload(pdf) 76 | 77 | You can also URLs link to PDFs, if that's the kind of thing you want to do. :: 78 | 79 | >>> client.documents.upload("http://ord.legistar.com/Chicago/attachments/e3a0cbcb-044d-4ec3-9848-23c5692b1943.pdf") 80 | 81 | 82 | Uploading a directory of documents as a project 83 | ----------------------------------------------- 84 | 85 | Here's how to upload a directory full of documents and add them all to a new project. Be warned, this will upload any documents in directories inside the path you specify. :: 86 | 87 | >>> # Connect to documentcloud 88 | >>> from documentcloud import DocumentCloud 89 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 90 | >>> # Create the project 91 | >>> project, created = client.projects.get_or_create_by_title("Groucho Marx's FBI file") 92 | >>> # Upload all the pdfs 93 | >>> obj_list = client.documents.upload_directory('/home/ben/pdfs/groucho_marx/') 94 | >>> # Add the newly created documents to the project 95 | >>> project.document_list = obj_list 96 | >>> # Save the changes to the project 97 | >>> project.put() 98 | 99 | Securely uploading a document 100 | ----------------------------- 101 | 102 | How to upload a document, but prevent it from being sent to DocumentCloud's third-party services like OpenCalais. 103 | 104 | >>> from documentcloud import DocumentCloud 105 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 106 | >>> obj = client.documents.upload("/home/ben/pdfs/myfile.pdf", secure=True) 107 | 108 | Uploading a PDF from a URL 109 | -------------------------- 110 | 111 | How to read a PDF document from a URL on the World Wide Web and upload it to DocumentCloud without saving it to your local hard drive. 112 | 113 | >>> from documentcloud import DocumentCloud 114 | >>> import urllib, cStringIO 115 | >>> # Download the URL with urllib 116 | >>> url = "http://myhost.org/interesting-doc.pdf" 117 | >>> data = urllib.urlopen(url).read() 118 | >>> # Stuff it in a file object with cStringIO 119 | >>> file_obj = cStringIO.StringIO(data) 120 | >>> # Upload that to DocumentCloud 121 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 122 | >>> obj = client.documents.upload(file_obj) 123 | -------------------------------------------------------------------------------- /docs/_build/html/credits.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Credits — python-documentcloud 1.0.3 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 |

Credits

50 |

The lead developer of this project is Ben Welsh.

51 |

But it would not be possible without:

52 | 57 |
58 | 59 | 60 |
61 |
62 |
63 | 90 |
91 |
92 | 104 | 108 | 109 | -------------------------------------------------------------------------------- /docs/_build/html/_static/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | * default.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- default theme. 6 | * 7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #133f52; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | tt { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning tt { 241 | background: #efc2c2; 242 | } 243 | 244 | .note tt { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } -------------------------------------------------------------------------------- /docs/_build/html/_sources/projects.txt: -------------------------------------------------------------------------------- 1 | Projects 2 | ======== 3 | 4 | Methods for drawing down, editing and uploading data about DocumentCloud projects. A project is a group of documents. 5 | 6 | Retrieval 7 | --------- 8 | 9 | .. function:: client.projects.get(id=None, title=None) 10 | 11 | Return the project with the provided DocumentCloud identifer. You can retrieve projects using either the `id` or `title`. :: 12 | 13 | >>> from documentcloud import DocumentCloud 14 | >>> client = DocumentCloud(USERNAME, PASSWORD) 15 | >>> # Fetch using the id 16 | >>> obj = client.projects.get(id='816') 17 | >>> obj 18 | 19 | >>> # Fetch using the title 20 | >>> obj = client.projects.get(title='The Ruben Salazar Files') 21 | >>> obj 22 | 23 | 24 | .. function:: client.projects.get_by_id(id) 25 | 26 | Return the project with the provided id. Operates the same as `client.projects.get`. 27 | 28 | .. function:: client.projects.get_by_title(title) 29 | 30 | Return the project with the provided title. Operates the same as `client.projects.get`. 31 | 32 | .. function:: client.projects.all() 33 | 34 | Return all projects for the authorized DocumentCloud account :: 35 | 36 | >>> from documentcloud import DocumentCloud 37 | >>> client = DocumentCloud(USERNAME, PASSWORD) 38 | >>> obj_list = client.projects.all() 39 | >>> obj_list[0] 40 | 41 | 42 | Editing 43 | ------- 44 | 45 | .. method:: project_obj.put() 46 | 47 | Save changes to a project back to DocumentCloud. You must be authorized to make these changes. Only the `title`, `source`, `document_list` attributes may be edited. :: 48 | 49 | >>> obj = client.projects.get('816') 50 | >>> obj.title = "Brand new title" 51 | >>> obj.put() 52 | 53 | .. method:: project_obj.delete() 54 | 55 | Delete a project from DocumentCloud. You must be authorized to make these changes. :: 56 | 57 | >>> obj = client.projects.get('816') 58 | >>> obj.delete() 59 | 60 | .. method:: project_obj.save() 61 | 62 | An alias for ``put`` that saves changes back to DocumentCloud. 63 | 64 | Creation 65 | -------- 66 | 67 | .. method:: client.projects.create(title=None,description=None, document_ids=None) 68 | 69 | Create a new project on DocumentCloud. You must be authorized to do this. Returns the object representing the new record you've created. 70 | 71 | >>> from documentcloud import DocumentCloud 72 | >>> client = DocumentCloud(USERNAME, PASSWORD) 73 | >>> obj = client.projects.create("New project") 74 | >>> obj 75 | 76 | 77 | .. method:: client.projects.get_or_create_by_title(title=None) 78 | 79 | Fetch the project with provided name, or create it if it does not exist. You must be authorized to do this. Returns a tuple. An object representing the record comes first. A boolean that reports whether or not the objects was created fresh comes second. It is true when the record was created, false when it was found on the site already. 80 | 81 | >>> from documentcloud import DocumentCloud 82 | >>> client = DocumentCloud(USERNAME, PASSWORD) 83 | >>> # The first time it will be created and added to documentcloud.org 84 | >>> obj, created = client.projects.get_or_create_by_title("New project") 85 | >>> obj, created 86 | , True 87 | >>> # The second time it will be fetched from documentcloud.org 88 | >>> obj, created = client.projects.get_or_create_by_title("New project") 89 | >>> obj, created 90 | , False 91 | 92 | Metadata 93 | -------- 94 | 95 | .. attribute:: project_obj.description 96 | 97 | A summary of the project. Can be edited and saved with a put command. 98 | 99 | .. attribute:: project_obj.document_ids 100 | 101 | A list that contains the unique identifier of the documents assigned to this project. Cannot be edited. Edit the document_list instead. 102 | 103 | >>> obj = client.projects.get('816') 104 | >>> obj.document_ids 105 | [u'19419-times-columnist-ruben-salazar-killed-by-bullet', u'19420-usps-american-journalists-stamp', u'19280-fbi-file-on-el-paso-investigations', u'19281-letter-from-the-lapd-chief', ... 106 | 107 | .. attribute:: project_obj.document_list 108 | 109 | A list that documents assigned to this project. Can be expanded by appending new documents to the list or cleared by reassigning it as an empty list and then issuing the put command. 110 | 111 | >>> obj = client.projects.get('816') 112 | >>> obj.document_list 113 | [, , , ... 114 | 115 | .. method:: project_obj.get_document(id) 116 | 117 | Retrieves a particular document from the project using the provided DocumentCloud identifer. 118 | 119 | .. attribute:: project_obj.id 120 | 121 | The unique identifer of the project in DocumentCloud's system. Typically this is a number. 122 | 123 | .. attribute:: project_obj.title 124 | 125 | The name of the project. Can be edited and saved with a put command. 126 | -------------------------------------------------------------------------------- /docs/_build/html/_static/classic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * default.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- default theme. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #133f52; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | code { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning code { 241 | background: #efc2c2; 242 | } 243 | 244 | .note code { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } 257 | 258 | div.code-block-caption { 259 | color: #efefef; 260 | background-color: #1c4e63; 261 | } -------------------------------------------------------------------------------- /docs/_build/html/_static/sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * sidebar.js 3 | * ~~~~~~~~~~ 4 | * 5 | * This script makes the Sphinx sidebar collapsible. 6 | * 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton 9 | * used to collapse and expand the sidebar. 10 | * 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden 12 | * and the width of the sidebar and the margin-left of the document 13 | * are decreased. When the sidebar is expanded the opposite happens. 14 | * This script saves a per-browser/per-session cookie used to 15 | * remember the position of the sidebar among the pages. 16 | * Once the browser is closed the cookie is deleted and the position 17 | * reset to the default (expanded). 18 | * 19 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 20 | * :license: BSD, see LICENSE for details. 21 | * 22 | */ 23 | 24 | $(function() { 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | // global elements used by the functions. 34 | // the 'sidebarbutton' element is defined as global after its 35 | // creation, in the add_sidebar_button function 36 | var bodywrapper = $('.bodywrapper'); 37 | var sidebar = $('.sphinxsidebar'); 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); 39 | 40 | // for some reason, the document has no sidebar; do not run into errors 41 | if (!sidebar.length) return; 42 | 43 | // original margin-left of the bodywrapper and width of the sidebar 44 | // with the sidebar expanded 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); 46 | var ssb_width_expanded = sidebar.width(); 47 | 48 | // margin-left of the bodywrapper and width of the sidebar 49 | // with the sidebar collapsed 50 | var bw_margin_collapsed = '.8em'; 51 | var ssb_width_collapsed = '.8em'; 52 | 53 | // colors used by the current theme 54 | var dark_color = $('.related').css('background-color'); 55 | var light_color = $('.document').css('background-color'); 56 | 57 | function sidebar_is_collapsed() { 58 | return sidebarwrapper.is(':not(:visible)'); 59 | } 60 | 61 | function toggle_sidebar() { 62 | if (sidebar_is_collapsed()) 63 | expand_sidebar(); 64 | else 65 | collapse_sidebar(); 66 | } 67 | 68 | function collapse_sidebar() { 69 | sidebarwrapper.hide(); 70 | sidebar.css('width', ssb_width_collapsed); 71 | bodywrapper.css('margin-left', bw_margin_collapsed); 72 | sidebarbutton.css({ 73 | 'margin-left': '0', 74 | 'height': bodywrapper.height() 75 | }); 76 | sidebarbutton.find('span').text('»'); 77 | sidebarbutton.attr('title', _('Expand sidebar')); 78 | document.cookie = 'sidebar=collapsed'; 79 | } 80 | 81 | function expand_sidebar() { 82 | bodywrapper.css('margin-left', bw_margin_expanded); 83 | sidebar.css('width', ssb_width_expanded); 84 | sidebarwrapper.show(); 85 | sidebarbutton.css({ 86 | 'margin-left': ssb_width_expanded-12, 87 | 'height': bodywrapper.height() 88 | }); 89 | sidebarbutton.find('span').text('«'); 90 | sidebarbutton.attr('title', _('Collapse sidebar')); 91 | document.cookie = 'sidebar=expanded'; 92 | } 93 | 94 | function add_sidebar_button() { 95 | sidebarwrapper.css({ 96 | 'float': 'left', 97 | 'margin-right': '0', 98 | 'width': ssb_width_expanded - 28 99 | }); 100 | // create the button 101 | sidebar.append( 102 | '
«
' 103 | ); 104 | var sidebarbutton = $('#sidebarbutton'); 105 | light_color = sidebarbutton.css('background-color'); 106 | // find the height of the viewport to center the '<<' in the page 107 | var viewport_height; 108 | if (window.innerHeight) 109 | viewport_height = window.innerHeight; 110 | else 111 | viewport_height = $(window).height(); 112 | sidebarbutton.find('span').css({ 113 | 'display': 'block', 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 115 | }); 116 | 117 | sidebarbutton.click(toggle_sidebar); 118 | sidebarbutton.attr('title', _('Collapse sidebar')); 119 | sidebarbutton.css({ 120 | 'color': '#FFFFFF', 121 | 'border-left': '1px solid ' + dark_color, 122 | 'font-size': '1.2em', 123 | 'cursor': 'pointer', 124 | 'height': bodywrapper.height(), 125 | 'padding-top': '1px', 126 | 'margin-left': ssb_width_expanded - 12 127 | }); 128 | 129 | sidebarbutton.hover( 130 | function () { 131 | $(this).css('background-color', dark_color); 132 | }, 133 | function () { 134 | $(this).css('background-color', light_color); 135 | } 136 | ); 137 | } 138 | 139 | function set_position_from_cookie() { 140 | if (!document.cookie) 141 | return; 142 | var items = document.cookie.split(';'); 143 | for(var k=0; k/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python-documentcloud.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-documentcloud.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/python-documentcloud" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python-documentcloud" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | goto end 41 | ) 42 | 43 | if "%1" == "clean" ( 44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 45 | del /q /s %BUILDDIR%\* 46 | goto end 47 | ) 48 | 49 | 50 | %SPHINXBUILD% 2> nul 51 | if errorlevel 9009 ( 52 | echo. 53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 54 | echo.installed, then set the SPHINXBUILD environment variable to point 55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 56 | echo.may add the Sphinx directory to PATH. 57 | echo. 58 | echo.If you don't have Sphinx installed, grab it from 59 | echo.http://sphinx-doc.org/ 60 | exit /b 1 61 | ) 62 | 63 | if "%1" == "html" ( 64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 68 | goto end 69 | ) 70 | 71 | if "%1" == "dirhtml" ( 72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 76 | goto end 77 | ) 78 | 79 | if "%1" == "singlehtml" ( 80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 84 | goto end 85 | ) 86 | 87 | if "%1" == "pickle" ( 88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can process the pickle files. 92 | goto end 93 | ) 94 | 95 | if "%1" == "json" ( 96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 97 | if errorlevel 1 exit /b 1 98 | echo. 99 | echo.Build finished; now you can process the JSON files. 100 | goto end 101 | ) 102 | 103 | if "%1" == "htmlhelp" ( 104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 105 | if errorlevel 1 exit /b 1 106 | echo. 107 | echo.Build finished; now you can run HTML Help Workshop with the ^ 108 | .hhp project file in %BUILDDIR%/htmlhelp. 109 | goto end 110 | ) 111 | 112 | if "%1" == "qthelp" ( 113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 114 | if errorlevel 1 exit /b 1 115 | echo. 116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 117 | .qhcp project file in %BUILDDIR%/qthelp, like this: 118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\python-documentcloud.qhcp 119 | echo.To view the help file: 120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\python-documentcloud.ghc 121 | goto end 122 | ) 123 | 124 | if "%1" == "devhelp" ( 125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished. 129 | goto end 130 | ) 131 | 132 | if "%1" == "epub" ( 133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 137 | goto end 138 | ) 139 | 140 | if "%1" == "latex" ( 141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 145 | goto end 146 | ) 147 | 148 | if "%1" == "latexpdf" ( 149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 150 | cd %BUILDDIR%/latex 151 | make all-pdf 152 | cd %BUILDDIR%/.. 153 | echo. 154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 155 | goto end 156 | ) 157 | 158 | if "%1" == "latexpdfja" ( 159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 160 | cd %BUILDDIR%/latex 161 | make all-pdf-ja 162 | cd %BUILDDIR%/.. 163 | echo. 164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 165 | goto end 166 | ) 167 | 168 | if "%1" == "text" ( 169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 170 | if errorlevel 1 exit /b 1 171 | echo. 172 | echo.Build finished. The text files are in %BUILDDIR%/text. 173 | goto end 174 | ) 175 | 176 | if "%1" == "man" ( 177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 178 | if errorlevel 1 exit /b 1 179 | echo. 180 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 181 | goto end 182 | ) 183 | 184 | if "%1" == "texinfo" ( 185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 186 | if errorlevel 1 exit /b 1 187 | echo. 188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 189 | goto end 190 | ) 191 | 192 | if "%1" == "gettext" ( 193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 194 | if errorlevel 1 exit /b 1 195 | echo. 196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 197 | goto end 198 | ) 199 | 200 | if "%1" == "changes" ( 201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 202 | if errorlevel 1 exit /b 1 203 | echo. 204 | echo.The overview file is in %BUILDDIR%/changes. 205 | goto end 206 | ) 207 | 208 | if "%1" == "linkcheck" ( 209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 210 | if errorlevel 1 exit /b 1 211 | echo. 212 | echo.Link check complete; look for any errors in the above output ^ 213 | or in %BUILDDIR%/linkcheck/output.txt. 214 | goto end 215 | ) 216 | 217 | if "%1" == "doctest" ( 218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 219 | if errorlevel 1 exit /b 1 220 | echo. 221 | echo.Testing of doctests in the sources finished, look at the ^ 222 | results in %BUILDDIR%/doctest/output.txt. 223 | goto end 224 | ) 225 | 226 | if "%1" == "xml" ( 227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 228 | if errorlevel 1 exit /b 1 229 | echo. 230 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 231 | goto end 232 | ) 233 | 234 | if "%1" == "pseudoxml" ( 235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 236 | if errorlevel 1 exit /b 1 237 | echo. 238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 239 | goto end 240 | ) 241 | 242 | :end 243 | -------------------------------------------------------------------------------- /docs/_build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({envversion:46,filenames:["changelog","credits","documents","gettingstarted","index","otherobjects","projects"],objects:{"client.documents":{get:[2,2,1,""],search:[2,2,1,""],upload:[2,2,1,""],upload_directory:[2,2,1,""]},"client.projects":{all:[6,2,1,""],create:[6,1,1,""],get:[6,2,1,""],get_by_id:[6,2,1,""],get_by_title:[6,2,1,""],get_or_create_by_title:[6,1,1,""]},annotation_obj:{access:[5,0,1,""],description:[5,0,1,""],id:[5,0,1,""],location:[5,0,1,""],page:[5,0,1,""],title:[5,0,1,""]},document_obj:{"delete":[2,1,1,""],access:[2,0,1,""],annotations:[2,0,1,""],canonical_url:[2,0,1,""],contributor:[2,0,1,""],contributor_organization:[2,0,1,""],created_at:[2,0,1,""],data:[2,0,1,""],description:[2,0,1,""],entities:[2,0,1,""],file_hash:[2,0,1,""],full_text:[2,0,1,""],full_text_url:[2,0,1,""],get_page_text:[2,1,1,""],id:[2,0,1,""],large_image:[2,0,1,""],large_image_url:[2,0,1,""],large_image_url_list:[2,0,1,""],mentions:[2,0,1,""],normal_image:[2,0,1,""],normal_image_url:[2,0,1,""],normal_image_url_list:[2,0,1,""],pages:[2,0,1,""],pdf:[2,0,1,""],pdf_url:[2,0,1,""],published_url:[2,0,1,""],put:[2,1,1,""],related_article:[2,0,1,""],save:[2,1,1,""],sections:[2,0,1,""],small_image:[2,0,1,""],small_image_url:[2,0,1,""],small_image_url_list:[2,0,1,""],source:[2,0,1,""],thumbnail_image:[2,0,1,""],thumbnail_image_url:[2,0,1,""],thumbnail_image_url_list:[2,0,1,""],title:[2,0,1,""],updated_at:[2,0,1,""]},location_obj:{bottom:[5,0,1,""],left:[5,0,1,""],relevance:[5,0,1,""],right:[5,0,1,""],top:[5,0,1,""],type:[5,0,1,""],value:[5,0,1,""]},mention_obj:{page:[5,0,1,""],text:[5,0,1,""]},project_obj:{"delete":[6,1,1,""],description:[6,0,1,""],document_ids:[6,0,1,""],document_list:[6,0,1,""],get_document:[6,1,1,""],id:[6,0,1,""],put:[6,1,1,""],save:[6,1,1,""],title:[6,0,1,""]},section_obj:{page:[5,0,1,""],title:[5,0,1,""]}},objnames:{"0":["py","attribute","Python attribute"],"1":["py","method","Python method"],"2":["py","function","Python function"]},objtypes:{"0":"py:attribute","1":"py:method","2":"py:function"},terms:{"044d":[2,3],"23c5692b1943":[2,3],"400mb":0,"4ec3":[2,3],"872b9b858f5f3e6bb6086fec7f05dd464b60eb26":2,"boolean":6,"break":0,"catch":6,"class":[2,5],"default":2,"final":[2,3],"import":[2,3,6],"new":[0,2,3,6],"public":[2,4,5],"return":[0,2,6],"switch":2,"true":[2,3,6],"try":2,abl:3,about:[0,2,3,6],abov:[3,5],access:[0,2,3,5],account:[2,3,4,6],adapt:1,add:3,addit:2,adi:[0,1],adopt:0,adventuretim:2,affili:2,agenc:2,algorithm:2,alia:[0,2,6],all:[0,2,3,6],allow:0,alreadi:6,also:[2,3],alta:2,american:6,amico:1,angel:[2,3,5],ani:[2,3],annot:[],annotation_obj:5,api:[0,4],appear:[2,5],append:6,arbitrari:0,argument:[0,2],art:5,assign:[0,2,6],associ:[0,5],attach:[2,3],attempt:2,attent:6,attribut:[0,2,6],author:[2,6],avail:[0,2],avraham:2,back:[2,6],backoff:0,base_uri:0,been:2,befor:3,begin:[2,5],behalf:3,belong:5,below:5,ben:[1,2,3],biggi:2,binari:2,block:5,both:4,bottom:5,branch:0,brand:[2,6],broke:1,bug:0,bullet:6,bylin:2,california:2,calper:2,can:[0,2,3,6],cannot:6,canonical_url:[2,3],cap:0,categori:[2,5],chang:[2,3,6],check:0,chicago:[2,3],chief:6,chri:1,christoph:[1,2],citi:2,clear:6,client:[],clone:0,code:[1,4],columnist:6,com:[2,3,4],combin:2,come:6,command:[0,2,6],complex:0,complianc:0,connect:[0,3,5],contain:[2,6],content:5,continu:0,contribut:0,contributor:2,contributor_organ:[2,3],could:2,counti:2,countri:2,coverag:[0,4],coveral:[0,4],creat:[],created_at:2,creation:0,credenti:3,crendenti:3,cstringio:3,cub:6,current:2,data:[0,2,3,5,6],datadesk:4,date:2,datetim:2,decod:2,defin:[2,5],delai:0,delet:[2,6],descript:[0,2,5,6],design:5,develop:1,dictionari:[0,2],didn:3,directli:2,directori:[],doc:3,document:0,document_id:6,document_list:[3,6],document_obj:2,documentcloud:[0,1,3],documentcloud_password:[2,3],documentcloud_usernam:[2,3],doe:6,don:3,down:[2,6],download:[3,4],draft:2,draw:[2,6],drive:3,dure:0,e3a0cbcb:[2,3],each:2,earmark:[2,5],easili:0,edg:5,either:[2,5,6],email:2,empti:[0,6],encod:0,entiti:[],error:[0,2],even:3,everi:2,exist:[0,6],expand:6,extens:0,extract:[2,4,5],eyal:[0,1],fail:0,fals:[2,6],fbi:[2,3,6],fetch:[2,6],fewer:0,file:[0,2,3,6],file_hash:2,file_obj:3,filter:2,find:2,first:[2,3,6],fix:[0,1],follow:2,format:2,found:[5,6],founder:2,fresh:6,friendli:[0,1],from:[0,1],full:[2,3],full_text:[2,3],full_text_url:2,germuska:1,get:[],get_by_id:6,get_by_titl:6,get_docu:6,get_large_imag:2,get_large_image_url:2,get_normal_imag:2,get_normal_image_url:2,get_or_create_by_titl:[0,3,6],get_page_text:[0,2],get_small_imag:2,get_small_image_url:2,get_small_thumbnail_url:2,get_thumbnail_imag:2,github:4,give:2,got:2,grab:[2,3],groskopf:1,groucho:3,groucho_marx:[2,3],ground:1,group:[2,6],guess:2,hand:3,hard:3,hash:2,hashlib:2,have:[2,3],health:2,here:[2,3],hexadecim:2,hexdigest:2,higher:5,highlight:5,hip:2,hire:2,home:[2,3],hop:2,host:2,how:[0,3],html:3,http:[2,3,4],human:2,identif:[2,5,6],identifi:6,imag:[0,2,3,4],img:0,includ:2,increas:[0,2],independ:[0,2],initi:[0,3],insid:[2,3],instead:6,integr:0,interest:3,investig:[2,6],investor:2,issu:[4,6],joe:1,journalist:[3,6],just:2,kei:2,keyword:[0,2,5],kill:6,kind:[2,3],kotler:1,lafd:2,lapd:6,larg:2,large_imag:[2,3],large_image_url:[2,3],large_image_url_list:2,last:2,lazi:0,lead:1,left:[2,5],legaci:6,legistar:[2,3],len:2,lengthi:5,less:0,let:[2,3],letter:[2,6],level:[2,5],librari:3,like:[1,2,3],limit:0,line:2,link:[2,3],list:[2,6],live:6,load:0,local:3,locat:[],location_obj:5,log:3,look:3,machin:3,mai:[2,6],make:[0,2,3,6],mall:2,marx:3,master:0,match:[0,2],mean:2,member:2,mention:0,mention_obj:5,metadata:0,method:[0,2,6],miss:0,missil:6,mitchel:1,model:2,modern:5,modifi:2,more:[0,5],move:0,museum:5,must:[2,3,6],myfil:3,myhost:3,name:[2,5,6],ndepart:2,new_id:2,newli:3,nhomicid:2,nlo:2,none:[2,6],normal:[0,2],normal_imag:2,normal_image_url:2,normal_image_url_list:2,note:5,now:[0,2,3],number:[2,5,6],obj:[2,3,6],obj_list:[2,3,6],object:[0,3],occur:5,offic:2,oir:[2,3],old:2,onc:3,onli:[2,3,6],open:3,opencalai:[0,2,3,5],oper:6,option:0,ord:[2,3],org:[2,3,4,6],organ:[2,4],organiz:2,origin:2,other:[],outsid:2,overrid:0,own:2,packag:[0,4],page:[0,2,3,5],pagin:2,parti:3,particular:6,paso:6,pass:2,password:[2,3,6],path:[2,3],pdf:0,pdf_url:2,peopl:1,pep8:0,per_pag:2,person:2,phone:2,pip:3,place:[2,5],possibl:1,pre:0,prevent:[0,3],print:[2,3],privaci:[2,5],privat:[2,4,5],process:3,project:[0,1],project_obj:6,projectid:2,provid:[2,3,5,6],pub_dat:2,publish:[0,2,3,5],published_url:[0,2],pull:0,put:[0,2,3,6],pyflak:0,pypi:[0,4],python:[0,3],quickli:0,rais:0,ralph:2,raw:2,read:3,readthedoc:0,reassign:6,receiv:2,record:[2,6],recreat:2,refactor:0,relat:2,related_articl:2,related_url:0,relev:5,report:[0,2,3,6],repositori:4,repres:[2,6],represent:2,request:[0,3],requir:0,reserv:[0,2],resller:2,resourc:[2,5],restrict:[0,2],result:2,retri:0,retriev:0,review:2,richard:2,right:5,ruben:[2,3,6],run:0,salazar:[2,3,6],same:6,sampl:3,save:[0,2,3,6],search:0,second:6,section:[],section_obj:5,secur:0,semant:0,sent:[0,3],servic:[2,3],setup:0,sha1:2,sha:2,shane:[0,1],shemesh:2,sheriff:2,shifflet:[0,1],should:2,sim:2,simpl:4,sinc:3,site:[3,6],size:[0,2],slain:6,small:2,small_imag:2,small_image_url:2,small_image_url_list:2,smarter:0,some:2,sourc:[2,6],space:5,special:2,specif:2,specifi:[2,3],split:2,stamp:6,state:2,statist:2,store:[0,2,3],stori:2,string:[0,2],stringio:3,stuff:3,submit:[0,2],summari:[2,6],supplementari:2,support:0,suppos:5,surround:5,system:[0,2,5,6],tabl:5,talk:3,team:1,tear:6,term:2,test:[0,2,4],text:[2,3,4,5],thank:0,thei:2,them:[2,3,4],thi:[1,2,3,5,6],thing:[2,3],third:3,those:2,three:2,through:[2,3],thumbnail:2,thumbnail_imag:2,thumbnail_image_url:2,thumbnail_image_url_list:2,time:[2,3,6],titl:[0,2,3,5,6],top:5,travi:4,travisci:0,tri:0,tupl:6,tutori:3,txt:[0,2],type:5,typic:[2,6],unicod:0,uniqu:[2,5,6],unit:0,unlik:2,updat:2,updated_at:2,upload:0,upload_directori:[0,2,3],url:0,urllib:3,urlopen:3,user:[0,2,5],usernam:[2,3,6],usp:6,valu:[2,5],vari:2,version:0,via:[0,2],visibl:2,walk:3,wallac:2,want:[2,3],warn:[2,3],web:[0,3],weight:5,welsh:[1,2],what:2,when:[0,2,5,6],where:[2,5],whether:6,which:[2,5],whitworth:2,who:[1,2],wide:3,within:[2,5],without:[0,1,3],world:3,would:[1,2,3],wrapper:4,www:3,you:[0,2,3,6],your:[3,4],yourself:2},titles:["Changelog","Credits","Documents","Getting started","python-documentcloud","Other objects","Projects"],titleterms:{annot:5,changelog:0,client:3,contribut:4,creat:3,creation:6,credit:1,directori:3,document:[2,3,4],documentcloud:4,edit:[2,6],entiti:5,featur:4,from:3,get:3,instal:3,interact:3,locat:5,mention:5,metadata:[2,6],object:5,other:5,pdf:3,project:[3,6],python:4,retriev:[2,6],search:3,section:5,secur:3,start:3,upload:[2,3],url:3}}) -------------------------------------------------------------------------------- /docs/_build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | }, 128 | 129 | /** 130 | * i18n support 131 | */ 132 | TRANSLATIONS : {}, 133 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 134 | LOCALE : 'unknown', 135 | 136 | // gettext and ngettext don't access this so that the functions 137 | // can safely bound to a different name (_ = Documentation.gettext) 138 | gettext : function(string) { 139 | var translated = Documentation.TRANSLATIONS[string]; 140 | if (typeof translated == 'undefined') 141 | return string; 142 | return (typeof translated == 'string') ? translated : translated[0]; 143 | }, 144 | 145 | ngettext : function(singular, plural, n) { 146 | var translated = Documentation.TRANSLATIONS[singular]; 147 | if (typeof translated == 'undefined') 148 | return (n == 1) ? singular : plural; 149 | return translated[Documentation.PLURALEXPR(n)]; 150 | }, 151 | 152 | addTranslations : function(catalog) { 153 | for (var key in catalog.messages) 154 | this.TRANSLATIONS[key] = catalog.messages[key]; 155 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 156 | this.LOCALE = catalog.locale; 157 | }, 158 | 159 | /** 160 | * add context elements like header anchor links 161 | */ 162 | addContextElements : function() { 163 | $('div[id] > :header:first').each(function() { 164 | $('\u00B6'). 165 | attr('href', '#' + this.id). 166 | attr('title', _('Permalink to this headline')). 167 | appendTo(this); 168 | }); 169 | $('dt[id]').each(function() { 170 | $('\u00B6'). 171 | attr('href', '#' + this.id). 172 | attr('title', _('Permalink to this definition')). 173 | appendTo(this); 174 | }); 175 | }, 176 | 177 | /** 178 | * workaround a firefox stupidity 179 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 180 | */ 181 | fixFirefoxAnchorBug : function() { 182 | if (document.location.hash) 183 | window.setTimeout(function() { 184 | document.location.href += ''; 185 | }, 10); 186 | }, 187 | 188 | /** 189 | * highlight the search words provided in the url in the text 190 | */ 191 | highlightSearchWords : function() { 192 | var params = $.getQueryParameters(); 193 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 194 | if (terms.length) { 195 | var body = $('div.body'); 196 | if (!body.length) { 197 | body = $('body'); 198 | } 199 | window.setTimeout(function() { 200 | $.each(terms, function() { 201 | body.highlightText(this.toLowerCase(), 'highlighted'); 202 | }); 203 | }, 10); 204 | $('') 206 | .appendTo($('#searchbox')); 207 | } 208 | }, 209 | 210 | /** 211 | * init the domain index toggle buttons 212 | */ 213 | initIndexTable : function() { 214 | var togglers = $('img.toggler').click(function() { 215 | var src = $(this).attr('src'); 216 | var idnum = $(this).attr('id').substr(7); 217 | $('tr.cg-' + idnum).toggle(); 218 | if (src.substr(-9) == 'minus.png') 219 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 220 | else 221 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 222 | }).css('display', ''); 223 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 224 | togglers.click(); 225 | } 226 | }, 227 | 228 | /** 229 | * helper function to hide the search marks again 230 | */ 231 | hideSearchWords : function() { 232 | $('#searchbox .highlight-link').fadeOut(300); 233 | $('span.highlighted').removeClass('highlighted'); 234 | }, 235 | 236 | /** 237 | * make the url absolute 238 | */ 239 | makeURL : function(relativeURL) { 240 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 241 | }, 242 | 243 | /** 244 | * get the current relative url 245 | */ 246 | getCurrentURL : function() { 247 | var path = document.location.pathname; 248 | var parts = path.split(/\//); 249 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 250 | if (this == '..') 251 | parts.pop(); 252 | }); 253 | var url = parts.join('/'); 254 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 255 | } 256 | }; 257 | 258 | // quick alias for translations 259 | _ = Documentation.gettext; 260 | 261 | $(document).ready(function() { 262 | Documentation.init(); 263 | }); 264 | -------------------------------------------------------------------------------- /documentcloud/MultipartPostHandler.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | #### 4 | # 02/2006 Will Holcomb 5 | 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # 7/26/07 Slightly modified by Brian Schneider 17 | # in order to support unicode files ( multipart_encode function ) 18 | """ 19 | Usage: 20 | Enables the use of multipart/form-data for posting forms 21 | 22 | Inspirations: 23 | Upload files in python: 24 | http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306 25 | urllib2_file: 26 | Fabien Seisen: 27 | 28 | Example: 29 | import MultipartPostHandler, urllib2, cookielib 30 | 31 | cookies = cookielib.CookieJar() 32 | opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies), 33 | MultipartPostHandler.MultipartPostHandler) 34 | params = { "username" : "bob", "password" : "riviera", 35 | "file" : open("filename", "rb") } 36 | opener.open("http://wwww.bobsite.com/upload/", params) 37 | 38 | Further Example: 39 | The main function of this file is a sample which downloads a page and 40 | then uploads it to the W3C validator. 41 | """ 42 | import os 43 | import sys 44 | import six 45 | import tempfile 46 | import mimetypes 47 | from os import SEEK_END 48 | if six.PY3: 49 | import io 50 | import urllib.parse 51 | import urllib.request 52 | from email.generator import _make_boundary as choose_boundary 53 | else: 54 | import cStringIO as io 55 | from six.moves import urllib 56 | from mimetools import choose_boundary 57 | 58 | # Controls how sequences are uncoded. If true, elements 59 | # may be given multiple values byassigning a sequence. 60 | doseq = 1 61 | 62 | 63 | class PostHandler(urllib.request.BaseHandler): 64 | handler_order = urllib.request.HTTPHandler.handler_order - 10 65 | 66 | def http_request(self, request): 67 | try: 68 | data = request.get_data() 69 | except AttributeError: 70 | data = request.data 71 | if data is not None and type(data) != str: 72 | data = urllib.parse.urlencode(data, doseq).encode("utf-8") 73 | try: 74 | request.add_data(data) 75 | except AttributeError: 76 | request.data = data 77 | return request 78 | https_request = http_request 79 | 80 | 81 | class MultipartPostHandler(urllib.request.BaseHandler): 82 | # needs to run first 83 | handler_order = urllib.request.HTTPHandler.handler_order - 10 84 | 85 | def http_request(self, request): 86 | try: 87 | data = request.get_data() 88 | except AttributeError: 89 | data = request.data 90 | if data is not None and type(data) != str: 91 | v_files = [] 92 | v_vars = [] 93 | try: 94 | for(key, value) in list(data.items()): 95 | if hasattr(value, 'read'): 96 | v_files.append((key, value)) 97 | else: 98 | v_vars.append((key, value)) 99 | except TypeError: 100 | raise TypeError 101 | if len(v_files) == 0: 102 | data = urllib.parse.urlencode(v_vars, doseq) 103 | else: 104 | boundary, data = self.multipart_encode(v_vars, v_files) 105 | contenttype = 'multipart/form-data; boundary=%s' % boundary 106 | if ( 107 | request.has_header('Content-Type') and 108 | request.get_header('Content-Type').find( 109 | 'multipart/form-data') != 0 110 | ): 111 | six.print_( 112 | "Replacing %s with %s" % ( 113 | request.get_header('content-type'), 114 | 'multipart/form-data' 115 | ) 116 | ) 117 | request.add_unredirected_header('Content-Type', contenttype) 118 | try: 119 | request.add_data(data) 120 | except AttributeError: 121 | request.data = data 122 | 123 | return request 124 | 125 | def multipart_encode(self, v_vars, files, boundary=None, buf=None): 126 | if six.PY3: 127 | if boundary is None: 128 | boundary = choose_boundary() 129 | if buf is None: 130 | buf = io.BytesIO() 131 | for(key, value) in v_vars: 132 | buf.write(b'--' + boundary.encode("utf-8") + b'\r\n') 133 | buf.write( 134 | b'Content-Disposition: form-data; name="' + 135 | key.encode("utf-8") + 136 | b'"' 137 | ) 138 | buf.write(b'\r\n\r\n' + value.encode("utf-8") + b'\r\n') 139 | for(key, fd) in files: 140 | try: 141 | filename = fd.name.split('/')[-1] 142 | except AttributeError: 143 | # Spoof a file name if the object doesn't have one. 144 | # This is designed to catch when the user submits 145 | # a StringIO object 146 | filename = 'temp.pdf' 147 | contenttype = mimetypes.guess_type(filename)[0] or \ 148 | b'application/octet-stream' 149 | buf.write(b'--' + boundary.encode("utf-8") + b'\r\n') 150 | buf.write( 151 | b'Content-Disposition: form-data; ' + 152 | b'name="' + key.encode("utf-8") + b'"; ' + 153 | b'filename="' + filename.encode("utf-8") + b'"\r\n' 154 | ) 155 | buf.write( 156 | b'Content-Type: ' + 157 | contenttype.encode("utf-8") + 158 | b'\r\n' 159 | ) 160 | fd.seek(0) 161 | buf.write( 162 | b'\r\n' + fd.read() + b'\r\n' 163 | ) 164 | buf.write(b'--') 165 | buf.write(boundary.encode("utf-8")) 166 | buf.write(b'--\r\n\r\n') 167 | buf = buf.getvalue() 168 | return boundary, buf 169 | else: 170 | if boundary is None: 171 | boundary = choose_boundary() 172 | if buf is None: 173 | buf = io.StringIO() 174 | for(key, value) in v_vars: 175 | buf.write('--%s\r\n' % boundary) 176 | buf.write('Content-Disposition: form-data; name="%s"' % key) 177 | buf.write('\r\n\r\n' + value + '\r\n') 178 | for(key, fd) in files: 179 | try: 180 | filename = fd.name.split('/')[-1] 181 | except AttributeError: 182 | # Spoof a file name if the object doesn't have one. 183 | # This is designed to catch when the user submits 184 | # a StringIO object 185 | filename = 'temp.pdf' 186 | contenttype = mimetypes.guess_type(filename)[0] or \ 187 | 'application/octet-stream' 188 | buf.write('--%s\r\n' % boundary) 189 | buf.write('Content-Disposition: form-data; \ 190 | name="%s"; filename="%s"\r\n' % (key, filename)) 191 | buf.write('Content-Type: %s\r\n' % contenttype) 192 | # buffer += 'Content-Length: %s\r\n' % file_size 193 | fd.seek(0) 194 | buf.write('\r\n' + fd.read() + '\r\n') 195 | buf.write('--' + boundary + '--\r\n\r\n') 196 | buf = buf.getvalue() 197 | return boundary, buf 198 | https_request = http_request 199 | 200 | 201 | def getsize(o_file): 202 | """ 203 | get the size, either by seeeking to the end. 204 | """ 205 | startpos = o_file.tell() 206 | o_file.seek(0) 207 | o_file.seek(0, SEEK_END) 208 | size = o_file.tell() 209 | o_file.seek(startpos) 210 | return size 211 | 212 | 213 | def main(): 214 | opener = urllib.request.build_opener(MultipartPostHandler) 215 | 216 | def validateFile(url): 217 | temp = tempfile.mkstemp(suffix=".html") 218 | os.write(temp[0], opener.open(url).read()) 219 | os.remove(temp[1]) 220 | 221 | if len(sys.argv[1:]) > 0: 222 | for arg in sys.argv[1:]: 223 | validateFile(arg) 224 | else: 225 | validateFile("http://www.google.com") 226 | 227 | 228 | if __name__ == "__main__": 229 | main() 230 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # python-documentcloud documentation build configuration file, created by 4 | # sphinx-quickstart on Sat Mar 15 15:49:29 2014. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [] 32 | 33 | # Add any paths that contain templates here, relative to this directory. 34 | templates_path = ['_templates'] 35 | 36 | # The suffix of source filenames. 37 | source_suffix = '.rst' 38 | 39 | # The encoding of source files. 40 | #source_encoding = 'utf-8-sig' 41 | 42 | # The master toctree document. 43 | master_doc = 'index' 44 | 45 | # General information about the project. 46 | project = u'python-documentcloud' 47 | copyright = u'2014, Los Angeles Times Data Desk' 48 | 49 | # The version info for the project you're documenting, acts as replacement for 50 | # |version| and |release|, also used in various other places throughout the 51 | # built documents. 52 | # 53 | # The short X.Y version. 54 | version = '1.0.4' 55 | # The full version, including alpha/beta/rc tags. 56 | release = '1.0.4' 57 | 58 | # The language for content autogenerated by Sphinx. Refer to documentation 59 | # for a list of supported languages. 60 | #language = None 61 | 62 | # There are two options for replacing |today|: either, you set today to some 63 | # non-false value, then it is used: 64 | #today = '' 65 | # Else, today_fmt is used as the format for a strftime call. 66 | #today_fmt = '%B %d, %Y' 67 | 68 | # List of patterns, relative to source directory, that match files and 69 | # directories to ignore when looking for source files. 70 | exclude_patterns = ['_build'] 71 | 72 | # The reST default role (used for this markup: `text`) to use for all 73 | # documents. 74 | #default_role = None 75 | 76 | # If true, '()' will be appended to :func: etc. cross-reference text. 77 | #add_function_parentheses = True 78 | 79 | # If true, the current module name will be prepended to all description 80 | # unit titles (such as .. function::). 81 | #add_module_names = True 82 | 83 | # If true, sectionauthor and moduleauthor directives will be shown in the 84 | # output. They are ignored by default. 85 | #show_authors = False 86 | 87 | # The name of the Pygments (syntax highlighting) style to use. 88 | pygments_style = 'sphinx' 89 | 90 | # A list of ignored prefixes for module index sorting. 91 | #modindex_common_prefix = [] 92 | 93 | # If true, keep warnings as "system message" paragraphs in the built documents. 94 | #keep_warnings = False 95 | 96 | 97 | # -- Options for HTML output ---------------------------------------------- 98 | 99 | # The theme to use for HTML and HTML Help pages. See the documentation for 100 | # a list of builtin themes. 101 | html_theme = 'default' 102 | 103 | # Theme options are theme-specific and customize the look and feel of a theme 104 | # further. For a list of options available for each theme, see the 105 | # documentation. 106 | #html_theme_options = {} 107 | 108 | # Add any paths that contain custom themes here, relative to this directory. 109 | #html_theme_path = [] 110 | 111 | # The name for this set of Sphinx documents. If None, it defaults to 112 | # " v documentation". 113 | #html_title = None 114 | 115 | # A shorter title for the navigation bar. Default is the same as html_title. 116 | #html_short_title = None 117 | 118 | # The name of an image file (relative to this directory) to place at the top 119 | # of the sidebar. 120 | #html_logo = None 121 | 122 | # The name of an image file (within the static path) to use as favicon of the 123 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 124 | # pixels large. 125 | #html_favicon = None 126 | 127 | # Add any paths that contain custom static files (such as style sheets) here, 128 | # relative to this directory. They are copied after the builtin static files, 129 | # so a file named "default.css" will overwrite the builtin "default.css". 130 | html_static_path = ['_static'] 131 | 132 | # Add any extra paths that contain custom files (such as robots.txt or 133 | # .htaccess) here, relative to this directory. These files are copied 134 | # directly to the root of the documentation. 135 | #html_extra_path = [] 136 | 137 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 138 | # using the given strftime format. 139 | #html_last_updated_fmt = '%b %d, %Y' 140 | 141 | # If true, SmartyPants will be used to convert quotes and dashes to 142 | # typographically correct entities. 143 | #html_use_smartypants = True 144 | 145 | # Custom sidebar templates, maps document names to template names. 146 | #html_sidebars = {} 147 | 148 | # Additional templates that should be rendered to pages, maps page names to 149 | # template names. 150 | #html_additional_pages = {} 151 | 152 | # If false, no module index is generated. 153 | #html_domain_indices = True 154 | 155 | # If false, no index is generated. 156 | #html_use_index = True 157 | 158 | # If true, the index is split into individual pages for each letter. 159 | #html_split_index = False 160 | 161 | # If true, links to the reST sources are added to the pages. 162 | #html_show_sourcelink = True 163 | 164 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 165 | #html_show_sphinx = True 166 | 167 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 168 | #html_show_copyright = True 169 | 170 | # If true, an OpenSearch description file will be output, and all pages will 171 | # contain a tag referring to it. The value of this option must be the 172 | # base URL from which the finished HTML is served. 173 | #html_use_opensearch = '' 174 | 175 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 176 | #html_file_suffix = None 177 | 178 | # Output file base name for HTML help builder. 179 | htmlhelp_basename = 'python-documentclouddoc' 180 | 181 | 182 | # -- Options for LaTeX output --------------------------------------------- 183 | 184 | latex_elements = { 185 | # The paper size ('letterpaper' or 'a4paper'). 186 | #'papersize': 'letterpaper', 187 | 188 | # The font size ('10pt', '11pt' or '12pt'). 189 | #'pointsize': '10pt', 190 | 191 | # Additional stuff for the LaTeX preamble. 192 | #'preamble': '', 193 | } 194 | 195 | # Grouping the document tree into LaTeX files. List of tuples 196 | # (source start file, target name, title, 197 | # author, documentclass [howto, manual, or own class]). 198 | latex_documents = [ 199 | ('index', 'python-documentcloud.tex', u'python-documentcloud Documentation', 200 | u'Los Angeles Times Data Desk', 'manual'), 201 | ] 202 | 203 | # The name of an image file (relative to this directory) to place at the top of 204 | # the title page. 205 | #latex_logo = None 206 | 207 | # For "manual" documents, if this is true, then toplevel headings are parts, 208 | # not chapters. 209 | #latex_use_parts = False 210 | 211 | # If true, show page references after internal links. 212 | #latex_show_pagerefs = False 213 | 214 | # If true, show URL addresses after external links. 215 | #latex_show_urls = False 216 | 217 | # Documents to append as an appendix to all manuals. 218 | #latex_appendices = [] 219 | 220 | # If false, no module index is generated. 221 | #latex_domain_indices = True 222 | 223 | 224 | # -- Options for manual page output --------------------------------------- 225 | 226 | # One entry per manual page. List of tuples 227 | # (source start file, name, description, authors, manual section). 228 | man_pages = [ 229 | ('index', 'python-documentcloud', u'python-documentcloud Documentation', 230 | [u'Los Angeles Times Data Desk'], 1) 231 | ] 232 | 233 | # If true, show URL addresses after external links. 234 | #man_show_urls = False 235 | 236 | 237 | # -- Options for Texinfo output ------------------------------------------- 238 | 239 | # Grouping the document tree into Texinfo files. List of tuples 240 | # (source start file, target name, title, author, 241 | # dir menu entry, description, category) 242 | texinfo_documents = [ 243 | ('index', 'python-documentcloud', u'python-documentcloud Documentation', 244 | u'Los Angeles Times Data Desk', 'python-documentcloud', 'One line description of project.', 245 | 'Miscellaneous'), 246 | ] 247 | 248 | # Documents to append as an appendix to all manuals. 249 | #texinfo_appendices = [] 250 | 251 | # If false, no module index is generated. 252 | #texinfo_domain_indices = True 253 | 254 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 255 | #texinfo_show_urls = 'footnote' 256 | 257 | # If true, do not generate a @detailmenu in the "Top" node's menu. 258 | #texinfo_no_detailmenu = False 259 | -------------------------------------------------------------------------------- /docs/_build/html/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | python-documentcloud — python-documentcloud 1.0.3 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 |

python-documentcloud

50 |

A simple Python wrapper for the DocumentCloud API

51 |
52 |

Features

53 |
    54 |
  • Retrieve and edit documents and projects, both public and private, from documentcloud.org
  • 55 |
  • Upload PDFs into your documentcloud.org account and organize them into projects
  • 56 |
  • Download text, images and entities extracted from your PDFs by DocumentCloud
  • 57 |
58 |
59 |
60 |

Documentation

61 |
62 | 112 |
113 |
114 | 124 |
125 | 126 | 127 |
128 |
129 |
130 | 167 |
168 |
169 | 181 | 185 | 186 | -------------------------------------------------------------------------------- /docs/_build/html/changelog.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Changelog — python-documentcloud 1.0.3 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |
53 |

Changelog

54 |
55 |

1.0.3

56 |
    57 |
  • Encoding bug fix for metadata associated with documents via API
  • 58 |
59 |
60 |
61 |

1.0.2

62 |
    63 |
  • URLs to PDFs can now be submitted for upload
  • 64 |
  • Refactored setup.py and tests to be less complex
  • 65 |
66 |
67 |
68 |

1.0.1

69 |
    70 |
  • Python 3.4 testing
  • 71 |
  • 400MB upload limit to match DocumentCloud’s API restrictions
  • 72 |
73 |
74 |
75 |

1.0.0

76 |
    77 |
  • Adopted semantic versioning without breaking existing packages on PyPI
  • 78 |
  • Fixed bugs with get_page_text
  • 79 |
  • Added keyword argument during initialization that allows you to override the BASE_URI and connect with independent clones of DocumentCloud. Contributed by Adi Eyal.
  • 80 |
  • Refactored unit tests to run more quickly and require fewer web requests
  • 81 |
  • Documentation moved from the gh-pages branch to master and refactored to be published via ReadTheDocs.
  • 82 |
83 |
84 |
85 |

0.2

86 |
    87 |
  • Python 3 support
  • 88 |
  • PEP8 and PyFlakes compliance
  • 89 |
  • Coverage reports on testing via coveralls.io
  • 90 |
91 |
92 |
93 |

0.16

94 |
    95 |
  • Continuous integration testing with TravisCI
  • 96 |
  • Fixed bug with empty strings in Document descriptions
  • 97 |
  • Raise errors when a user tries to save a data keyword reserved by DocumentCloud
  • 98 |
  • Allow all-caps file extensions
  • 99 |
  • Retry requests that fail with an increasing backoff delay
  • 100 |
  • Fixed a bug in how titles are assigned to a file object
  • 101 |
  • Added access checks when retrieving txt, pdf, img about a document
  • 102 |
103 |
104 |
105 |

0.15

106 |
    107 |
  • File objects can now be submitted for uploading
  • 108 |
  • Added more support for unicode data thanks to contributions by Shane Shifflet.
  • 109 |
  • Smarter lazy loading of Document attributes missing from a search
  • 110 |
111 |
112 |
113 |

0.14

114 |
    115 |
  • Added data attribute on Document for storing dictionaries of arbitrary metadata
  • 116 |
  • Added secure option for Document uploads to prevent data from being sent to OpenCalais
  • 117 |
  • Added save alias on Document and Project objects that uses the pre-existing put command
  • 118 |
  • Fixed to url encoding to makes the system more unicode friendly
  • 119 |
  • Added all Document upload arguments to upload_directory method
  • 120 |
121 |
122 |
123 |

0.13

124 |
    125 |
  • upload_directory method for documents
  • 126 |
127 |
128 |
129 |

0.12

130 |
    131 |
  • get_or_create_by_title method for projects
  • 132 |
  • Document and project creation methods now return an object, not the new id.
  • 133 |
  • Projects can pulled by id or by title
  • 134 |
135 |
136 |
137 |

0.11

138 |
    139 |
  • Document search now returns mentions of the keyword in the documents
  • 140 |
  • related_url and published_url attributes now more easily accessible
  • 141 |
  • normal sized images now available
  • 142 |
143 |
144 |
145 | 146 | 147 |
148 |
149 |
150 | 198 |
199 |
200 | 215 | 219 | 220 | -------------------------------------------------------------------------------- /docs/_build/html/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/_build/html/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | } 56 | 57 | div.sphinxsidebar ul { 58 | list-style: none; 59 | } 60 | 61 | div.sphinxsidebar ul ul, 62 | div.sphinxsidebar ul.want-points { 63 | margin-left: 20px; 64 | list-style: square; 65 | } 66 | 67 | div.sphinxsidebar ul ul { 68 | margin-top: 0; 69 | margin-bottom: 0; 70 | } 71 | 72 | div.sphinxsidebar form { 73 | margin-top: 10px; 74 | } 75 | 76 | div.sphinxsidebar input { 77 | border: 1px solid #98dbcc; 78 | font-family: sans-serif; 79 | font-size: 1em; 80 | } 81 | 82 | div.sphinxsidebar #searchbox input[type="text"] { 83 | width: 170px; 84 | } 85 | 86 | div.sphinxsidebar #searchbox input[type="submit"] { 87 | width: 30px; 88 | } 89 | 90 | img { 91 | border: 0; 92 | max-width: 100%; 93 | } 94 | 95 | /* -- search page ----------------------------------------------------------- */ 96 | 97 | ul.search { 98 | margin: 10px 0 0 20px; 99 | padding: 0; 100 | } 101 | 102 | ul.search li { 103 | padding: 5px 0 5px 20px; 104 | background-image: url(file.png); 105 | background-repeat: no-repeat; 106 | background-position: 0 7px; 107 | } 108 | 109 | ul.search li a { 110 | font-weight: bold; 111 | } 112 | 113 | ul.search li div.context { 114 | color: #888; 115 | margin: 2px 0 0 30px; 116 | text-align: left; 117 | } 118 | 119 | ul.keywordmatches li.goodmatch a { 120 | font-weight: bold; 121 | } 122 | 123 | /* -- index page ------------------------------------------------------------ */ 124 | 125 | table.contentstable { 126 | width: 90%; 127 | } 128 | 129 | table.contentstable p.biglink { 130 | line-height: 150%; 131 | } 132 | 133 | a.biglink { 134 | font-size: 1.3em; 135 | } 136 | 137 | span.linkdescr { 138 | font-style: italic; 139 | padding-top: 5px; 140 | font-size: 90%; 141 | } 142 | 143 | /* -- general index --------------------------------------------------------- */ 144 | 145 | table.indextable { 146 | width: 100%; 147 | } 148 | 149 | table.indextable td { 150 | text-align: left; 151 | vertical-align: top; 152 | } 153 | 154 | table.indextable dl, table.indextable dd { 155 | margin-top: 0; 156 | margin-bottom: 0; 157 | } 158 | 159 | table.indextable tr.pcap { 160 | height: 10px; 161 | } 162 | 163 | table.indextable tr.cap { 164 | margin-top: 10px; 165 | background-color: #f2f2f2; 166 | } 167 | 168 | img.toggler { 169 | margin-right: 3px; 170 | margin-top: 3px; 171 | cursor: pointer; 172 | } 173 | 174 | div.modindex-jumpbox { 175 | border-top: 1px solid #ddd; 176 | border-bottom: 1px solid #ddd; 177 | margin: 1em 0 1em 0; 178 | padding: 0.4em; 179 | } 180 | 181 | div.genindex-jumpbox { 182 | border-top: 1px solid #ddd; 183 | border-bottom: 1px solid #ddd; 184 | margin: 1em 0 1em 0; 185 | padding: 0.4em; 186 | } 187 | 188 | /* -- general body styles --------------------------------------------------- */ 189 | 190 | a.headerlink { 191 | visibility: hidden; 192 | } 193 | 194 | h1:hover > a.headerlink, 195 | h2:hover > a.headerlink, 196 | h3:hover > a.headerlink, 197 | h4:hover > a.headerlink, 198 | h5:hover > a.headerlink, 199 | h6:hover > a.headerlink, 200 | dt:hover > a.headerlink, 201 | caption:hover > a.headerlink, 202 | p.caption:hover > a.headerlink, 203 | div.code-block-caption:hover > a.headerlink { 204 | visibility: visible; 205 | } 206 | 207 | div.body p.caption { 208 | text-align: inherit; 209 | } 210 | 211 | div.body td { 212 | text-align: left; 213 | } 214 | 215 | .field-list ul { 216 | padding-left: 1em; 217 | } 218 | 219 | .first { 220 | margin-top: 0 !important; 221 | } 222 | 223 | p.rubric { 224 | margin-top: 30px; 225 | font-weight: bold; 226 | } 227 | 228 | img.align-left, .figure.align-left, object.align-left { 229 | clear: left; 230 | float: left; 231 | margin-right: 1em; 232 | } 233 | 234 | img.align-right, .figure.align-right, object.align-right { 235 | clear: right; 236 | float: right; 237 | margin-left: 1em; 238 | } 239 | 240 | img.align-center, .figure.align-center, object.align-center { 241 | display: block; 242 | margin-left: auto; 243 | margin-right: auto; 244 | } 245 | 246 | .align-left { 247 | text-align: left; 248 | } 249 | 250 | .align-center { 251 | text-align: center; 252 | } 253 | 254 | .align-right { 255 | text-align: right; 256 | } 257 | 258 | /* -- sidebars -------------------------------------------------------------- */ 259 | 260 | div.sidebar { 261 | margin: 0 0 0.5em 1em; 262 | border: 1px solid #ddb; 263 | padding: 7px 7px 0 7px; 264 | background-color: #ffe; 265 | width: 40%; 266 | float: right; 267 | } 268 | 269 | p.sidebar-title { 270 | font-weight: bold; 271 | } 272 | 273 | /* -- topics ---------------------------------------------------------------- */ 274 | 275 | div.topic { 276 | border: 1px solid #ccc; 277 | padding: 7px 7px 0 7px; 278 | margin: 10px 0 10px 0; 279 | } 280 | 281 | p.topic-title { 282 | font-size: 1.1em; 283 | font-weight: bold; 284 | margin-top: 10px; 285 | } 286 | 287 | /* -- admonitions ----------------------------------------------------------- */ 288 | 289 | div.admonition { 290 | margin-top: 10px; 291 | margin-bottom: 10px; 292 | padding: 7px; 293 | } 294 | 295 | div.admonition dt { 296 | font-weight: bold; 297 | } 298 | 299 | div.admonition dl { 300 | margin-bottom: 0; 301 | } 302 | 303 | p.admonition-title { 304 | margin: 0px 10px 5px 0px; 305 | font-weight: bold; 306 | } 307 | 308 | div.body p.centered { 309 | text-align: center; 310 | margin-top: 25px; 311 | } 312 | 313 | /* -- tables ---------------------------------------------------------------- */ 314 | 315 | table.docutils { 316 | border: 0; 317 | border-collapse: collapse; 318 | } 319 | 320 | table caption span.caption-number { 321 | font-style: italic; 322 | } 323 | 324 | table caption span.caption-text { 325 | } 326 | 327 | table.docutils td, table.docutils th { 328 | padding: 1px 8px 1px 5px; 329 | border-top: 0; 330 | border-left: 0; 331 | border-right: 0; 332 | border-bottom: 1px solid #aaa; 333 | } 334 | 335 | table.field-list td, table.field-list th { 336 | border: 0 !important; 337 | } 338 | 339 | table.footnote td, table.footnote th { 340 | border: 0 !important; 341 | } 342 | 343 | th { 344 | text-align: left; 345 | padding-right: 5px; 346 | } 347 | 348 | table.citation { 349 | border-left: solid 1px gray; 350 | margin-left: 1px; 351 | } 352 | 353 | table.citation td { 354 | border-bottom: none; 355 | } 356 | 357 | /* -- figures --------------------------------------------------------------- */ 358 | 359 | div.figure { 360 | margin: 0.5em; 361 | padding: 0.5em; 362 | } 363 | 364 | div.figure p.caption { 365 | padding: 0.3em; 366 | } 367 | 368 | div.figure p.caption span.caption-number { 369 | font-style: italic; 370 | } 371 | 372 | div.figure p.caption span.caption-text { 373 | } 374 | 375 | 376 | /* -- other body styles ----------------------------------------------------- */ 377 | 378 | ol.arabic { 379 | list-style: decimal; 380 | } 381 | 382 | ol.loweralpha { 383 | list-style: lower-alpha; 384 | } 385 | 386 | ol.upperalpha { 387 | list-style: upper-alpha; 388 | } 389 | 390 | ol.lowerroman { 391 | list-style: lower-roman; 392 | } 393 | 394 | ol.upperroman { 395 | list-style: upper-roman; 396 | } 397 | 398 | dl { 399 | margin-bottom: 15px; 400 | } 401 | 402 | dd p { 403 | margin-top: 0px; 404 | } 405 | 406 | dd ul, dd table { 407 | margin-bottom: 10px; 408 | } 409 | 410 | dd { 411 | margin-top: 3px; 412 | margin-bottom: 10px; 413 | margin-left: 30px; 414 | } 415 | 416 | dt:target, .highlighted { 417 | background-color: #fbe54e; 418 | } 419 | 420 | dl.glossary dt { 421 | font-weight: bold; 422 | font-size: 1.1em; 423 | } 424 | 425 | .field-list ul { 426 | margin: 0; 427 | padding-left: 1em; 428 | } 429 | 430 | .field-list p { 431 | margin: 0; 432 | } 433 | 434 | .optional { 435 | font-size: 1.3em; 436 | } 437 | 438 | .sig-paren { 439 | font-size: larger; 440 | } 441 | 442 | .versionmodified { 443 | font-style: italic; 444 | } 445 | 446 | .system-message { 447 | background-color: #fda; 448 | padding: 5px; 449 | border: 3px solid red; 450 | } 451 | 452 | .footnote:target { 453 | background-color: #ffa; 454 | } 455 | 456 | .line-block { 457 | display: block; 458 | margin-top: 1em; 459 | margin-bottom: 1em; 460 | } 461 | 462 | .line-block .line-block { 463 | margin-top: 0; 464 | margin-bottom: 0; 465 | margin-left: 1.5em; 466 | } 467 | 468 | .guilabel, .menuselection { 469 | font-family: sans-serif; 470 | } 471 | 472 | .accelerator { 473 | text-decoration: underline; 474 | } 475 | 476 | .classifier { 477 | font-style: oblique; 478 | } 479 | 480 | abbr, acronym { 481 | border-bottom: dotted 1px; 482 | cursor: help; 483 | } 484 | 485 | /* -- code displays --------------------------------------------------------- */ 486 | 487 | pre { 488 | overflow: auto; 489 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 490 | } 491 | 492 | td.linenos pre { 493 | padding: 5px 0px; 494 | border: 0; 495 | background-color: transparent; 496 | color: #aaa; 497 | } 498 | 499 | table.highlighttable { 500 | margin-left: 0.5em; 501 | } 502 | 503 | table.highlighttable td { 504 | padding: 0 0.5em 0 0.5em; 505 | } 506 | 507 | div.code-block-caption { 508 | padding: 2px 5px; 509 | font-size: small; 510 | } 511 | 512 | div.code-block-caption code { 513 | background-color: transparent; 514 | } 515 | 516 | div.code-block-caption + div > div.highlight > pre { 517 | margin-top: 0; 518 | } 519 | 520 | div.code-block-caption span.caption-number { 521 | padding: 0.1em 0.3em; 522 | font-style: italic; 523 | } 524 | 525 | div.code-block-caption span.caption-text { 526 | } 527 | 528 | div.literal-block-wrapper { 529 | padding: 1em 1em 0; 530 | } 531 | 532 | div.literal-block-wrapper div.highlight { 533 | margin: 0; 534 | } 535 | 536 | code.descname { 537 | background-color: transparent; 538 | font-weight: bold; 539 | font-size: 1.2em; 540 | } 541 | 542 | code.descclassname { 543 | background-color: transparent; 544 | } 545 | 546 | code.xref, a code { 547 | background-color: transparent; 548 | font-weight: bold; 549 | } 550 | 551 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 552 | background-color: transparent; 553 | } 554 | 555 | .viewcode-link { 556 | float: right; 557 | } 558 | 559 | .viewcode-back { 560 | float: right; 561 | font-family: sans-serif; 562 | } 563 | 564 | div.viewcode-block:target { 565 | margin: -1px -10px; 566 | padding: 0 10px; 567 | } 568 | 569 | /* -- math display ---------------------------------------------------------- */ 570 | 571 | img.math { 572 | vertical-align: middle; 573 | } 574 | 575 | div.body div.math p { 576 | text-align: center; 577 | } 578 | 579 | span.eqno { 580 | float: right; 581 | } 582 | 583 | /* -- printout stylesheet --------------------------------------------------- */ 584 | 585 | @media print { 586 | div.document, 587 | div.documentwrapper, 588 | div.bodywrapper { 589 | margin: 0 !important; 590 | width: 100%; 591 | } 592 | 593 | div.sphinxsidebar, 594 | div.related, 595 | div.footer, 596 | #top-link { 597 | display: none; 598 | } 599 | } -------------------------------------------------------------------------------- /docs/_build/html/otherobjects.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Other objects — python-documentcloud 1.0.3 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |
53 |

Other objects

54 |

Other types of data provided by the DocumentCloud system.

55 |
56 |

Annotations

57 |

Notes left in documents.

58 |
59 |
60 | annotation_obj.access
61 |

The privacy level of the resource within the DocumentCloud system. It will be either public or private.

62 |
63 | 64 |
65 |
66 | annotation_obj.description
67 |

Space for a lengthy text block that will be published below the highlighted text in the DocumentCloud design.

68 |
69 | 70 |
71 |
72 | annotation_obj.id
73 |

The unique identifer of the document in DocumentCloud’s system.

74 |
75 | 76 |
77 |
78 | annotation_obj.location
79 |

The location of where the annotation appears on the document’s page. Defined by the Locations class.

80 |
81 | 82 |
83 |
84 | annotation_obj.page
85 |

The page where the annotation appears.

86 |
87 | 88 |
89 |
90 | annotation_obj.title
91 |

The name of the annotation, which appears in the table of contents and above the highlighted text when published by DocumentCloud.

92 |
93 | 94 |
95 |
96 |

Entities

97 |

Keywords extracted from documents with OpenCalais.

98 |
99 |
100 | location_obj.relevance
101 |

The weighting associated with this connection by OpenCalais. Higher numbers are supposed to be more relevant.

102 |
103 | 104 |
105 |
106 | location_obj.type
107 |

The category of entity the value belongs to.

108 |
109 | 110 |
111 |
112 | location_obj.value
113 |

The name of the entity extracted from the document (i.e. “Los Angeles” or “Museum of Modern Art”)

114 |
115 | 116 |
117 |
118 |

Locations

119 |

The location where Annotations are placed within a document.

120 |
121 |
122 | location_obj.bottom
123 |

The value of the bottom edge of an annotation.

124 |
125 | 126 |
127 |
128 | location_obj.left
129 |

The value of the left edge of an annotation.

130 |
131 | 132 |
133 |
134 | location_obj.right
135 |

The value of the right edge of an annotation.

136 |
137 | 138 |
139 |
140 | location_obj.top
141 |

The value of the top edge of an annotation.

142 |
143 | 144 |
145 |
146 |

Mentions

147 |

Mentions of a search keyword found in one of the documents.

148 |
149 |
150 | mention_obj.page
151 |

The page where the mention occurs.

152 |
153 | 154 |
155 |
156 | mention_obj.text
157 |

The text surrounding the mention of the keyword.

158 |
159 | 160 |
161 |
162 |

Sections

163 |

Sections of the documents earmarked by users.

164 |
165 |
166 | section_obj.title
167 |

The name of the section.

168 |
169 | 170 |
171 |
172 | section_obj.page
173 |

The page where the section begins.

174 |
175 | 176 |
177 |
178 | 179 | 180 |
181 |
182 |
183 | 225 |
226 |
227 | 242 | 246 | 247 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/documents.txt: -------------------------------------------------------------------------------- 1 | Documents 2 | ========= 3 | 4 | Methods for drawing down, editing and uploading data about documents. 5 | 6 | Retrieval 7 | --------- 8 | 9 | .. function:: client.documents.get(id) 10 | 11 | Return the document with the provided DocumentCloud identifer. :: 12 | 13 | >>> from documentcloud import DocumentCloud 14 | >>> client = DocumentCloud(USERNAME, PASSWORD) 15 | >>> client.documents.get('71072-oir-final-report') 16 | 17 | 18 | 19 | .. function:: client.documents.search(keyword, page=None, per_page=1000, mentions=3, data=False) 20 | 21 | Return a list of documents that match the provided keyword. :: 22 | 23 | >>> from documentcloud import DocumentCloud 24 | >>> client = DocumentCloud() 25 | >>> obj_list = client.documents.search('Ruben Salazar') 26 | >>> obj_list[0] 27 | 28 | 29 | DocumentCloud paginates search results. By default the search methods returns 30 | from all pages. If you want to restrict the number of pages that are searched 31 | or retrieve a specific page you should provide some combination of the following 32 | keyword arguments. :: 33 | 34 | >>> obj_list = client.documents.search('Ruben Salazar', page=1, per_page=10) 35 | >>> # You can guess that will do. 36 | >>> len(obj_list) == 10 37 | >>> True 38 | 39 | By default, the search returns three mentions of the result in each document. 40 | You can increase that number up to 10 by modifying the keyword argument. :: 41 | 42 | >>> client.documents.search('Ruben Salazar', mentions=10) 43 | 44 | Unlike when you get a document directly via id, the key/value dictionaries 45 | they can be assigned are not provided by default in search results. :: 46 | 47 | To have them included, switch the following keyword argument. 48 | 49 | >>> client.documents.search('Ruben Salazar', data=True) 50 | 51 | 52 | Editing 53 | ------- 54 | 55 | .. method:: document_obj.put() 56 | 57 | Save changes to a document back to DocumentCloud. You must be authorized to make these changes. Only the ``title``, ``source``, ``description``, ``related_article``, ``published_url``, ``access`` and ``data`` attributes may be edited. :: 58 | 59 | >>> # Grab a document 60 | >>> obj = client.documents.get('71072-oir-final-report') 61 | >>> print obj.title 62 | Draft OIR Report 63 | >>> # Change its title 64 | >>> obj.title = "Brand new title" 65 | >>> print obj.title 66 | Brand New Title 67 | >>> # Save those changes 68 | >>> obj.put() 69 | 70 | .. method:: document_obj.delete() 71 | 72 | Delete a document from DocumentCloud. You must be authorized to make these changes. :: 73 | 74 | >>> obj = client.documents.get('71072-oir-final-report') 75 | >>> obj.delete() 76 | 77 | .. method:: document_obj.save() 78 | 79 | An alias for ``put`` that saves changes back to DocumentCloud. 80 | 81 | Uploading 82 | --------- 83 | 84 | .. function:: client.documents.upload(pdf, title=None, source=None, description=None, related_article=None, published_url=None, access='private', project=None, data=None, secure=False) 85 | 86 | Upload a PDF to DocumentCloud. You must be authorized to do this. Returns the object representing the new record you've created. You can submit either a file path or a file object. 87 | 88 | >>> from documentcloud import DocumentCloud 89 | >>> client = DocumentCloud(USERNAME, PASSWORD) 90 | >>> new_id = client.documents.upload("/home/ben/test.pdf", "Test PDF") 91 | >>> # Now fetch it 92 | >>> client.documents.get(new_id) 93 | 94 | 95 | You can also URLs link to PDFs, if that's the kind of thing you want to do. 96 | 97 | >>> client.documents.upload("http://ord.legistar.com/Chicago/attachments/e3a0cbcb-044d-4ec3-9848-23c5692b1943.pdf") 98 | 99 | .. function:: client.documents.upload_directory(pdf, source=None, description=None, related_article=None, published_url=None, access='private', project=None, data=None, secure=False) 100 | 101 | Searches through the provided path and attempts to upload all the PDFs it can find. Metadata provided to the other keyword arguments will be recorded for all uploads. Returns a list of document objects that are created. Be warned, this will upload any documents in directories inside the path you specify. 102 | 103 | >>> from documentcloud import DocumentCloud 104 | >>> client = DocumentCloud(DOCUMENTCLOUD_USERNAME, DOCUMENTCLOUD_PASSWORD) 105 | >>> obj_list = client.documents.upload_directory('/home/ben/pdfs/groucho_marx/') 106 | 107 | Metadata 108 | -------- 109 | 110 | .. attribute:: document_obj.access 111 | 112 | The privacy level of the resource within the DocumentCloud system. It will be either ``public``, ``private`` or ``organization``, the last of which means the is only visible to members of the contributors organization. Can be edited and saved with a put command. 113 | 114 | .. attribute:: document_obj.annotations 115 | 116 | A list of the annotations users have left on the document. The data are modeled by their own Python class, defined in the :ref:`annotations` section. 117 | 118 | >>> obj = client.documents.get('83251-fbi-file-on-christopher-biggie-smalls-wallace') 119 | >>> obj.annotations 120 | [, , , , ] 121 | 122 | .. attribute:: document_obj.canonical_url 123 | 124 | The URL where the document is hosted at documentcloud.org. 125 | 126 | .. attribute:: document_obj.contributor 127 | 128 | The user who originally uploaded the document. 129 | 130 | .. attribute:: document_obj.contributor_organization 131 | 132 | The organizational affiliation of the user who originally uploaded the document. 133 | 134 | .. attribute:: document_obj.created_at 135 | 136 | The date and time that the document was created, in Python's datetime format. 137 | 138 | .. attribute:: document_obj.data 139 | 140 | A dictionary containing supplementary data linked to the document. This can any old thing. It's useful if you'd like to store additional metadata. Can be edited and saved with a put command. 141 | 142 | Some keywords are reserved by DocumentCloud and you'll get an error if you try to submit them here. They are: person, organization, place, term, email, phone, city, state, country, title, description, source, account, group, project, projectid, document, access, filter. 143 | 144 | >>> obj = client.documents.get('83251-fbi-file-on-christopher-biggie-smalls-wallace') 145 | >>> obj.data 146 | {'category': 'hip-hop', 'byline': 'Ben Welsh', 'pub_date': datetime.date(2011, 3, 1)} 147 | 148 | .. attribute:: document_obj.description 149 | 150 | A summary of the document. Can be edited and saved with a put command. 151 | 152 | .. attribute:: document_obj.entities 153 | 154 | A list of the entities extracted from the document by `OpenCalais `_. The data are modeled by their own Python class, defined in the :ref:`entities` section. 155 | 156 | >>> obj = client.documents.get('83251-fbi-file-on-christopher-biggie-smalls-wallace') 157 | >>> obj.entities 158 | [, , , , ... 159 | 160 | .. attribute:: document_obj.file_hash 161 | 162 | A hash representation of the raw PDF data as a hexadecimal string. 163 | 164 | >>> obj = client.documents.get('1021571-lafd-2013-hiring-statistics') 165 | >>> obj.file_hash 166 | '872b9b858f5f3e6bb6086fec7f05dd464b60eb26' 167 | 168 | You could recreate this hexadecimal hash yourself using the `SHA-1 algorithm `_. 169 | 170 | >>> import hashlib 171 | >>> hashlib.sha1(obj.pdf).hexdigest() 172 | '872b9b858f5f3e6bb6086fec7f05dd464b60eb26' 173 | 174 | .. attribute:: document_obj.full_text 175 | 176 | Returns the full text of the document, as extracted from the original PDF by DocumentCloud. Results may vary, but this will give you what they got. Currently, DocumentCloud only makes this available for public documents. 177 | 178 | >>> obj = client.documents.get('71072-oir-final-report') 179 | >>> obj.full_text 180 | "Review of the Los Angeles County Sheriff's\nDepartment's Investigation into the\nHomicide of Ruben Salazar\nA Special Report by the\nLos Angeles County Office of Independent Review\n ... 181 | 182 | .. attribute:: document_obj.full_text_url 183 | 184 | Returns the URL that contains the full text of the document, as extracted from the original PDF by DocumentCloud. 185 | 186 | .. method:: document_obj.get_page_text(page) 187 | 188 | Submit a page number and receive the raw text extracted from it by DocumentCloud. 189 | 190 | >>> obj = client.documents.get('1088501-adventuretime-alta') 191 | >>> txt = obj.get_page_text(1) 192 | # Let's print just the first line 193 | >>> print txt.decode().split("\n")[0] 194 | STATE OF CALIFORNIA- HEALTH AND HUMAN SERVICES AGENCY 195 | 196 | .. attribute:: document_obj.id 197 | 198 | The unique identifer of the document in DocumentCloud's system. Typically this is a string that begins with a number, like ``83251-fbi-file-on-christopher-biggie-s.malls-wallace`` 199 | 200 | .. attribute:: document_obj.large_image 201 | 202 | Returns the binary data for the "large" sized image of the document's first page. If you would like the data for some other page, pass the page number into ``document_obj.get_large_image(page)``. Currently, DocumentCloud only makes this available for public documents. 203 | 204 | .. attribute:: document_obj.large_image_url 205 | 206 | Returns a URL containing the "large" sized image of the document's first page. If you would like the URL for some other page, pass the page number into ``document_obj.get_large_image_url(page)``. 207 | 208 | .. attribute:: document_obj.large_image_url_list 209 | 210 | Returns a list of URLs for the "large" sized image of every page in the document. 211 | 212 | .. attribute:: document_obj.mentions 213 | 214 | When the document has been retrieved via a search, this returns a list of places the search keywords appear in the text. The data are modeled by their own Python class, defined in the :ref:`mentions` section. 215 | 216 | >>> obj_list = client.documents.search('Christopher Wallace') 217 | >>> obj = obj_list[0] 218 | >>> obj.mentions 219 | [, .... 220 | 221 | .. attribute:: document_obj.normal_image 222 | 223 | Returns the binary data for the "normal" sized image of the document's first page. If you would like the data for some other page, pass the page number into ``document_obj.get_normal_image(page)``. Currently, DocumentCloud only makes this available for public documents. 224 | 225 | .. attribute:: document_obj.normal_image_url 226 | 227 | Returns a URL containing the "normal" sized image of the document's first page. If you would like the URL for some other page, pass the page number into ``document_obj.get_normal_image_url(page)``. 228 | 229 | .. attribute:: document_obj.normal_image_url_list 230 | 231 | Returns a list of URLs for the "normal" sized image of every page in the document. 232 | 233 | .. attribute:: document_obj.pages 234 | 235 | The number of pages in the document. 236 | 237 | .. attribute:: document_obj.pdf 238 | 239 | Returns the binary data for document's original PDF file. Currently, DocumentCloud only makes this available for public documents. 240 | 241 | .. attribute:: document_obj.pdf_url 242 | 243 | Returns a URL containing the binary data for document's original PDF file. 244 | 245 | .. attribute:: document_obj.published_url 246 | 247 | Returns an URL outside of documentcloud.org where this document has been published. 248 | 249 | .. attribute:: document_obj.related_article 250 | 251 | Returns an URL for a news story related to this document. 252 | 253 | .. attribute:: document_obj.sections 254 | 255 | A list of the sections earmarked in the text by a user. The data are modeled by their own Python class, defined in the :ref:`sections` section. 256 | 257 | >>> obj = client.documents.get('74103-report-of-the-calpers-special-review') 258 | >>> obj.sections 259 | [, , ... 260 | 261 | .. attribute:: document_obj.small_image 262 | 263 | Returns the binary data for the "small" sized image of the document's first page. If you would like the data for some other page, pass the page number into ``document_obj.get_small_image(page)``. Currently, DocumentCloud only makes this available for public documents. 264 | 265 | .. attribute:: document_obj.small_image_url 266 | 267 | Returns a URL containing the "small" sized image of the document's first page. If you would like the URL for some other page, pass the page number into ``document_obj.get_small_image_url(page)``. 268 | 269 | .. attribute:: document_obj.small_image_url_list 270 | 271 | Returns a list of URLs for the "small" sized image of every page in the document. 272 | 273 | .. attribute:: document_obj.source 274 | 275 | The original source of the document. Can be edited and saved with a put command. 276 | 277 | .. attribute:: document_obj.thumbnail_image 278 | 279 | Returns the binary data for the "thumbnail" sized image of the document's first page. If you would like the data for some other page, pass the page number into ``document_obj.get_thumbnail_image(page)``. Currently, DocumentCloud only makes this available for public documents. 280 | 281 | .. attribute:: document_obj.thumbnail_image_url 282 | 283 | Returns a URL containing the "thumbnail" sized image of the document's first page. If you would like the URL for some other page, pass the page number into ``document_obj.get_small_thumbnail_url(page)``. 284 | 285 | .. attribute:: document_obj.thumbnail_image_url_list 286 | 287 | Returns a list of URLs for the "small" sized image of every page in the document. 288 | 289 | .. attribute:: document_obj.title 290 | 291 | The name of the document. Can be edited and saved with a put command. 292 | 293 | .. attribute:: document_obj.updated_at 294 | 295 | The date and time that the document was last updated, in Python's datetime format. 296 | -------------------------------------------------------------------------------- /Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "8a56b46b4394e31ffd8db51b49ba17c6bb9e063f08d191269f1e71475e811a8b" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.6" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.python.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "python-dateutil": { 20 | "hashes": [ 21 | "sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0", 22 | "sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8" 23 | ], 24 | "index": "pypi", 25 | "version": "==2.7.3" 26 | }, 27 | "rfc3987": { 28 | "hashes": [ 29 | "sha256:10702b1e51e5658843460b189b185c0366d2cf4cff716f13111b0ea9fd2dce53", 30 | "sha256:d3c4d257a560d544e9826b38bc81db676890c79ab9d7ac92b39c7a253d5ca733" 31 | ], 32 | "index": "pypi", 33 | "version": "==1.3.8" 34 | }, 35 | "six": { 36 | "hashes": [ 37 | "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", 38 | "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" 39 | ], 40 | "index": "pypi", 41 | "version": "==1.11.0" 42 | } 43 | }, 44 | "develop": { 45 | "alabaster": { 46 | "hashes": [ 47 | "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", 48 | "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02" 49 | ], 50 | "version": "==0.7.12" 51 | }, 52 | "babel": { 53 | "hashes": [ 54 | "sha256:6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669", 55 | "sha256:8cba50f48c529ca3fa18cf81fa9403be176d374ac4d60738b839122dfaaa3d23" 56 | ], 57 | "version": "==2.6.0" 58 | }, 59 | "certifi": { 60 | "hashes": [ 61 | "sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c", 62 | "sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a" 63 | ], 64 | "version": "==2018.10.15" 65 | }, 66 | "chardet": { 67 | "hashes": [ 68 | "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", 69 | "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" 70 | ], 71 | "version": "==3.0.4" 72 | }, 73 | "coverage": { 74 | "hashes": [ 75 | "sha256:00d464797a236f654337181af72b4baea3d35d056ca480e45e9163bb5df496b8", 76 | "sha256:0a90afa6f5ea08889da9066dca3ce2ef85d47587e3f66ca06a4fa8d3a0053acc", 77 | "sha256:0ba6c4345e3c197f6a3ba924d155c402ad28c080ac0d79529493eb17582fbc41", 78 | "sha256:2be3748f45d2eb0259c3c93abccc15c10725ef715bf0817a4c0a1a1dad2abc6a", 79 | "sha256:50727512afe77e044c7d7f2fd4cd0fe62b06527f965b335a810d956748e0514d", 80 | "sha256:6c2fd127cd4e2decb0ab41fe3ac2948b87ad2ea0470e24b4be5f7e7fdfef8df3", 81 | "sha256:6ed521ed3800d8f8911642b9b3c3891780a929db5e572c88c4713c1032530f82", 82 | "sha256:76a73a48a308fb87a4417d630b0345d36166f489ef17ea5aa8e4596fb50a2296", 83 | "sha256:7eaa0a33423476ed63317ee0a53cc07c0e36b5a390e3e95b95152e7eb6b3a6f6", 84 | "sha256:845d0f8a1765074b3256f07ddbce2969e5a5316dfd0eb3289137010d7677326a", 85 | "sha256:85b1275b6d7a61ccc8024a4e9a4c9e896394776edce1a5d075ec116f91925462", 86 | "sha256:8e60e720cad3ee6b0a32f475ae4040552c5623870a9ca0d3d4263faa89a8d96b", 87 | "sha256:93c50475f189cd226e9688b9897a0cd3c4c5d9c90b1733fa8f6445cfc0182c51", 88 | "sha256:94c1e66610807a7917d967ed6415b9d5fde7487ab2a07bb5e054567865ef6ef0", 89 | "sha256:964f86394cb4d0fd2bb40ffcddca321acf4323b48d1aa5a93db8b743c8a00f79", 90 | "sha256:99043494b28d6460035dd9410269cdb437ee460edc7f96f07ab45c57ba95e651", 91 | "sha256:addf63b5e39d573c459c3930b25176146395c1dc1afce4710067bb5e6dc4ea58", 92 | "sha256:af2f59ce312523c384a7826821cae0b95f320fee1751387abba4f00eed737166", 93 | "sha256:af6ed80340e5e1b89fa794f730ce7597651fbda3312e500002688b679c184ef9", 94 | "sha256:beb96d32ce8cfa47ec6433d95a33e4afaa97c19ac1b4a47ea40a424fedfee7c2", 95 | "sha256:c00bac0f6b35b82ace069a6a0d88e8fd4cd18d964fc5e47329cd02b212397fbe", 96 | "sha256:d079e36baceea9707fd50b268305654151011274494a33c608c075808920eda8", 97 | "sha256:d3188345f1c7161d701fd2ea9150f9bb6e2df890f3ddd6c0aea1f525e21d1544", 98 | "sha256:e65c78bde155a734f0d624647c4d6e0f47fb4875355a0b95c37d537788737f4f", 99 | "sha256:e813cba9ff0e3d37ad31dc127fac85d23f9a26d0461ef8042ac4539b2045e781", 100 | "sha256:e96c13a40df389ce8cbb5ec108e5fb834989d1bedff5d8846e5aa3d270a5f3b6", 101 | "sha256:ee2338539157cfc35fb1d6757dd799126804df39393c4a6c5fe88b402c8c0ab4" 102 | ], 103 | "index": "pypi", 104 | "version": "==4.0.3" 105 | }, 106 | "docutils": { 107 | "hashes": [ 108 | "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", 109 | "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", 110 | "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6" 111 | ], 112 | "version": "==0.14" 113 | }, 114 | "filelock": { 115 | "hashes": [ 116 | "sha256:86fe6af56ae08ebc9c66d54ba3398c35b98916d0862d782b276a65816ff39392", 117 | "sha256:97694f181bdf58f213cca0a7cb556dc7bf90e2f8eb9aa3151260adac56701afb" 118 | ], 119 | "version": "==3.0.9" 120 | }, 121 | "flake8": { 122 | "hashes": [ 123 | "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", 124 | "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" 125 | ], 126 | "index": "pypi", 127 | "version": "==3.5.0" 128 | }, 129 | "idna": { 130 | "hashes": [ 131 | "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", 132 | "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" 133 | ], 134 | "version": "==2.7" 135 | }, 136 | "imagesize": { 137 | "hashes": [ 138 | "sha256:3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", 139 | "sha256:f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5" 140 | ], 141 | "version": "==1.1.0" 142 | }, 143 | "jinja2": { 144 | "hashes": [ 145 | "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", 146 | "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" 147 | ], 148 | "version": "==2.10" 149 | }, 150 | "markupsafe": { 151 | "hashes": [ 152 | "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" 153 | ], 154 | "version": "==1.0" 155 | }, 156 | "mccabe": { 157 | "hashes": [ 158 | "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", 159 | "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" 160 | ], 161 | "version": "==0.6.1" 162 | }, 163 | "packaging": { 164 | "hashes": [ 165 | "sha256:0886227f54515e592aaa2e5a553332c73962917f2831f1b0f9b9f4380a4b9807", 166 | "sha256:f95a1e147590f204328170981833854229bb2912ac3d5f89e2a8ccd2834800c9" 167 | ], 168 | "version": "==18.0" 169 | }, 170 | "pluggy": { 171 | "hashes": [ 172 | "sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095", 173 | "sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f" 174 | ], 175 | "version": "==0.8.0" 176 | }, 177 | "py": { 178 | "hashes": [ 179 | "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694", 180 | "sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6" 181 | ], 182 | "version": "==1.7.0" 183 | }, 184 | "pycodestyle": { 185 | "hashes": [ 186 | "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", 187 | "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" 188 | ], 189 | "version": "==2.3.1" 190 | }, 191 | "pyflakes": { 192 | "hashes": [ 193 | "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", 194 | "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" 195 | ], 196 | "version": "==1.6.0" 197 | }, 198 | "pygments": { 199 | "hashes": [ 200 | "sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d", 201 | "sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc" 202 | ], 203 | "version": "==2.2.0" 204 | }, 205 | "pyparsing": { 206 | "hashes": [ 207 | "sha256:bc6c7146b91af3f567cf6daeaec360bc07d45ffec4cf5353f4d7a208ce7ca30a", 208 | "sha256:d29593d8ebe7b57d6967b62494f8c72b03ac0262b1eed63826c6f788b3606401" 209 | ], 210 | "version": "==2.2.2" 211 | }, 212 | "python-coveralls": { 213 | "hashes": [ 214 | "sha256:1748272081e0fc21e2c20c12e5bd18cb13272db1b130758df0d473da0cb31087", 215 | "sha256:736dda01f64beda240e1500d5f264b969495b05fcb325c7c0eb7ebbfd1210b70" 216 | ], 217 | "index": "pypi", 218 | "version": "==2.9.1" 219 | }, 220 | "pytz": { 221 | "hashes": [ 222 | "sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053", 223 | "sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277" 224 | ], 225 | "version": "==2018.5" 226 | }, 227 | "pyyaml": { 228 | "hashes": [ 229 | "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b", 230 | "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf", 231 | "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a", 232 | "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3", 233 | "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1", 234 | "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1", 235 | "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613", 236 | "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04", 237 | "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f", 238 | "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537", 239 | "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531" 240 | ], 241 | "version": "==3.13" 242 | }, 243 | "requests": { 244 | "hashes": [ 245 | "sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c", 246 | "sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279" 247 | ], 248 | "version": "==2.20.0" 249 | }, 250 | "six": { 251 | "hashes": [ 252 | "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", 253 | "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" 254 | ], 255 | "index": "pypi", 256 | "version": "==1.11.0" 257 | }, 258 | "snowballstemmer": { 259 | "hashes": [ 260 | "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128", 261 | "sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89" 262 | ], 263 | "version": "==1.2.1" 264 | }, 265 | "sphinx": { 266 | "hashes": [ 267 | "sha256:652eb8c566f18823a022bb4b6dbc868d366df332a11a0226b5bc3a798a479f17", 268 | "sha256:d222626d8356de702431e813a05c68a35967e3d66c6cd1c2c89539bb179a7464" 269 | ], 270 | "index": "pypi", 271 | "version": "==1.8.1" 272 | }, 273 | "sphinxcontrib-websupport": { 274 | "hashes": [ 275 | "sha256:68ca7ff70785cbe1e7bccc71a48b5b6d965d79ca50629606c7861a21b206d9dd", 276 | "sha256:9de47f375baf1ea07cdb3436ff39d7a9c76042c10a769c52353ec46e4e8fc3b9" 277 | ], 278 | "version": "==1.1.0" 279 | }, 280 | "toml": { 281 | "hashes": [ 282 | "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", 283 | "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e", 284 | "sha256:f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3" 285 | ], 286 | "version": "==0.10.0" 287 | }, 288 | "tox": { 289 | "hashes": [ 290 | "sha256:217fb84aecf9792a98f93f07cfcaf014205a76c64e52bd7c2b4135458e6ad2a1", 291 | "sha256:4baeb3d8ebdcd9f43afce38aa67d06f1165a87d221d5bb21e8b39a0d4880c134" 292 | ], 293 | "index": "pypi", 294 | "version": "==3.5.2" 295 | }, 296 | "urllib3": { 297 | "hashes": [ 298 | "sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae", 299 | "sha256:8819bba37a02d143296a4d032373c4dd4aca11f6d4c9973335ca75f9c8475f59" 300 | ], 301 | "version": "==1.24" 302 | }, 303 | "virtualenv": { 304 | "hashes": [ 305 | "sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669", 306 | "sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752" 307 | ], 308 | "version": "==16.0.0" 309 | } 310 | } 311 | } 312 | -------------------------------------------------------------------------------- /docs/_build/html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index — python-documentcloud 1.0.3 documentation 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 | 40 |
41 |
42 |
43 |
44 | 45 | 46 |

Index

47 | 48 |
49 | A 50 | | B 51 | | C 52 | | D 53 | | E 54 | | F 55 | | G 56 | | I 57 | | L 58 | | M 59 | | N 60 | | P 61 | | R 62 | | S 63 | | T 64 | | U 65 | | V 66 | 67 |
68 |

A

69 | 70 | 82 | 88 |
71 | 72 |
access (annotation_obj attribute) 73 |
74 | 75 |
76 | 77 |
(document_obj attribute) 78 |
79 | 80 |
81 |
83 | 84 |
annotations (document_obj attribute) 85 |
86 | 87 |
89 | 90 |

B

91 | 92 | 98 |
93 | 94 |
bottom (location_obj attribute) 95 |
96 | 97 |
99 | 100 |

C

101 | 102 | 132 | 158 |
103 | 104 |
canonical_url (document_obj attribute) 105 |
106 | 107 | 108 |
client.documents.get() (built-in function) 109 |
110 | 111 | 112 |
client.documents.search() (built-in function) 113 |
114 | 115 | 116 |
client.documents.upload() (built-in function) 117 |
118 | 119 | 120 |
client.documents.upload_directory() (built-in function) 121 |
122 | 123 | 124 |
client.projects.all() (built-in function) 125 |
126 | 127 | 128 |
client.projects.get() (built-in function) 129 |
130 | 131 |
133 | 134 |
client.projects.get_by_id() (built-in function) 135 |
136 | 137 | 138 |
client.projects.get_by_title() (built-in function) 139 |
140 | 141 | 142 |
contributor (document_obj attribute) 143 |
144 | 145 | 146 |
contributor_organization (document_obj attribute) 147 |
148 | 149 | 150 |
create() (client.projects method) 151 |
152 | 153 | 154 |
created_at (document_obj attribute) 155 |
156 | 157 |
159 | 160 |

D

161 | 162 | 192 | 202 |
163 | 164 |
data (document_obj attribute) 165 |
166 | 167 | 168 |
delete() (document_obj method) 169 |
170 | 171 |
172 | 173 |
(project_obj method) 174 |
175 | 176 |
177 | 178 |
description (annotation_obj attribute) 179 |
180 | 181 |
182 | 183 |
(document_obj attribute) 184 |
185 | 186 | 187 |
(project_obj attribute) 188 |
189 | 190 |
191 |
193 | 194 |
document_ids (project_obj attribute) 195 |
196 | 197 | 198 |
document_list (project_obj attribute) 199 |
200 | 201 |
203 | 204 |

E

205 | 206 | 212 |
207 | 208 |
entities (document_obj attribute) 209 |
210 | 211 |
213 | 214 |

F

215 | 216 | 226 | 232 |
217 | 218 |
file_hash (document_obj attribute) 219 |
220 | 221 | 222 |
full_text (document_obj attribute) 223 |
224 | 225 |
227 | 228 |
full_text_url (document_obj attribute) 229 |
230 | 231 |
233 | 234 |

G

235 | 236 | 246 | 252 |
237 | 238 |
get_document() (project_obj method) 239 |
240 | 241 | 242 |
get_or_create_by_title() (client.projects method) 243 |
244 | 245 |
247 | 248 |
get_page_text() (document_obj method) 249 |
250 | 251 |
253 | 254 |

I

255 | 256 | 272 |
257 | 258 |
id (annotation_obj attribute) 259 |
260 | 261 |
262 | 263 |
(document_obj attribute) 264 |
265 | 266 | 267 |
(project_obj attribute) 268 |
269 | 270 |
271 |
273 | 274 |

L

275 | 276 | 290 | 300 |
277 | 278 |
large_image (document_obj attribute) 279 |
280 | 281 | 282 |
large_image_url (document_obj attribute) 283 |
284 | 285 | 286 |
large_image_url_list (document_obj attribute) 287 |
288 | 289 |
291 | 292 |
left (location_obj attribute) 293 |
294 | 295 | 296 |
location (annotation_obj attribute) 297 |
298 | 299 |
301 | 302 |

M

303 | 304 | 310 |
305 | 306 |
mentions (document_obj attribute) 307 |
308 | 309 |
311 | 312 |

N

313 | 314 | 324 | 330 |
315 | 316 |
normal_image (document_obj attribute) 317 |
318 | 319 | 320 |
normal_image_url (document_obj attribute) 321 |
322 | 323 |
325 | 326 |
normal_image_url_list (document_obj attribute) 327 |
328 | 329 |
331 | 332 |

P

333 | 334 | 358 | 378 |
335 | 336 |
page (annotation_obj attribute) 337 |
338 | 339 |
340 | 341 |
(mention_obj attribute) 342 |
343 | 344 | 345 |
(section_obj attribute) 346 |
347 | 348 |
349 | 350 |
pages (document_obj attribute) 351 |
352 | 353 | 354 |
pdf (document_obj attribute) 355 |
356 | 357 |
359 | 360 |
pdf_url (document_obj attribute) 361 |
362 | 363 | 364 |
published_url (document_obj attribute) 365 |
366 | 367 | 368 |
put() (document_obj method) 369 |
370 | 371 |
372 | 373 |
(project_obj method) 374 |
375 | 376 |
377 |
379 | 380 |

R

381 | 382 | 392 | 398 |
383 | 384 |
related_article (document_obj attribute) 385 |
386 | 387 | 388 |
relevance (location_obj attribute) 389 |
390 | 391 |
393 | 394 |
right (location_obj attribute) 395 |
396 | 397 |
399 | 400 |

S

401 | 402 | 422 | 436 |
403 | 404 |
save() (document_obj method) 405 |
406 | 407 |
408 | 409 |
(project_obj method) 410 |
411 | 412 |
413 | 414 |
sections (document_obj attribute) 415 |
416 | 417 | 418 |
small_image (document_obj attribute) 419 |
420 | 421 |
423 | 424 |
small_image_url (document_obj attribute) 425 |
426 | 427 | 428 |
small_image_url_list (document_obj attribute) 429 |
430 | 431 | 432 |
source (document_obj attribute) 433 |
434 | 435 |
437 | 438 |

T

439 | 440 | 458 | 486 |
441 | 442 |
text (mention_obj attribute) 443 |
444 | 445 | 446 |
thumbnail_image (document_obj attribute) 447 |
448 | 449 | 450 |
thumbnail_image_url (document_obj attribute) 451 |
452 | 453 | 454 |
thumbnail_image_url_list (document_obj attribute) 455 |
456 | 457 |
459 | 460 |
title (annotation_obj attribute) 461 |
462 | 463 |
464 | 465 |
(document_obj attribute) 466 |
467 | 468 | 469 |
(project_obj attribute) 470 |
471 | 472 | 473 |
(section_obj attribute) 474 |
475 | 476 |
477 | 478 |
top (location_obj attribute) 479 |
480 | 481 | 482 |
type (location_obj attribute) 483 |
484 | 485 |
487 | 488 |

U

489 | 490 | 496 |
491 | 492 |
updated_at (document_obj attribute) 493 |
494 | 495 |
497 | 498 |

V

499 | 500 | 506 |
501 | 502 |
value (location_obj attribute) 503 |
504 | 505 |
507 | 508 | 509 | 510 |
511 |
512 |
513 | 533 |
534 |
535 | 544 | 548 | 549 | --------------------------------------------------------------------------------