Package: niamoto
Table of ContentsIntroductionInstallationInitial ConfigurationAvailable Commandsniamoto init [--reset]niamoto import_data <csvfile>niamoto generate_static_siteDevelopment Environment ConfigurationCSV File Format for ImportStatic Type Checking and Testing with mypy and pytestUsing mypy for Static Type CheckingRunning Tests with pytestLicenseContributionIntroductionThe Niamoto CLI is a tool designed to facilitate the configuration, initialization, and management of data for the Niamoto platform. This tool allows users to configure the database, import data from CSV files, and generate static websites.Installationpip install niamotoInitial ConfigurationAfter installation, initialize the Niamoto environment using the command:niamoto initThis command will create the default configuration necessary for Niamoto to operate. Use the--resetoption to reset the environment if it already exists.Available Commandsniamoto init [--reset]Initializes or resets the Niamoto environment.niamoto import_data <csvfile>Imports data from a CSV file into the specified table in the database.niamoto generate_static_siteGenerates static web pages for each taxon in the database.Development Environment ConfigurationTo set up a development environment for Niamoto, you must havePoetryinstalled on your system. Poetry is a dependency management and packaging tool for Python.Poetry Installation:
To install Poetry, run the following command:curl-sSLhttps://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py|python-Clone the Niamoto repository:
Clone the Niamoto repository on your system usinggit:gitclonehttps://github.com/niamoto/niamoto.gitConfigure the development environment with Poetry:
Move into the cloned directory and install the dependencies with Poetry:cdniamoto
poetryinstallActivate the virtual environment:
Activate the virtual environment created by Poetry:poetryshellCSV File Format for ImportFor data import, Niamoto expects structured CSV files with the following columns:ColumnDescriptionid_sourceData source identifiersourceData source nameoriginal_nameOriginal species namefamilyTaxonomic family of the speciestaxanameTaxonomic name of the speciestaxonrefComplete taxonomic reference of the speciesrankTaxonomic rankdbhTree diameter at breast heightheightTree heightflowerPresence of flowers (boolean value)fruitPresence of fruits (boolean value)month_obsMonth of observationwood_densityWood densityleaf_slaSpecific leaf areabark_thicknessBark thicknessleaf_areaLeaf arealeaf_thicknessLeaf thicknessleaf_ldmcLeaf dry matter contentstrateVegetation stratumelevationElevationrainfallRainfallholdridgeHoldridge life zoneprovinceProvincein_forestPresence in a forest (boolean value)in_umPresence on ultramafic substrate (boolean value)is_treeIndicates if the organism is a tree (boolean value)id_taxonrefTaxonomic reference identifierid_familyTaxonomic family identifierid_genusTaxonomic genus identifierid_speciesTaxonomic species identifierid_infraInfraspecific taxonomic identifiergeo_ptGeographic point (coordinates)plotPlot identifierStatic Type Checking and Testing with mypy and pytestUsing mypy for Static Type Checkingmypyis an optional static type checker for Python that aims to combine the benefits of dynamic (duck) typing and static typing. It checks the type annotations in your Python code to find common bugs as soon as possible during the development cycle.To run mypy on your code:mypysrc/niamotoRunning Tests with pytestpytestis a framework that makes it easy to write simple tests, yet scales to support complex functional testing for applications and libraries.To run your tests with pytest, use:pytest--cov=src--cov-reporthtmlLicenseniamotois distributed under the terms of theGPL-3.0-or-laterlicense.ContributionInstructions for contributing to the Niamoto project.