Structured data on cloud servers collected by sparecores-crawler.
Project description
Spare Cores Navigator Data
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:
- Checks the local cache for a valid (non-stale) database
- If cached and fresh, uses it immediately
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb5823597eb43ad71631d09fb967e2206ae31c153df7c3c670d22c3979a3eed
|
|
| MD5 |
f20d2eaeb74713d77667e438ec3bf8e3
|
|
| BLAKE2b-256 |
4a628b038c2400bfe18e9ecf226ed152b5ab8a16e8aefddbcbc38eed1f58f426
|
Provenance
The following attestation bundles were made for sparecores_data-0.5.0.tar.gz:
Publisher:
release.yml on SpareCores/sc-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparecores_data-0.5.0.tar.gz -
Subject digest:
dfb5823597eb43ad71631d09fb967e2206ae31c153df7c3c670d22c3979a3eed - Sigstore transparency entry: 1569957001
- Sigstore integration time:
-
Permalink:
SpareCores/sc-data@1b6fd04d33cba4129dc5eb748d3d1d35d56b42a5 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/SpareCores
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1b6fd04d33cba4129dc5eb748d3d1d35d56b42a5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
399e570986c6d67be15e4dc8b8994d0a9626908c631ba086326c206229893acc
|
|
| MD5 |
13334caa97d08d9b7d824fabd1bfc728
|
|
| BLAKE2b-256 |
2b28d6abc25cbe56672e41a39d188c5a3605139014d86825e78c935e05107a9b
|
Provenance
The following attestation bundles were made for sparecores_data-0.5.0-py3-none-any.whl:
Publisher:
release.yml on SpareCores/sc-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sparecores_data-0.5.0-py3-none-any.whl -
Subject digest:
399e570986c6d67be15e4dc8b8994d0a9626908c631ba086326c206229893acc - Sigstore transparency entry: 1569957125
- Sigstore integration time:
-
Permalink:
SpareCores/sc-data@1b6fd04d33cba4129dc5eb748d3d1d35d56b42a5 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/SpareCores
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1b6fd04d33cba4129dc5eb748d3d1d35d56b42a5 -
Trigger Event:
push
-
Statement type: