Skip to main content

Retrieve public data from Salesforce Trailhead user profiles

Project description

license Trailhead Scraper Tests status on GitHub Actions

A simple package that enables retrieval of public data from Salesforce Trailhead user profiles.

Installation

trailhead-scraper can be installed via pip:

$ pip install trailhead-scraper

Quickstart

You can now retrieve information about a Trailhead user based on a username:

from trailhead_scraper import fetch_profile_data, fetch_rank_data, fetch_awards

username = "trailhead-username"

# get profile information
profile = fetch_profile_data(username)

# get rank information
rank_data = fetch_rank_data(username)

# get list of awards (badges)
awards = fetch_awards(username)

Use the profile data to access basic information about the user:

print(profile["profilePhotoUrl"])
print(profile["profileUser"]["FirstName"])
print(profile["profileUser"]["LastName"])
print(profile["profileUser"]["CompanyName"])
print(profile["profileUser"]["Title"])

Use the rank data to get the user’s rank and related information:

print(rank_data["RankLabel"])
print(rank_data["RankImageUrl"])
print(rank_data["EarnedPointTotal"])
print(rank_data["EarnedBadgeTotal"])
print(rank_data["CompletedTrailTotal"])
print(rank_data["PointTotalForNextRank"])
print(rank_data["BadgeTotalForNextRank"])

The list of awards contains details about each award (badge/recognition) earned by the user:

for award in awards:
   print(award["AwardType"], award["Award"]["Label"])

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

trailhead-scraper-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

trailhead_scraper-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file trailhead-scraper-0.1.0.tar.gz.

File metadata

  • Download URL: trailhead-scraper-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.9.11-200.fc33.x86_64

File hashes

Hashes for trailhead-scraper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9eb6c2df839e304f7abc4be88dc8eec4efb4b086ab2a6a95e28ed495071da395
MD5 f2e74ada99c7431eadb4b97cc71e835f
BLAKE2b-256 87adf82c3cab27c9be97c1f74e8c4eef215d1753bd2962d9dce493d9e4b6df01

See more details on using hashes here.

File details

Details for the file trailhead_scraper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trailhead_scraper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Linux/5.9.11-200.fc33.x86_64

File hashes

Hashes for trailhead_scraper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a32bf43ae1f83d54650d0ec5b90eb06cbb2aba620e87b20f0f1e093f6feab50
MD5 8bddd0549b4ecc08c0844ed49c36848d
BLAKE2b-256 bed6a501d85da88c8275ef486b8880b23b512881c942decbba4225caec755191

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