Skip to main content

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

Reason this release was yanked:

testing

Project description

Gro API Client

https://www.gro-intelligence.com/products/gro-api

Client library for accessing Gro Intelligence's agricultural data platform.

Prerequisites

  1. MacOS and Linux
  2. Windows

Install Gro API client packages

pip install git+https://github.com/gro-intelligence/api-client.git

Note that even if you are using Anaconda, the API Client install should still be performed using pip and not conda.

Gro API authentication token

Use the Gro web application to retrieve an authentication token (detailed instructions are on the developers site here).

Examples

Navigate to api/client/samples/ folder 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" --user_email="email@example.com"
    

    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.

Further documentation can be found on the Gro Developers site at <developers.gro-intelligence.com>.

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.82.1.dev162.tar.gz (20.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

groclient-1.82.1.dev162-py2.py3-none-any.whl (78.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file groclient-1.82.1.dev162.tar.gz.

File metadata

  • Download URL: groclient-1.82.1.dev162.tar.gz
  • Upload date:
  • Size: 20.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for groclient-1.82.1.dev162.tar.gz
Algorithm Hash digest
SHA256 b3985d575418c1cbebd1311c40d5a0a02fb5042dff79b32f4581359270d50439
MD5 7903c5edbd97b58e0fa428ad08d0a285
BLAKE2b-256 aaa18b723ba044f75a34756062ef52c49c271796c58bc8cbcc4187e20069841f

See more details on using hashes here.

File details

Details for the file groclient-1.82.1.dev162-py2.py3-none-any.whl.

File metadata

  • Download URL: groclient-1.82.1.dev162-py2.py3-none-any.whl
  • Upload date:
  • Size: 78.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for groclient-1.82.1.dev162-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a3175e443a9a5c56d6c02cf5187f82b604baf62556ffec961a0181b54d69b588
MD5 7380b26e3a629fba4331be0853aaeb54
BLAKE2b-256 2ce6f9e76fa6bf08f8e99fa3811351a54e6678c8501e81849db4ec912e02ae81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page