{"id":24461,"library":"python-upwork-oauth2","title":"Upwork OAuth2 Python Client","description":"Python bindings for the Upwork API using OAuth2. Current version 3.2.0, supports Python >=3.8. This library replaces the old OAuth1-based client. Release cadence is irregular.","status":"active","version":"3.2.0","language":"python","source_language":"en","source_url":"https://github.com/upwork/python-upwork-oauth2","tags":["upwork","oauth2","api","client"],"install":[{"cmd":"pip install python-upwork-oauth2","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"JWT token handling for OAuth2 flow","package":"pyjwt","optional":false},{"reason":"OAuth2 protocol implementation","package":"oauthlib","optional":false}],"imports":[{"note":"Old OAuth1 package was named upwork-api; the new OAuth2 package uses module 'upwork'","wrong":"from upwork_api import UpworkClient","symbol":"UpworkClient","correct":"from upwork import UpworkClient"},{"note":"OAuth2 grants are in upwork.oauth2, not upwork.auth","wrong":"from upwork.auth import ClientCredentialsGrant","symbol":"ClientCredentialsGrant","correct":"from upwork.oauth2 import ClientCredentialsGrant"}],"quickstart":{"code":"import os\nfrom upwork import UpworkClient\nfrom upwork.oauth2 import ClientCredentialsGrant\n\nclient_id = os.environ.get('UPWORK_CLIENT_ID', '')\nclient_secret = os.environ.get('UPWORK_CLIENT_SECRET', '')\n\ngrant = ClientCredentialsGrant(\n    client_id=client_id,\n    client_secret=client_secret\n)\ntoken = grant.get_token()\nclient = UpworkClient(token=token)\n# Now use client to call API endpoints\nprint(client.get_user_info())","lang":"python","description":"Authenticate using Client Credentials Grant and create an UpworkClient."},"warnings":[{"fix":"Replace 'from upwork_api import *' with 'from upwork import UpworkClient' and use OAuth2 grants.","message":"v3.0.0 dropped OAuth1 support entirely. Import paths changed from upwork_api to upwork.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use only the current Upwork API endpoints (v2 or later). Review Upwork API changelog.","message":"v3.2.0 removed calls to the legacy API. Endpoints under /api/* may no longer work.","severity":"breaking","affected_versions":">=3.2.0"},{"fix":"Switch to ClientCredentialsGrant unless you need user-specific tokens.","message":"AuthorizationCodeGrant is deprecated in favor of ClientCredentialsGrant for machine-to-machine auth.","severity":"deprecated","affected_versions":">=3.1.0"},{"fix":"Check token expiry and call grant.refresh_token() if needed.","message":"Token refresh must be handled manually. The library does not automatically refresh expired tokens.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install python-upwork-oauth2 and import from 'upwork' instead.","cause":"Using old import from the deprecated OAuth1 package.","error":"ModuleNotFoundError: No module named 'upwork_api'"},{"fix":"Ensure you have v3.x installed: pip install python-upwork-oauth2>=3.0.0. Then from upwork import UpworkClient","cause":"Using wrong import path or outdated library version.","error":"AttributeError: module 'upwork' has no attribute 'UpworkClient'"},{"fix":"Verify your client ID and secret in the Upwork developer portal. Use environment variables.","cause":"Client credentials (client_id, client_secret) are incorrect or missing.","error":"oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}