Skip to main content

Structured data on cloud servers collected by sparecores-crawler.

Project description

Spare Cores Navigator Data

Build Last data pull Project Status: Beta Maintenance Status: Active MPL 2.0 License PyPI - Python Version NGI Search Open Call 3 beneficiary

The Spare Cores Navigator Data is a Python package to make it easy to access the latest version of the Spare Cores Navigator data via a SQLite database file. This database file is compiled from an automatically downloaded, compressed SQLite database dump, periodically updated by a background thread.

Installation

Stable version from PyPI:

pip install sparecores-data

Most recent version from GitHub:

pip install "sparecores-data @ git+https://git@github.com/SpareCores/sc-data.git"

Usage

For easy access to the most recent version of the SQLite database file, import the db object of the sc_data Python package, which runs an updater thread in the background to keep the SQLite file up-to-date:

from sc_data import db
print(db.path)

The database is cached locally in a persistent directory and automatically updated when needed. On import, the package:

  1. Checks the local cache for a valid (non-stale) database
  2. If cached and fresh, uses it immediately
  3. Otherwise, downloads the latest version from our CDN

The cache is stored in a platform-specific location:

  • Linux: $XDG_CACHE_HOME/sparecores-data/ or ~/.cache/sparecores-data/
  • macOS: ~/Library/Caches/sparecores-data/
  • Windows: %LOCALAPPDATA%/sparecores-data/

To enforce waiting for the update to complete, you can use the updated event:

db.updated.wait()

Configuration

The package comes with the following set of default parameters, which can be overridden by builtins or environment variables:

Configuration Description Default Value Builtin Name Environment Variable
Custom Database Path Custom file path for the database (bypasses cache) - sc_data_db_path SC_DATA_DB_PATH
Disable Updates Whether to disable automatic updates False sc_data_no_update SC_DATA_NO_UPDATE
Database URL The URL of the most recent version of the database file (when unset, the default URL is used) https://cdn.sparecores.net/sc-data/sc-data-all.sql.xz sc_data_db_url SC_DATA_DB_URL
HTTP Timeout The timeout in seconds for downloading the database file 30 sc_data_http_timeout SC_DATA_HTTP_TIMEOUT
Refresh Interval The interval in seconds to check for database updates 600 sc_data_db_refresh_seconds SC_DATA_DB_REFRESH_SECONDS
Suppress Data License Notice Suppress the data license notice printed to stderr - sc_data_no_license_notice SC_DATA_NO_LICENSE_NOTICE

Note: Setting SC_DATA_DB_PATH disables caching and uses the specified file directly.

Licensing

The source code of the sparecores-data package is released under the MPL 2.0 license.

The default SQLite database dump file downloaded at runtime is published under the Business Source License 1.1 (BSL 1.1) license.

Details -- including the publisher, timestamped release date, license type, additional usage terms, and a link to the full license text -- is available in the _metadata table of the database, and printed to the stderr by default on every Data instantialization.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparecores_data-0.5.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

sparecores_data-0.5.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file sparecores_data-0.5.0.tar.gz.

File metadata

  • Download URL: sparecores_data-0.5.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sparecores_data-0.5.0.tar.gz
Algorithm Hash digest
SHA256 dfb5823597eb43ad71631d09fb967e2206ae31c153df7c3c670d22c3979a3eed
MD5 f20d2eaeb74713d77667e438ec3bf8e3
BLAKE2b-256 4a628b038c2400bfe18e9ecf226ed152b5ab8a16e8aefddbcbc38eed1f58f426

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparecores_data-0.5.0.tar.gz:

Publisher: release.yml on SpareCores/sc-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sparecores_data-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: sparecores_data-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sparecores_data-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 399e570986c6d67be15e4dc8b8994d0a9626908c631ba086326c206229893acc
MD5 13334caa97d08d9b7d824fabd1bfc728
BLAKE2b-256 2b28d6abc25cbe56672e41a39d188c5a3605139014d86825e78c935e05107a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparecores_data-0.5.0-py3-none-any.whl:

Publisher: release.yml on SpareCores/sc-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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