Skip to main content

Python client library for accessing Gro Intelligence's agricultural data platform

Project description

Gro API Client

gro-intelligence

The Gro Intelligence Python API client library provides access to Gro's agricultural data platform.

Please see our developer documentation at https://developers.gro-intelligence.com/ for install instructions, API reference documentation, and guides.

The short version:

Examples

Navigate to api/client/samples/ and try executing the provided examples.

  1. Start with quick_start.py. This script creates an authenticated GroClient object and uses the get_data_series() and get_data_points() methods to find Area Harvested series for Ukrainian Wheat from a variety of different sources and output the time series points to a CSV file. You will likely want to revisit this script as a starting point for building your own scripts.

    Note that the script assumes you have your authentication token set to a GROAPI_TOKEN environment variable (see Saving your token as an environment variable). If you don't wish to use environment variables, you can modify the sample script to set ACCESS_TOKEN in some other way.

    python quick_start.py
    

    If the API client is installed and your authentication token is set, a csv file called gro_client_output.csv should be created in the directory where the script was run.

  2. Try out soybeans.py to see the CropModel class and its compute_crop_weighted_series() method in action. In this example, NDVI (Normalized difference vegetation index) for provinces in Brazil is weighted against each province's historical soybean production to put the latest NDVI values into context. This information is put into a pandas dataframe, the description of which is printed to the console.

    python crop_models/soybeans.py
    
  3. See brazil_soybeans.ipynb for a longer, more detailed demonstration of many of the API's capabilities in the form of a Jupyter notebook.

  4. You can also use the included gro_client tool as a quick way to request a single data series right on the command line. Try the following:

    gro_client --metric="Production Quantity mass" --item="Corn" --region="United States" --token YOUR_GRO_API_TOKEN
    

    The gro_client command line interface does a keyword search for the inputs and finds a random matching data series. It displays the data series it picked and the data points to the console. This tool is useful for simple queries, but anything more complex should be done using the provided Python packages.

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

groclient-1.369.1.tar.gz (72.8 kB view details)

Uploaded Source

Built Distribution

groclient-1.369.1-py3-none-any.whl (87.3 kB view details)

Uploaded Python 3

File details

Details for the file groclient-1.369.1.tar.gz.

File metadata

  • Download URL: groclient-1.369.1.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.6.15 Linux/5.15.0-1054-azure

File hashes

Hashes for groclient-1.369.1.tar.gz
Algorithm Hash digest
SHA256 008b4838d3be5cd0c6781f68213b47ed726d0b9442c41746c611f598d21793a5
MD5 5d8e8c629ce51291d2606f58d175c99a
BLAKE2b-256 8248b0c33b51bf714537871e0e0f44344ba9dd15d9d42c0c083145f8504a73b0

See more details on using hashes here.

File details

Details for the file groclient-1.369.1-py3-none-any.whl.

File metadata

  • Download URL: groclient-1.369.1-py3-none-any.whl
  • Upload date:
  • Size: 87.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.6.15 Linux/5.15.0-1054-azure

File hashes

Hashes for groclient-1.369.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f2616a1fd01a334e5cb033338f8225c9086ad9f505fe9217719bd162dd5db07
MD5 674c70ec5d491977e30f7d55b5fd2738
BLAKE2b-256 e532522d5d3ba27f7036f3770dcc8e4e1d410def46113bd889ed0081c723ab15

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