Skip to main content

shennongname

PyPI version

Documentation

The documentation for shennongname is available on the documentation website of the ShennongAlpha (ShennongDoc):

You can also contribute to the documentation on the ShennongDoc GitHub repository by submitting a pull request:

Systematic Nomenclature for Natural Medicinal Materials Algorithm (SNNMMA)

The following code shows how to use shennongname Python package to construct an NMM systematic name (NMMSN).

from shennongname.snnmma.algorithm import construct_nmmsn
from shennongname.snnmma.model import NmmsnNameElement

# Construct a Natural Medicinal Material Scientific Name (NMMSN)
input = NmmsnNameElement.model_validate(
    {
        'nmm_type': 'processed',
        'species_origins': [['Ephedra sinica', '草麻黄'], 'or', ['Ephedra intermedia', '中麻黄'], 'or', ['Ephedra equisetina', '木贼麻黄']],
        'medicinal_parts': [['stem herbaceous', '草质茎']],
        'special_descriptions': [],
        'processing_methods': [['segmented', '段制'], 'and', ['aquafried honey', '蜜炙制']]
    }
)

construct_nmmsn(input).model_dump()

The output is a Python dictionary:

{
    'success': True,
    'error_msg': 'Pipe: construct_nmmsn_spe_ori. Status: warning. Reason: Multiple species origins detected.',
    'error_msg_en_zh': {
        'en': 'Multiple species origins detected.',
        'zh': '检测到多个物种基源。'
    },
    'nmmsn': {
        'nmmsn': 'Ephedra equisetina vel intermedia vel sinica Stem-herbaceous Segmented and Aquafried-honey',
        'nmmsn_zh': {
            'zh': '蜜炙制段制木贼麻黄或中麻黄或草麻黄草质茎',
            'pinyin': 'mì zhì zhì duàn zhì mù zéi má huáng huò zhōng má huáng huò cǎo má huáng cǎo zhì jīng'
        },
        'nmmsn_name_element': {
            'nmm_type': 'processed',
            'species_origins': [['Ephedra equisetina', '木贼麻黄'], 'or', ['Ephedra intermedia', '中麻黄'], 'or', ['Ephedra sinica', '草麻黄']],
            'medicinal_parts': [['stem herbaceous', '草质茎']],
            'special_descriptions': [],
            'processing_methods': [['segmented', '段制'], 'and', ['aquafried honey', '蜜炙制']]
        },
        'nmmsn_seq': [['Ephedra equisetina vel intermedia vel sinica', '木贼麻黄或中麻黄或草麻黄'], ['Stem-herbaceous', '草质茎'], ['', ''], ['Segmented and Aquafried-honey', '蜜炙制段制']]
    }
}

Start ShennongName Flask Server

The shennongname package also provides a Flask server for constructing NMMSNs.

1. Configure the .env file

cp .env.example .env

2. Install shennongname package

pip install .

3. Run the Flask server

# Production
gunicorn -b 0.0.0.0:5001 shennongname.flask.run:app

# Development
python3 shennongname/flask/run.py

Start ShennongName Flask Server with Docker

You can also use Docker to run the Flask server.

docker build -t shennongname .
docker run -d -p 5001:5001 shennongname

Cite this work

@misc{yang2024shennongalphaaidrivensharingcollaboration,
      title={ShennongAlpha: an AI-driven sharing and collaboration platform for intelligent curation, acquisition, and translation of natural medicinal material knowledge}, 
      author={Zijie Yang and Yongjing Yin and Chaojun Kong and Tiange Chi and Wufan Tao and Yue Zhang and Tian Xu},
      year={2024},
      eprint={2401.00020},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2401.00020}, 
}

Metadata

Release files for shennongname 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shennongname 1.1.0
File Size Uploaded Provenance Actions
shennongname-1.1.0.tar.gz 23.1 kB Without provenance Details for shennongname-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shennongname 1.1.0
File Interpreter ABI Platform Actions
shennongname-1.1.0-py3-none-any.whl Python 3 none any Details for shennongname-1.1.0-py3-none-any.whl

Total release size: 48.8 kB

Release files / shennongname-1.1.0.tar.gz

Download URL shennongname-1.1.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
93f02e708a740a17a8a46bd89ac207e94cb7582de5292565048e8b2b1f40dfc7
BLAKE2b-256 checksum
How to use checksums
883e6ab0ad832ae826b3e8aed541ce7a6f6bf61d656b39885519a6c1fffd552b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

Release files / shennongname-1.1.0-py3-none-any.whl

Download URL shennongname-1.1.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0170c8ebe57646b555082d2737d7f275109ccb4318c81b7416a75188552d097d
BLAKE2b-256 checksum
How to use checksums
d0978c37e47468477d31c015687d049c31830e93dd809c1e73c850bd3f093f80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

Security for shennongname 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page