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.112.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.112-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: industrydocumentswrapper-0.112.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.112.tar.gz
Algorithm Hash digest
SHA256 d9fe223de0391b4afa63eff94ec00f074a277cfb2ef87de9a55004a950bc1ccc
MD5 096e2cf12629bda75e2ea271b3131258
BLAKE2b-256 e63bf16abf3696a7a1b086dd7b9de5bfca55a9bcd1104252dc24d391b5984dda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for industrydocumentswrapper-0.112-py3-none-any.whl
Algorithm Hash digest
SHA256 de60f4bbbb4422ec6d02b42073fec7a724be1628a8f36f7543e509ab632f1d38
MD5 d4086aeea7fb8503d4e21ea7816c7af9
BLAKE2b-256 8c86cc875e739f2e2eb72df190d39e6df30bb76e1da4649499596e2aa1c38586

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