Skip to main content

ShennongName (神农命名)

Project description

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}, 
}

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

shennongname-1.1.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

shennongname-1.1.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file shennongname-1.1.0.tar.gz.

File metadata

  • Download URL: shennongname-1.1.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

File hashes

Hashes for shennongname-1.1.0.tar.gz
Algorithm Hash digest
SHA256 93f02e708a740a17a8a46bd89ac207e94cb7582de5292565048e8b2b1f40dfc7
MD5 aa45f860923cbb6e9ac8198fcf3b190b
BLAKE2b-256 883e6ab0ad832ae826b3e8aed541ce7a6f6bf61d656b39885519a6c1fffd552b

See more details on using hashes here.

File details

Details for the file shennongname-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: shennongname-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.6.0

File hashes

Hashes for shennongname-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0170c8ebe57646b555082d2737d7f275109ccb4318c81b7416a75188552d097d
MD5 6733f6f9465aabb5150704cf2883f6d0
BLAKE2b-256 d0978c37e47468477d31c015687d049c31830e93dd809c1e73c850bd3f093f80

See more details on using hashes here.

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