FYTA CLI Library

raw JSON →
0.7.2 verified Sat May 09 auth: no python

Python library to access the FYTA API for plant monitoring. Current version 0.7.2, weekly release cadence.

pip install fyta-cli
error ModuleNotFoundError: No module named 'fyta_cli'
cause Package is installed as 'fyta-cli' but import path is 'fyta_cli'.
fix
Install using pip install fyta-cli and use from fyta_cli.fyta import Fyta.
error AttributeError: module 'fyta_cli' has no attribute 'Fyta'
cause Trying to import Fyta from top-level module instead of submodule.
fix
Use from fyta_cli.fyta import Fyta.
error RuntimeError: asyncio.run() cannot be called from a running event loop
cause Calling asyncio.run() inside an async context (e.g., Jupyter notebook).
fix
Use await main() in Jupyter or notebook environment.
breaking Version 0.7.x changed the login method from synchronous to asynchronous; all API calls now require async/await.
fix Wrap code in async functions and use await on all Fyta methods.
gotcha The package name on PyPI is 'fyta-cli' but the module import path is 'fyta_cli' (underscore).
fix Use `from fyta_cli.fyta import Fyta`.
gotcha Credentials handling: The library does not support environment variables natively; you must pass email and password directly or implement your own config.
fix Store credentials in environment variables and load them into the Fyta constructor.

Initialize Fyta with email and password, login, and fetch plant data.

import asyncio
from fyta_cli.fyta import Fyta

async def main():
    fyta = Fyta(email='your_email@example.com', password='your_password')
    await fyta.login()
    plants = await fyta.get_all_plants()
    print(plants)

asyncio.run(main())