Skip to main content

A simple python wrapper for the UCSF Industry Documents API.

Project description

Industry Documents Wrapper

This is a simple Python Wrapper for the UCSF Industry Documents Library API. Documentation about the API can be found here. Please use the API documentation to learn about best practices to construct search queries.

It offers basic functionality to perform queries on the API to retrieve metadata of the documents in the library.

You will want to install the package using pip:

pip install industryDocumentsWrapper

The the package has one class IndustryDocsSearch with two main methods of are:

  • IndustryDocsSearch.query(): performs the query on the API
  • IndustryDocsSearch.save(): saves query results as a JSON or Parquet file.

Basic usage looks like:

from industryDocumentsWrapper import IndustryDocsSearch 

wrapper = IndustryDocsSearch()
wrapper.query(q="industry:tobacco AND case:'State of North Carolina' AND collection:'JUUL labs Collection', n=100")
wrapper.save('query_results.json', format='json')

Alternatively, to avoid constructing the whole query, you can pass parts of the query as arguments:

from industryDocumentsWrapper import IndustryDocsSearch 

wrapper = IndustryDocsSearch()
wrapper.query(industry='tobacco', case='State of North Carolina', collection='JUUl labs collection', n=100)
wrapper.save('query_results.json', format='json')

Currently there is support for the following parameters:

  • q: complete query string
  • case: Case pertaining to documents
  • collection: Collection of which documents are part
  • type: Type of documents
  • industry: Industry of which documents are part
  • brand: Brand to which documents pertain
  • availability: Availability of documents
  • date: Date documents were created
  • id: ID of particular document
  • author: Creator of document(s)
  • source: Source of document(s)
  • bates: Bates code for document
  • originalformat: Original format that documents were created
  • n: Number of documents you want to retrieve. Pass -1 to retrieve all documents returned by the query. Defaults to 1000.

NOTE: The query method will use the q parameter instead of the others (excluding n) if it is passed, please use the q parameter or pass the values with the individual parameters (case, collection, etc.).

For guidance on the proper way to pass values in the query, please refer to the API documentation.

Please reach out to Rolando Rodriguez with any questions, concerns, or issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

industrydocumentswrapper-0.111.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

industrydocumentswrapper-0.111-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file industrydocumentswrapper-0.111.tar.gz.

File metadata

  • Download URL: industrydocumentswrapper-0.111.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/22.3.0

File hashes

Hashes for industrydocumentswrapper-0.111.tar.gz
Algorithm Hash digest
SHA256 d050d433364480fd8fb1d2c1d33420a6ff21522f2f0f3d58b72d79bae7a7b1f4
MD5 3d6cdc54782ed82dc501921ed968e998
BLAKE2b-256 a57c9322561b7e03991432c09d6bd9f979cdc13224e509861b8ed3b13168e5da

See more details on using hashes here.

File details

Details for the file industrydocumentswrapper-0.111-py3-none-any.whl.

File metadata

File hashes

Hashes for industrydocumentswrapper-0.111-py3-none-any.whl
Algorithm Hash digest
SHA256 0ba1f9ef198e5c60d40cb02f623b606b037a602b94d033546ab0e94c97b5fcf0
MD5 18ecd52e3a479fe591c6521662807c87
BLAKE2b-256 5cfc3153ca64ab30481cb4ffad862454c2a1cd3e95e5b4e033b83d63444c2ba2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page