Skip to main content

Python SDK for the LinkedIn API v202510

Project description

linkedin-sdk

Python SDK for the LinkedIn API v202510.

Installation

pip install ldraney-linkedin-sdk

Quick Start

from linkedin_sdk import LinkedInClient

# Reads LINKEDIN_ACCESS_TOKEN and LINKEDIN_PERSON_ID from env
client = LinkedInClient()

# Create a text post
result = client.create_post("Hello from Python!")
print(result)  # {'postUrn': 'urn:li:share:...', 'statusCode': 201}

# Get user info
info = client.get_user_info()
print(info['name'])

# Delete a post
client.delete_post("urn:li:share:7...")

Authentication

Set environment variables:

export LINKEDIN_ACCESS_TOKEN="your_token"
export LINKEDIN_PERSON_ID="your_person_id"

Or pass directly:

client = LinkedInClient(access_token="...", person_id="...")

OAuth

from linkedin_sdk import LinkedInClient

# Build auth URL (no client needed)
url = LinkedInClient.get_auth_url(
    client_id="...",
    redirect_uri="http://localhost:8080/callback",
    scopes=["openid", "profile", "email", "w_member_social"],
)

# Exchange code for token (classmethod)
token = LinkedInClient.exchange_code(
    code="auth_code",
    client_id="...",
    client_secret="...",
    redirect_uri="http://localhost:8080/callback",
)

# Refresh token
new_token = LinkedInClient.refresh_token(
    refresh_token="...",
    client_id="...",
    client_secret="...",
)

License

MIT

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

ldraney_linkedin_sdk-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

ldraney_linkedin_sdk-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file ldraney_linkedin_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: ldraney_linkedin_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ldraney_linkedin_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 078dacba562468118bd5228b66efc5b24e2c223ac96ca3a59acc404ffac815cd
MD5 1429ff332deb98ddf089dbd31e475c10
BLAKE2b-256 9cd68b241922a112337aebbbdefbf0582bcc5a96aab632ab5c4d7b19ff4d5207

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldraney_linkedin_sdk-0.1.1.tar.gz:

Publisher: publish.yml on ldraney/linkedin-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for ldraney_linkedin_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ebf3f011733487dab351997163224e0e49e1190f9009988540181c48992526d
MD5 11f2641dbaddb890f78c2a8522edf837
BLAKE2b-256 8680b1764d16a0d7d5fca6738120c435127394f58aab07d8094e6e2b941d8d82

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldraney_linkedin_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ldraney/linkedin-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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