Skip to main content

MinMod API

MinMod API to create/update mineral sites.

Quick start

  1. Login to MinMod first. You can use the following command: python -m minmodapi login -u <username> [-e <endpoint>]. By default, the endpoint is https://dev.minmod.isi.edu, for production use https://minmod.isi.edu.

  2. 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())

Metadata

Release files for minmodapi 1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minmodapi 1.3.5
File Size Uploaded
minmodapi-1.3.5.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minmodapi 1.3.5
File Interpreter ABI Platform
minmodapi-1.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / minmodapi-1.3.5.tar.gz

Download URL minmodapi-1.3.5.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
48b4942088aadeb189ae4f652c17c3d88c8905feeffb12085d35ab9d0a6f2f63
BLAKE2b-256 checksum
How to use checksums
1d79dda41f90e05389e2ba078f1fd637e9db14679cd2457fe1d6d0f462f1827b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.10 Darwin/24.5.0

Release files / minmodapi-1.3.5-py3-none-any.whl

Download URL minmodapi-1.3.5-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d6723c2a9c2b5a6a472b79efccf34d494ea8bf21330bf328ef94bc317c13908
BLAKE2b-256 checksum
How to use checksums
0eebe0aca7fc1df0c7fe641028754edb0832850d05d85606ca68b49806d78091
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.10 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

1.3.5 This release

2 release files

1.3.2

2 release files

1.2.0

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page