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

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minmodapi-1.3.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for minmodapi-1.3.5.tar.gz
Algorithm Hash digest
SHA256 48b4942088aadeb189ae4f652c17c3d88c8905feeffb12085d35ab9d0a6f2f63
MD5 406912c7be19db4ea9df6315c9333c3e
BLAKE2b-256 1d79dda41f90e05389e2ba078f1fd637e9db14679cd2457fe1d6d0f462f1827b

See more details on using hashes here.

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

Hashes for minmodapi-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5d6723c2a9c2b5a6a472b79efccf34d494ea8bf21330bf328ef94bc317c13908
MD5 84cdb6c3c795d1a34a63d7c16407a1ca
BLAKE2b-256 0eebe0aca7fc1df0c7fe641028754edb0832850d05d85606ca68b49806d78091

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.5 This release

2 files

1.3.2

2 files

1.2.0

2 files

1.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page