Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 Development & Repository Restructuring #152

Open
wants to merge 11 commits into
base: beta/1.x
Choose a base branch
from

Conversation

imanshafiei540
Copy link
Collaborator

@imanshafiei540 imanshafiei540 commented Feb 7, 2025

closes #151

To install and work with:

  1. Clone the repo and checkout to the beta/1.0.0-initialize branch.
git checkout beta/1.0.0-initialize
  1. Install a virtual environment inside your project with python>=3.10
python3.12 -m venv .venv
  1. Install Poetry (https://python-poetry.org/docs/)

  2. Install the package using poetry

poetry install
  1. Run the tests (example)
poetry run tox -e py310
  1. Run a sample example

You need a .env with proper credentials:

EDS_AUTH_URL="..."
EDS_CLIENT_ID="..."
EDS_SECRET="..."
EDS_API_URL="https://api.earthdaily.com"
from earthdaily import EDSClient, EDSConfig
from earthdaily.exceptions import EDSAPIError

config = EDSConfig()
client = EDSClient(config)

response = client.agriculture.explore()
print(response)



try:
    items = client.platform.pystac_client.search(collections=["ai-ready-mosaics-sample"], limit=10).items()
    for item in items:
        assets = item.assets
        for asset in assets.values():
            alternate = asset.extra_fields.get("alternate")
            print(f"Item ID: {item.id}, Asset URL: {alternate['download']['href']}")
        break
except EDSAPIError as e:
    print(f"An error occurred: {e}, {e.status_code}, {e.body}")

@imanshafiei540 imanshafiei540 self-assigned this Feb 7, 2025
@imanshafiei540 imanshafiei540 marked this pull request as draft February 7, 2025 01:12
@imanshafiei540 imanshafiei540 marked this pull request as ready for review February 7, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant