Skip to main content

A Python library for interacting with farmOS over API.

Project description

farmOS.py

Licence Release Last commit Twitter Chat

farmOS.py is a Python library for interacting with farmOS over API.

For more information on farmOS, visit farmOS.org.

USAGE

import farmOS

hostname = 'myfarm.farmos.net'
username = 'My Name'
password = 'mYPa$$w0rd'

farm = farmOS.farmOS(hostname, username, password)
success = farm.authenticate()

# Get farm info
info = farm.info()

# Get all logs
logs = farm.log.get()
# Get harvest logs
harvests = farm.log.get({
  'type':'farm_harvest'
  })
# Get log number 37
log = farm.log.get(37)

# Get all assets
assets = farm.asset.get()
# Get all animal assets
animals = farm.log.get({
  'type':'animal'
  })

# Get all areas
areas = farm.area.get()
# Get field areas
fields = farm.area.get({
  'area_type':'field'
  })

# Get all terms
terms = farm.term.get()
# Get all terms from farm_crops vocabulary
crops = farm.term.get('farm_crops')

TESTING

Configure credentials for the farmOS instance used to test in

tests/test_credentials.py

Automated tests are run with pytest

python setup.py test

MAINTAINERS

This project has been sponsored by:

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

farmOS-0.0.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distributions

farmOS-0.0.1-py3.7.egg (16.7 kB view hashes)

Uploaded Source

farmOS-0.0.1-py3-none-any.whl (20.6 kB view hashes)

Uploaded Python 3

farmOS-0.0.1-py2.7.egg (11.8 kB view hashes)

Uploaded Source

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