Skip to content

Fetch and format plant specimen informations from data file and web.

License

Notifications You must be signed in to change notification settings

zxjsdp/SpecimenInfo

Repository files navigation

SpecimenInfo

Fetch and format plant specimen informations from data file and web, save outcome to xlsx file and SQLite3 db file.

Screen Shot (GUI Version)

Screen Shot

Preparation

You need to prepare two xlsx files to run this program.

  • Query file (Include specimen query information)
  • Data file (Include informations about specimen collection and identification)

Please download sample file for more details.

Prerequisites

  • For Windows users, you need to install Python before running this program.

  • Install requirements:

    pip install -U requests beautifulsoup4 openpyxl
    

Usage

  1. For quick use, you can download specimen_info_gui.py and double click. You will get a graphical user interface.

    • Select valid query xlsx file (default: query.xlsx);
    • Select valid data xlsx file (default: data.xlsx);
    • Change output name if you want;
    • Click Start Query button to start.

    After execution, an .xlsx file and an SQLite3 db file which contains the detailed specimen infomations will be generated.

  2. For user who are familiar with console, you can download specimen_info.py. At console or command line, type this:

     python specimen_info.py -i query.xlsx -d data.xlsx -o outfile.xlsx
    

    If you changed your query file and data file to default name:

    • query file: query.xlsx
    • data file: data.xlsx

    Then you can just type:

     python specimen_info.py
    

    After execution, an .xlsx file and an SQLite3 db file which contains the detailed specimen infomations will be generated.

  3. For extented use: If you just want to get the output tuple and want to save output information to other places (for example, MySQL), do this:

     from specimen_info import (Query, write_to_xlsx_file,
                                write_to_sqlite3)
    
     q = Query(query_file=query_filename, offline_data_file=data_filename)
     out_tuple_list = q.do_multi_query()
    
     # If you want to save output to xlsx file
     write_to_xlsx_file(out_tuple_list, xlsx_outfile_name="specimen.xlsx")
    
     # If you want to save output to SQLite3 db file
     write_to_sqlite3(out_tuple_list, sqlite3_file="specimen.sqlite")
    
     # If you want to save to other places,
     # Just write your own extension code.
    

Qeury File and Data File Format

  1. Query file

    You need these information for query xlsx file:

    1. 物种编号
    2. 流水号
    3. 条形码
    4. 物种名(二名法)
    5. 同一物种编号
  2. Data file

    You need these information for data xlsx file:

    1. 物种编号
    2. 中文名
    3. 种名(拉丁)
    4. 科名
    5. 科名(拉丁)
    6. 具体小地名
    7. 东经
    8. 海拔
    9. 日期
    10. 份数
    11. 草灌
    12. 采集人
    13. 鉴定人
    14. 鉴定日期
    15. 录入员
    16. 录入日期
  3. Output information format (in xlsx file database)

    1. 馆代码
    2. 流水号
    3. 条形码
    4. 模式类型
    5. 库存
    6. 标本状态
    7. 采集人
    8. 采集号
    9. 采集日期
    10. 国家
    11. 省市
    12. 区县
    13. 海拔
    14. 负海拔
    15. 定名人
    16. 种下等级
    17. 中文名
    18. 鉴定人
    19. 鉴定日期
    20. 备注
    21. 地名
    22. 生境
    23. 经度
    24. 纬度
    25. 备注2
    26. 录入员
    27. 录入日期
    28. 习性
    29. 体高
    30. 胸径
    31. 果实
    32. 寄主

About

Fetch and format plant specimen informations from data file and web.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages