Skip to content

platiagro/sdk

Repository files navigation

PlatIAgro SDK

Build Status Quality Gate Status License

Requirements

Quick Start

Make sure you have all requirements installed on your computer.

Installation:

(Optional) Create a virtualenv:

virtualenv -p python3 venv
. venv/bin/activate

Install Python modules:

pip install .

Testing

Install the testing requirements:

pip install .[testing]

Export these environment variables:

export MINIO_ENDPOINT=localhost:9000
export MINIO_ACCESS_KEY=minio
export MINIO_SECRET_KEY=minio123
export PROJECTS_ENDPOINT=projects.platiagro:8080

(Optional) Start a MinIO instance:

docker run -d -p 9000:9000 \
  --name minio \
  --env "MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY" \
  --env "MINIO_SECRET_KEY=$MINIO_SECRET_KEY" \
  minio/minio:RELEASE.2018-02-09T22-40-05Z \
  server /data

Use the following command to run all tests:

pytest

Use the following command to run lint:

flake8 --max-line-length 127 platiagro/

API

See the PlatIAgro SDK API doc for API specification.

Update Documentation

After making some changes in PlatIAgro SDK, you need to update the docs in this file and run these commands:

pip install sphinx
cd docs/
make html
rm -r _static/ _sources/
mv build/html/* .