Skip to main content

神农Name (神农命名, 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

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.0.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

shennongname-1.0.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shennongname-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7d6c306f9196c43afac6abe19405957c5629e5289a45be55fcefbd9baf6267e6
MD5 b1585980e7a7614633b63020f36eb7c9
BLAKE2b-256 da3df2c2676df804984873fe1a408861fa54c5dd8459188e7e8792ff01172e87

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for shennongname-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6beec47af832ed54bc7820683a1d8f6368844fc32153a545cd3023beb3c7b05
MD5 f53684ca7e0a00e51b9ae248dcc3748e
BLAKE2b-256 66afaddd683e80ee711c5643f8b1996739ceaefebd9103d9857c9afd9f8773f2

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