{"id":16748986,"url":"https://github.com/cthoyt/quickstatements_client","last_synced_at":"2025-03-21T22:31:57.278Z","repository":{"id":170311253,"uuid":"606491168","full_name":"cthoyt/quickstatements_client","owner":"cthoyt","description":"A data model and client for QuickStatements (for Wikidata)","archived":false,"fork":false,"pushed_at":"2025-02-10T23:19:10.000Z","size":125,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T21:38:01.051Z","etag":null,"topics":["bibliometrics","python","quickstatements","wikidata"],"latest_commit_sha":null,"homepage":"https://quickstatements-client.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cthoyt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-25T16:48:54.000Z","updated_at":"2025-02-10T23:19:13.000Z","dependencies_parsed_at":"2023-11-07T17:51:04.855Z","dependency_job_id":"1125cb11-22e9-488a-a57c-1612aa2b2465","html_url":"https://github.com/cthoyt/quickstatements_client","commit_stats":null,"previous_names":["cthoyt/quickstatements_client"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthoyt%2Fquickstatements_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthoyt%2Fquickstatements_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthoyt%2Fquickstatements_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cthoyt%2Fquickstatements_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cthoyt","download_url":"https://codeload.github.com/cthoyt/quickstatements_client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880380,"owners_count":20525507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibliometrics","python","quickstatements","wikidata"],"created_at":"2024-10-13T02:23:30.306Z","updated_at":"2025-03-21T22:31:56.968Z","avatar_url":"https://github.com/cthoyt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/cthoyt/quickstatements-client/raw/main/docs/source/logo.png\" height=\"150\"\u003e\n\u003c/p\u003e\n--\u003e\n\n\u003ch1 align=\"center\"\u003e\n  QuickStatements Client\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/cthoyt/quickstatements_client/actions/workflows/tests.yml\"\u003e\n        \u003cimg alt=\"Tests\" src=\"https://github.com/cthoyt/quickstatements_client/actions/workflows/tests.yml/badge.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/quickstatements_client\"\u003e\n        \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/quickstatements_client\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/quickstatements_client\"\u003e\n        \u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/quickstatements_client\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/cthoyt/quickstatements-client/blob/main/LICENSE\"\u003e\n        \u003cimg alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/quickstatements_client\" /\u003e\n    \u003c/a\u003e\n    \u003ca href='https://quickstatements-client.readthedocs.io/en/latest/?badge=latest'\u003e\n        \u003cimg src='https://readthedocs.org/projects/quickstatements-client/badge/?version=latest' alt='Documentation Status' /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/cthoyt/quickstatements-client/branch/main\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/cthoyt/quickstatements-client/branch/main/graph/badge.svg\" alt=\"Codecov status\" /\u003e\n    \u003c/a\u003e  \n    \u003ca href=\"https://github.com/cthoyt/cookiecutter-python-package\"\u003e\n        \u003cimg alt=\"Cookiecutter template from @cthoyt\" src=\"https://img.shields.io/badge/Cookiecutter-snekpack-blue\" /\u003e \n    \u003c/a\u003e\n    \u003ca href='https://github.com/psf/black'\u003e\n        \u003cimg src='https://img.shields.io/badge/code%20style-black-000000.svg' alt='Code style: black' /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/cthoyt/quickstatements-client/blob/main/.github/CODE_OF_CONDUCT.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg\" alt=\"Contributor Covenant\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://zenodo.org/badge/latestdoi/606491168\"\u003e\n        \u003cimg src=\"https://zenodo.org/badge/606491168.svg\" alt=\"DOI\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA data model and client for Wikidata [QuickStatements](https://quickstatements.toolforge.org).\n\n## 💪 Getting Started\n\nHere's how to quickly construct some QuickStatements\n\n```python\nimport datetime\nfrom quickstatements_client import DateQualifier, EntityQualifier, TextQualifier, EntityLine\n\nsubject_qid = \"Q47475003\"  # Charles Tapley Hoyt\nsubject_orcid = \"0000-0003-4423-4370\"\nreference_url_qualifier = TextQualifier(\n   predicate=\"S854\", target=f\"https://orcid.org/0000-0003-4423-4370\"\n)\nstart_date = datetime.datetime(year=2021, day=15, month=2)\nstart_date_qualifier = DateQualifier.start_time(start_date)\nposition_held_qualifier = EntityQualifier(predicate=\"P39\", target=\"Q1706722\")\nemployment_line = EntityLine(\n   subject=subject_qid,\n   predicate=\"P108\",  # employer\n   target=\"Q49121\",  # Harvard medical school\n   qualifiers=[reference_url_qualifier, start_date_qualifier, position_held_qualifier],\n)\n\n\u003e\u003e\u003e employment_line.get_line()\n'Q47475003|P108|Q49121|S854|\"https://orcid.org/0000-0003-4423-4370\"|P580|+2021-02-15T00:00:00Z/11|P39|Q1706722',\n```\n\nHow to send some QuickStatements to the API:\n\n```python\nfrom quickstatements_client import QuickStatementsClient\n\nlines = [\n   employment_line,\n   ...\n]\n\nclient = QuickStatementsClient(token=..., username=...)\nres = client.post(lines, batch_name=\"Test Batch\")\n# see also res.batch_id\n\nimport webbrowser\nwebbrowser.open_new_tab(res.batch_url)\n```\n\nNote: `token` and `username` are automatically looked up with `pystow` if they aren't given.\nSpecifically, using `pystow.get_config(\"quickstatements\", \"token)` and\n`pystow.get_config(\"quickstatements\", \"username\")`.\n\n\n## 🚀 Installation\n\nThe most recent release can be installed from\n[PyPI](https://pypi.org/project/quickstatements_client/) with:\n\n```shell\n$ pip install quickstatements_client\n```\n\nThe most recent code and data can be installed directly from GitHub with:\n\n```bash\n$ pip install git+https://github.com/cthoyt/quickstatements-client.git\n```\n\n## 👐 Contributing\n\nContributions, whether filing an issue, making a pull request, or forking, are appreciated. See\n[CONTRIBUTING.md](https://github.com/cthoyt/quickstatements-client/blob/master/.github/CONTRIBUTING.md) for more information on getting involved.\n\n## 👋 Attribution\n\nThis code was originally written as a contribution to [PyORCIDator](https://github.com/lubianat/pyorcidator).\nSpecial thanks to Tiago Lubiana [@lubianat] and João Vitor [@jvfe] for discussions and testing.\n\n### ⚖️ License\n\nThe code in this package is licensed under the MIT License.\n\n\u003c!--\n### 📖 Citation\n\nCitation goes here!\n--\u003e\n\n\u003c!--\n### 🎁 Support\n\nThis project has been supported by the following organizations (in alphabetical order):\n\n- [Harvard Program in Therapeutic Science - Laboratory of Systems Pharmacology](https://hits.harvard.edu/the-program/laboratory-of-systems-pharmacology/)\n\n--\u003e\n\n\u003c!--\n### 💰 Funding\n\nThis project has been supported by the following grants:\n\n| Funding Body                                             | Program                                                                                                                       | Grant           |\n|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|-----------------|\n| DARPA                                                    | [Automating Scientific Knowledge Extraction (ASKE)](https://www.darpa.mil/program/automating-scientific-knowledge-extraction) | HR00111990009   |\n--\u003e\n\n### 🍪 Cookiecutter\n\nThis package was created with [@audreyfeldroy](https://github.com/audreyfeldroy)'s\n[cookiecutter](https://github.com/cookiecutter/cookiecutter) package using [@cthoyt](https://github.com/cthoyt)'s\n[cookiecutter-snekpack](https://github.com/cthoyt/cookiecutter-snekpack) template.\n\n## 🛠️ For Developers\n\n\u003cdetails\u003e\n  \u003csummary\u003eSee developer instructions\u003c/summary\u003e\n\nThe final section of the README is for if you want to get involved by making a code contribution.\n\n### Development Installation\n\nTo install in development mode, use the following:\n\n```bash\n$ git clone git+https://github.com/cthoyt/quickstatements-client.git\n$ cd quickstatements-client\n$ pip install -e .\n```\n\n### 🥼 Testing\n\nAfter cloning the repository and installing `tox` with `pip install tox`, the unit tests in the `tests/` folder can be\nrun reproducibly with:\n\n```shell\n$ tox\n```\n\nAdditionally, these tests are automatically re-run with each commit in a [GitHub Action](https://github.com/cthoyt/quickstatements-client/actions?query=workflow%3ATests).\n\n### 📖 Building the Documentation\n\nThe documentation can be built locally using the following:\n\n```shell\n$ git clone git+https://github.com/cthoyt/quickstatements-client.git\n$ cd quickstatements-client\n$ tox -e docs\n$ open docs/build/html/index.html\n``` \n\nThe documentation automatically installs the package as well as the `docs`\nextra specified in the [`setup.cfg`](setup.cfg). `sphinx` plugins\nlike `texext` can be added there. Additionally, they need to be added to the\n`extensions` list in [`docs/source/conf.py`](docs/source/conf.py).\n\n### 📦 Making a Release\n\nAfter installing the package in development mode and installing\n`tox` with `pip install tox`, the commands for making a new release are contained within the `finish` environment\nin `tox.ini`. Run the following from the shell:\n\n```shell\n$ tox -e finish\n```\n\nThis script does the following:\n\n1. Uses [Bump2Version](https://github.com/c4urself/bump2version) to switch the version number in the `setup.cfg`,\n   `src/quickstatements_client/version.py`, and [`docs/source/conf.py`](docs/source/conf.py) to not have the `-dev` suffix\n2. Packages the code in both a tar archive and a wheel using [`build`](https://github.com/pypa/build)\n3. Uploads to PyPI using [`twine`](https://github.com/pypa/twine). Be sure to have a `.pypirc` file configured to avoid the need for manual input at this\n   step\n4. Push to GitHub. You'll need to make a release going with the commit where the version was bumped.\n5. Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can\n   use `tox -e bumpversion -- minor` after.\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthoyt%2Fquickstatements_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcthoyt%2Fquickstatements_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcthoyt%2Fquickstatements_client/lists"}