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
- Update the version in
pyproject.toml - Commit and push your changes
- Create and push a git tag:
git tag v0.1.2 git push origin v0.1.2
- In GitLab, navigate to CI/CD → Pipelines
- Manually trigger the
releasejob to publish to PyPI - 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc721831c2b8b8896a41494442947d610b258b620fef98ac2253a3724153616f
|
|
| MD5 |
7c87552d6525a5f571ccfb9fb874ac8d
|
|
| BLAKE2b-256 |
714b9133983876c0e65cff0ef6717afe4193576de8f3cf499e1095a8c13216ef
|
File details
Details for the file printables_stats-0.1.2-py3-none-any.whl.
File metadata
- Download URL: printables_stats-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0b741781c9629e0939df01ca4ab48a86e6b646b59ba0e3c9d3b37e00fa35f8e
|
|
| MD5 |
c9782e061aadd60020fc178eb1eaa784
|
|
| BLAKE2b-256 |
adf6f671ccbca69575d7f5c443d7d9d2412b69f367170820cd8895e02a1cd799
|