MinMod API
MinMod API to create/update mineral sites.
Quick start
-
Login to MinMod first. You can use the following command:
python -m minmodapi login -u <username> [-e <endpoint>]. By default, the endpoint ishttps://dev.minmod.isi.edu, for production usehttps://minmod.isi.edu. -
Upload mineral sites to MinMod programmatically:
from minmodapi import MinModAPI, merge_deposit_type, replace_site
api = MinModAPI(<endpoint>)
# prepare a mineral site to upload
mineral_site = {
"name": "test_mineral_site",
"source_id": "https://api.cdr.land/v1/docs/documents",
"record_id": "021c30faa880995b3cab0fcdaa9ea2fa895634205ad3977b664f33492b2086052c"
"location_info": {
"country": [],
"state_or_province": []
},
"mineral_inventory": [],
"deposit_type_candidate": [],
"modified_at": "2024-11-15T18:38:01.050553Z",
...
}
# Upload the mineral site. The function automatically determines whether
# to create a new site or update an existing one. If updating, the
# `apply_update` function merges the new site with the existing one.
# For instance, `replace_site` replaces the existing site with the new site.
# This function returns the identifier of the mineral site, or None if the upload fails.
mineral_site_ident = api.upsert_mineral_site(mineral_site, apply_update=replace_site)
# If not None, use `get_browse_link` or `get_api_link` to retrieve the site link.
if mineral_site_ident is not None:
print("LOD link:", mineral_site_ident.get_browse_link())
print("API link:", mineral_site_ident.get_api_link())
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minmodapi-1.3.5.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minmodapi-1.3.5.tar.gz.
File metadata
- Download URL: minmodapi-1.3.5.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.5 CPython/3.12.10 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48b4942088aadeb189ae4f652c17c3d88c8905feeffb12085d35ab9d0a6f2f63
|
|
| MD5 |
406912c7be19db4ea9df6315c9333c3e
|
|
| BLAKE2b-256 |
1d79dda41f90e05389e2ba078f1fd637e9db14679cd2457fe1d6d0f462f1827b
|
File details
Details for the file minmodapi-1.3.5-py3-none-any.whl.
File metadata
- Download URL: minmodapi-1.3.5-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.8.5 CPython/3.12.10 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d6723c2a9c2b5a6a472b79efccf34d494ea8bf21330bf328ef94bc317c13908
|
|
| MD5 |
84cdb6c3c795d1a34a63d7c16407a1ca
|
|
| BLAKE2b-256 |
0eebe0aca7fc1df0c7fe641028754edb0832850d05d85606ca68b49806d78091
|