{"id":13724470,"url":"https://github.com/MAAP-Project/maap-api-nasa","last_synced_at":"2025-05-07T18:32:24.459Z","repository":{"id":37891183,"uuid":"148548634","full_name":"MAAP-Project/maap-api-nasa","owner":"MAAP-Project","description":"NASA Python implementation of the MAAP API specification","archived":false,"fork":false,"pushed_at":"2024-10-23T22:22:40.000Z","size":1534,"stargazers_count":8,"open_issues_count":11,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-29T21:01:47.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://api.maap-project.org/api","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MAAP-Project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-12T22:13:57.000Z","updated_at":"2024-09-26T20:13:59.000Z","dependencies_parsed_at":"2024-01-12T15:47:30.218Z","dependency_job_id":"dd0d4d6f-a15f-4ee7-95ed-ad808cd28b66","html_url":"https://github.com/MAAP-Project/maap-api-nasa","commit_stats":{"total_commits":547,"total_committers":18,"mean_commits":30.38888888888889,"dds":0.6544789762340036,"last_synced_commit":"c223a274c4b8ecf3191bae4a2fe838472ce1bd72"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAAP-Project%2Fmaap-api-nasa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAAP-Project%2Fmaap-api-nasa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAAP-Project%2Fmaap-api-nasa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAAP-Project%2Fmaap-api-nasa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAAP-Project","download_url":"https://codeload.github.com/MAAP-Project/maap-api-nasa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222277851,"owners_count":16959909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:57.800Z","updated_at":"2024-11-14T14:31:00.683Z","avatar_url":"https://github.com/MAAP-Project.png","language":"Python","funding_links":[],"categories":["Biosphere"],"sub_categories":["Biomass"],"readme":"# NASA MAAP API\nThe joint ESA-NASA Multi-Mission Algorithm and Analysis Platform (MAAP) focuses on developing a collaborative data system enabling collocated data, processing, and analysis tools for NASA and ESA datasets. The NASA MAAP API adheres to the joint ESA-NASA MAAP API specification currently in development. This joint architectural approach enables NASA and ESA to each run independent MAAPs, while ultimately sharing common facilities to share and integrate collocated platform services.\n\nDevelopment server: https://api.dit.maap-project.org/api\n\n## I. Local development using docker\n\n```bash\ncd docker\ndocker-compose -f docker-compose-local.yml up\n```\n\n## II. Local development using poetry and virtualenv\n\n**Prerequisites:**\n* poetry\n  * https://python-poetry.org/docs/#installation \n* postgresql\n  * Linux: `sudo apt-get install postgresql python-psycopy2 libpq-dev`\n  * Mac OSx: `brew install postgresql`\n* python3.9+\n\n```bash\ncd maap-api-nasa\npoetry install\n```\n\n### First run: Configure the database.\n\n1. Add a new user called `maapuser` (A fix for 'role \u003cusername\u003e does not exist')\n   \u003e **_NOTE:_**  You may need to use `sudo -u postgres` before postgres commands.\n   ```bash\n   createuser maapuser\n   ```\n\n2. Create an empty postgres db (maap) (a fix for 'database maap does not exist'):\n    ```bash\n    createdatabase maap\n    ```\n\n3. OPTIONAL: PyCharm configuration, if using the PyCharm IDE:\n\n- Script path: `./api/maapapp.py`\n- Environment variables: `PYTHONUNBUFFERED=1`\n- Python interpreter: `Python 3.9`\n- Working directory: `./api`\n\n#### (Obsolete?) Config Titiler endpoint and maap-api-host\n\nIn the settings.py (i.e., maap-api-nasa/api/settings.py):\n\n```python\n# settings.py\nAPI_HOST_URL = 'http://0.0.0.0:5000/' # For local testing\n\n# ...\n\n# The endpoint obtained after doing Titiler deployment\nTILER_ENDPOINT = 'https://XXX.execute-api.us-east-1.amazonaws.com'\n# If running the tiler locally, this can be TILER_ENDPOINT = 'http://localhost:8000'\n```\n\n### Run the app:\n\n```bash\npoetry shell\nFLASK_APP=api/maapapp.py flask run --host=0.0.0.0\n```\n\nSome issues you may experience while running the above line:\n\n* Allowing using postgres without login (A fix for 'fe_sendauth: no password supplied'):\n\n  ```bash\n  sudo vi /etc/postgresql/9.5/main/pg_hba.conf #(the location may be different depend on OS and postgres version)\n  ```\n  \n  ```\n  # Reconfig as follows:\n      local   all     all     trust\n      host    all     all     127.0.0.1/32    trust\n      host    all     all     ::1/0           trust\n  # Save pg_hba.conf\n  ```\n\n  ```bash\n  # Restart postgresql\n  sudo /etc/init.d/postgresql reload\n  sudo /etc/init.d/postgresql start\n  ```\n\n### Running tests\n\nWhen using docker-compose to start the app it is possible to run the tests locally if you first\nupdate the settings.py `DATABASE_URL` value to specify `localhost` as the servername instead of `db`\n(DO NOT check in this change).\n\n```bash\npython -m unittest test/api/endpoints/test_wmts_get_tile.py\n```\n\nIf you are running the latest version of Titiler, use the following local test scripts:\nwhile keeping the server in the previous step running (i.e., local maap-api-nasa). Open a new terminal\n\n```bash\npoetry env use $(poetry env info -e)\n\n#If you are running the latest version of Titiler, then use the following test scripts:\npython -m unittest -v test/api/endpoints/test_wmts_get_tile_new_titiler.py\npython -m unittest -v test/api/endpoints/test_wmts_get_capabilities_new_titiler.py\n```\n\n## III. User Accounts\n\nA valid MAAP API token must be included in the header for any API request. An [Earthdata account](https://uat.urs.earthdata.nasa.gov) is required to access the MAAP API. To obtain a token, URS credentials must be provided as shown below:\n\n```bash\ncurl -X POST --header \"Content-Type: application/json\" -d \"{ \\\"username\\\": \\\"urs_username\\\", \\\"password\\\": \\\"urs_password\\\" }\" https://api.dit.maap-project.org/token\n```\n\n### Comments:\n\n- After running the local maap-api-nasa, go to http://0.0.0.0:5000/api to see the APIs.\n\n- Or running the your own test scripts with:\n\n```bash\ncurl -X POST --header \"Content-Type: application/json\" -d \"{ \\\"username\\\": \\\"urs_username\\\", \\\"password\\\": \\\"urs_password\\\" }\" http://0.0.0.0:5000/token\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAAP-Project%2Fmaap-api-nasa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMAAP-Project%2Fmaap-api-nasa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAAP-Project%2Fmaap-api-nasa/lists"}