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.1.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.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trailhead-scraper-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0

File hashes

Hashes for trailhead-scraper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 611e8bbdb4f3c4b24032de6cfd76b469c759543c78b9859b6d3104a438d3bf9d
MD5 65137bc454824368e8b152ea85e29a98
BLAKE2b-256 2cf38ff6a405c430f1980cef1bf5f47f1a3bf954e0d4b1e0797954b649a9ad26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trailhead_scraper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0

File hashes

Hashes for trailhead_scraper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6964856bde1998e434bdf5422ff1f1fbdd2f6e40da3c2b00be6eabaf457d75b
MD5 6131bc43b6567c5d712036d986a2fa53
BLAKE2b-256 dbbaafc9aa1f0262dc2b4c0cfa790814657578d8ba870e68a4fd53e0ac47b9da

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