Skip to main content

A client for interacting with APICURON

Project description

APICURON Client

Tests Cookiecutter template from @cthoyt PyPI PyPI - Python Version PyPI - License Documentation Status Code style: black

A client for interacting with APICURON

💪 Getting Started

The following example shows how you can prepare a submission of a new resource to APICURON. Because apicuron_client uses PyDantic under the hood, the JSON is validated and automatically converted into programmatic models. The Description.update_remote() function takes care of interacting with the API and loading the APICURON_TOKEN from the environment or a config file with pystow.

from apicuron_client import Description

payload = {
   "resource_id": "Biomappings",
   "resource_name": "Biomappings",
   "resource_uri": "https://biomappings.github.io/biomappings/",
   "resource_url": "https://biomappings.github.io/biomappings/",
   "resource_long_name": "Biomappings",
   "resource_description": "Community curated and predicted equivalences and related mappings between named biological entities that are not available from primary sources.",
   "terms_def": [
      {
         "activity_term": "novel_curation",
         "activity_name": "Curated novel mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Curated a novel mapping between two entities"
      },
      {
         "activity_term": "validate_prediction",
         "activity_name": "Validate predicted mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Affirmed the correctness of a predicted mapping"
      },
      {
         "activity_term": "invalidate_prediction",
         "activity_name": "Invalidate predicted mapping",
         "activity_category": "generation",
         "score": 50,
         "description": "Affirmed the incorrectness of a predicted mapping"
      }
   ],
   "achievements_def": [
      {
         "category": "1",
         "name": "Newbie curator",
         "count_threshold": 10,
         "type": "badge",
         "list_terms": [
            "novel_curation",
            "validate_prediction",
            "invalidate_prediction"
         ],
         "color_code": "#055701"
      }
   ]
}
description = Description(**payload)
description.update_remote()

The results can then be seen on the APICURON website at https://apicuron.org/database?resource_uri=https:%2F%2Fbiomappings.github.io%2Fbiomappings%2F.

Command Line Interface

The apicuron_client command line tool is automatically installed. It can be used from the shell with the --help flag to show all subcommands:

$ apicuron_client --help

TODO show the most useful thing the CLI does! The CLI will have documentation auto-generated by sphinx.

🚀 Installation

The most recent code and data can be installed directly from GitHub with:

$ pip install git+https://github.com/cthoyt/apicuron-client.git

To install in development mode, use the following:

$ git clone git+https://github.com/cthoyt/apicuron-client.git
$ cd apicuron-client
$ pip install -e .

👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved.

👀 Attribution

⚖️ License

The code in this package is licensed under the MIT License.

Acknowledgements

🍪 Cookiecutter

This package was created with @audreyfeldroy's cookiecutter package using @cthoyt's cookiecutter-snekpack template.

🛠️ For Developers

The final section of the README is for if you want to get involved by making a code contribution.

❓ Testing

After cloning the repository and installing tox with pip install tox, the unit tests in the tests/ folder can be run reproducibly with:

$ tox

Additionally, these tests are automatically re-run with each commit in a GitHub Action.

📦 Making a Release

After installing the package in development mode and installing tox with pip install tox, the commands for making a new release are contained within the finish environment in tox.ini. Run the following from the shell:

$ tox -e finish

This script does the following:

  1. Uses BumpVersion to switch the version number in the setup.cfg and src/apicuron_client/version.py to not have the -dev suffix
  2. Packages the code in both a tar archive and a wheel
  3. Uploads to PyPI using twine. Be sure to have a .pypirc file configured to avoid the need for manual input at this step
  4. Push to GitHub. You'll need to make a release going with the commit where the version was bumped.
  5. Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can use tox -e bumpversion minor after.

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

apicuron_client-0.0.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

apicuron_client-0.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file apicuron_client-0.0.1.tar.gz.

File metadata

  • Download URL: apicuron_client-0.0.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.5

File hashes

Hashes for apicuron_client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c1f0c74a1558939420c3708b7be15e0d31641e6c7f8f1d826ac83b2b1ecb35da
MD5 042871fe1594677d2edfdb7b1361c9df
BLAKE2b-256 293d26466a3a1a666dbcf62df33b8cbe78e22a5e5bdd2c109fe75fd61efbc7b9

See more details on using hashes here.

Provenance

File details

Details for the file apicuron_client-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: apicuron_client-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.5

File hashes

Hashes for apicuron_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a178a33478abebc15397e2b9958de37bcb4a9aa9b15b022afb898e2570a28a9
MD5 06184d9cb3a580c94dac40e24ff18311
BLAKE2b-256 883829fa757b6e53ca75df772bdfdd0d753d098b1f1a54418d15976efc38dbcd

See more details on using hashes here.

Provenance

Supported by

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