# Industry Documents Wrapper
This is a simple Python Wrapper for the UCSF [Industry Documents Library](https://www.industrydocuments.ucsf.edu/) API. Documentation about the API can be found [here](https://www.industrydocuments.ucsf.edu/wp-content/uploads/2020/08/IndustryDocumentsDataAPI_v7.pdf). 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:
```
import industry_documents_wrapper as idw
wrapper = idw.ucsf_api.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:
```
import industry_documents_wrapper as idw
wrapper = idw.ucsf_api.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](https://www.industrydocuments.ucsf.edu/wp-content/uploads/2020/08/IndustryDocumentsDataAPI_v7.pdf).**
Please reach out to [Rolando Rodriguez](mailto:rolando@ad.unc.edu) with any questions, concerns, or issues.
Raw data
{
"_id": null,
"home_page": "https://github.com/UNC-Libraries/UCSF-Industry-Docs-API-Python-Wrapper",
"name": "industryDocumentsWrapper",
"maintainer": "Rolando Rodriguez",
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": "rolando@ad.unc.edu",
"keywords": "UCSF, Industry Documents",
"author": "Rolando Rodriguez",
"author_email": "rolando@ad.unc.edu",
"download_url": "https://files.pythonhosted.org/packages/09/34/b6a51b9cc6e04e1993f39fe640fe6bd75485d73301ca418704733f325cba/industrydocumentswrapper-0.1.4.tar.gz",
"platform": null,
"description": "# Industry Documents Wrapper\n\nThis is a simple Python Wrapper for the UCSF [Industry Documents Library](https://www.industrydocuments.ucsf.edu/) API. Documentation about the API can be found [here](https://www.industrydocuments.ucsf.edu/wp-content/uploads/2020/08/IndustryDocumentsDataAPI_v7.pdf). Please use the API documentation to learn about best practices to construct search queries. \n\nIt offers basic functionality to perform queries on the API to retrieve metadata of the documents in the library. \n\nYou will want to install the package using `pip`:\n\n`pip install industryDocumentsWrapper`\n\n\nThe the package has one class `IndustryDocsSearch` with two main methods of are:\n* `IndustryDocsSearch.query()`: performs the query on the API \n* `IndustryDocsSearch.save()`: saves query results as a JSON or Parquet file.\n\nBasic usage looks like: \n\n```\nimport industry_documents_wrapper as idw\n\nwrapper = idw.ucsf_api.IndustryDocsSearch()\nwrapper.query(q=\"industry:tobacco AND case:'State of North Carolina' AND collection:'JUUL labs Collection', n=100\")\nwrapper.save('query_results.json', format='json')\n```\n\nAlternatively, to avoid constructing the whole query, you can pass parts of the query as arguments: \n\n```\nimport industry_documents_wrapper as idw\n\nwrapper = idw.ucsf_api.IndustryDocsSearch()\nwrapper.query(industry='tobacco', case='State of North Carolina', collection='JUUl labs collection', n=100)\nwrapper.save('query_results.json', format='json')\n```\n\nCurrently there is support for the following parameters: \n* `q`: complete query string\n* `case`: Case pertaining to documents \n* `collection`: Collection of which documents are part\n* `type`: Type of documents \n* `industry`: Industry of which documents are part\n* `brand`: Brand to which documents pertain\n* `availability`: Availability of documents\n* `date`: Date documents were created\n* `id`: ID of particular document\n* `author`: Creator of document(s)\n* `source`: Source of document(s)\n* `bates`: Bates code for document\n* `originalformat`: Original format that documents were created\n* `n`: Number of documents you want to retrieve. Pass `-1` to retrieve all documents returned by the query. Defaults to `1000`.\n\n**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.).\n\n**For guidance on the proper way to pass values in the query, please refer to the [API documentation](https://www.industrydocuments.ucsf.edu/wp-content/uploads/2020/08/IndustryDocumentsDataAPI_v7.pdf).**\n\nPlease reach out to [Rolando Rodriguez](mailto:rolando@ad.unc.edu) with any questions, concerns, or issues.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A simple python wrapper for the UCSF Industry Documents API.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/UNC-Libraries/UCSF-Industry-Docs-API-Python-Wrapper",
"Repository": "https://github.com/UNC-Libraries/UCSF-Industry-Docs-API-Python-Wrapper"
},
"split_keywords": [
"ucsf",
" industry documents"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "84a7a4a9a73e610ae59df78f7bfdd824f971b939481485af660d9546d6405c67",
"md5": "807d30f7263128ded9f71ac4d11df512",
"sha256": "726311e141d48d4a04ad13a2577823cc9201313d80957f75087900e2625ed434"
},
"downloads": -1,
"filename": "industrydocumentswrapper-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "807d30f7263128ded9f71ac4d11df512",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 8498,
"upload_time": "2024-12-04T20:57:19",
"upload_time_iso_8601": "2024-12-04T20:57:19.855001Z",
"url": "https://files.pythonhosted.org/packages/84/a7/a4a9a73e610ae59df78f7bfdd824f971b939481485af660d9546d6405c67/industrydocumentswrapper-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0934b6a51b9cc6e04e1993f39fe640fe6bd75485d73301ca418704733f325cba",
"md5": "010c283d515bec6f11e0dfeb32e2e65c",
"sha256": "593ada2fabd23ad89693232e89906872157ebe624cd1b16c728d98da07af0262"
},
"downloads": -1,
"filename": "industrydocumentswrapper-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "010c283d515bec6f11e0dfeb32e2e65c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 7642,
"upload_time": "2024-12-04T20:57:21",
"upload_time_iso_8601": "2024-12-04T20:57:21.472119Z",
"url": "https://files.pythonhosted.org/packages/09/34/b6a51b9cc6e04e1993f39fe640fe6bd75485d73301ca418704733f325cba/industrydocumentswrapper-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-04 20:57:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "UNC-Libraries",
"github_project": "UCSF-Industry-Docs-API-Python-Wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "industrydocumentswrapper"
}