Skip to main content

Python SDK for the LinkedIn API v202510

Project description

PyPI License: MIT Python 3.10+

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.2.tar.gz (10.3 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.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ldraney_linkedin_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 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.2.tar.gz
Algorithm Hash digest
SHA256 e692f9b5da23641008d9ba02d4d0d6d05cae91d2b90fa0c47ea897d3d2dd1b24
MD5 7e2cd5893b7067eb5e82d635e99f9e49
BLAKE2b-256 34336dc3d6ce407f30fe0fba35c0e359c0d80e25261620b461121d197be7b0cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldraney_linkedin_sdk-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ldraney_linkedin_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a7a75a18def329a3342f8ea69b52c8aa502485b2c11de52d524a2c2c914b254
MD5 0efbf5fc5c3d400dd136708dada0c583
BLAKE2b-256 3d937f52d86ffb40fbc088fedc835a6ed65aa06e4d323c1e9eeed8251876edc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldraney_linkedin_sdk-0.1.2-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