Skip to main content

Python library and CLI tool to scrape public user statistics from Printables.com

Project description

Printables Stats Scraper

A Python library and CLI tool to scrape public user statistics from Printables.com, including detailed badge levels.

Features

  • Public Stats: Fetches downloads, likes, followers, following, joined date, and model count.
  • Detailed Badges: Parses badges into a dictionary of {Name: Level} (e.g., {'Designer': 1, 'Maker': 4}).

Installation

From PyPI

pip install printables-stats

From Source

This project uses uv for dependency management.

# Clone the repository
git clone https://gitlab.com/yourusername/printables-stats.git
cd printables-stats

# Install dependencies
uv sync

Usage

CLI

You can use the included script to fetch stats for a specific user via environment variable.

export PRINTABLES_USER_ID='@josefprusa'
uv run python -m printables_stats

Output Example:

{
  "downloads": 4,
  "likes": 1,
  "followers": 0,
  "following": 4,
  "joined_date": "November 6, 2025",
  "models_count": 4,
  "badges": {
    "Designer": 1,
    "Maker": 4,
    "Download Maniac": 3,
    "Printables Maniac": 1
  }
}

Library

from printables_stats import PrintablesClient

client = PrintablesClient()
stats = client.get_user_stats('@josefprusa')

if stats:
    print(f"Downloads: {stats.get('downloads')}")
    print(f"Badges: {stats.get('badges')}")

Development

Run quality checks and tests:

uv run ruff check .

uv run ruff format .

uv run ty check .

uv run pytest

Releasing to PyPI

Release Process

  1. Update the version in pyproject.toml
  2. Commit and push your changes
  3. Create and push a git tag:
    git tag v0.1.2
    git push origin v0.1.2
    
  4. In GitLab, navigate to CI/CD → Pipelines
  5. Manually trigger the release job to publish to PyPI
  6. Verify the package on https://pypi.org/project/printables-stats/

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

printables_stats-0.1.2.tar.gz (32.6 MB view details)

Uploaded Source

Built Distribution

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

printables_stats-0.1.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file printables_stats-0.1.2.tar.gz.

File metadata

  • Download URL: printables_stats-0.1.2.tar.gz
  • Upload date:
  • Size: 32.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for printables_stats-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dc721831c2b8b8896a41494442947d610b258b620fef98ac2253a3724153616f
MD5 7c87552d6525a5f571ccfb9fb874ac8d
BLAKE2b-256 714b9133983876c0e65cff0ef6717afe4193576de8f3cf499e1095a8c13216ef

See more details on using hashes here.

File details

Details for the file printables_stats-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for printables_stats-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0b741781c9629e0939df01ca4ab48a86e6b646b59ba0e3c9d3b37e00fa35f8e
MD5 c9782e061aadd60020fc178eb1eaa784
BLAKE2b-256 adf6f671ccbca69575d7f5c443d7d9d2412b69f367170820cd8895e02a1cd799

See more details on using hashes here.

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