{"id":23065986,"url":"https://github.com/gil9red/pastebin3","last_synced_at":"2025-08-15T11:32:32.888Z","repository":{"id":25559342,"uuid":"28992506","full_name":"gil9red/pastebin3","owner":"gil9red","description":"A pastebin.com API wrapper for Python 3 (#python, #python3, #pastebin, #api, #wrapper)","archived":false,"fork":false,"pushed_at":"2020-10-04T22:26:13.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-11T16:27:20.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gil9red.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-09T00:06:46.000Z","updated_at":"2023-08-11T16:27:20.619Z","dependencies_parsed_at":"2022-07-24T06:01:58.085Z","dependency_job_id":null,"html_url":"https://github.com/gil9red/pastebin3","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gil9red%2Fpastebin3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gil9red%2Fpastebin3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gil9red%2Fpastebin3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gil9red%2Fpastebin3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gil9red","download_url":"https://codeload.github.com/gil9red/pastebin3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229911004,"owners_count":18143229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T05:10:47.876Z","updated_at":"2024-12-16T05:10:48.410Z","avatar_url":"https://github.com/gil9red.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pastebin3\nA http://pastebin.com/ API wrapper for Python 3 (#python, #python3, #pastebin, #api, #wrapper)\n\n--------------\n[Clone](https://github.com/gil9red/SimplePyScripts/blob/master/requests_example/pastebin3_requests.py) written\nusing module [Requests](https://github.com/kennethreitz/requests)\n\n\nUsage Examples\n--------------\n\nSupported version api:\n\n```python\nimport pastebin3\n\nprint(pastebin3.PASTEBIN_API_VERSION)\n```\n\n\n**Generate a user key** (this is required by other functions):\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\nprint(api_user_key)\n```\n\n\n**Paste** without api_user_key anonymous:\n\n```python\nimport pastebin3\n\nrs = pastebin3.paste(dev_key, 'Yohoho!')\nprint(rs)\n```\n\n\nUser **paste** to Pastebin:\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\n\nrs = pastebin3.paste(dev_key, 'Yohoho!', api_user_key)\nprint(rs)\n```\n\n\nFull user **paste** to Pastebin. About [format](http://pastebin.com/api#5), [private](http://pastebin.com/api#6) and [expire_date](http://pastebin.com/api#6).\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\n\nrs = pastebin3.paste(\n    dev_key,\n    code='int a = 10;',\n    user_key=api_user_key,\n    name='foo',\n    format='cpp',\n    private='private',\n    expire_date='10M'\n)\nprint(rs)\n```\n\n**Delete a paste**\n\n**paste_key** - this is the unique key of the paste you want to delete.\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\n\nrs = pastebin3.delete_paste(dev_key, api_user_key, paste_key)\nprint(rs)\n```\n\n\nReturn an XML list of all **pastes by user**:\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\n\n# default results_limit=50\nrs = pastebin3.user_pastes(dev_key, api_user_key)\nprint(rs)\n\n# or:\n\nrs = pastebin3.user_pastes(dev_key, api_user_key, results_limit=5)\nprint(rs)\n```\n\n\nReturn an XML list of **User Details** of user specified by API key.\n\n```python\nimport pastebin3\n\napi_user_key = pastebin3.api_user_key(dev_key, user_name, user_password)\n\nrs = pastebin3.user_details(dev_key, api_user_key)\nprint(rs)\n```\n\n\nReturn a list of **trending pastes**. The result is in XML:\n\n```python\nimport pastebin3\n\nrs = pastebin3.trending(dev_key)\nprint(rs)\n```\n\n\n**Exceptions**:\n\n```python\nimport pastebin3\n\ntry:\n    api_user_key = pastebin3.api_user_key(\n        dev_key=PASTEBIN_API_DEV_KEY,\n        user_name=PASTEBIN_USERNAME,\n        user_password=PASTEBIN_PASSWORD\n    )\n    print(api_user_key)\n    \n    rs = pastebin3.user_pastes(\n        dev_key=PASTEBIN_API_DEV_KEY,\n        user_key=api_user_key\n    )\n    print(rs)\n    \n    rs = pastebin3.paste(\n        dev_key=PASTEBIN_API_DEV_KEY,\n        code='Bugaga!',\n        user_key=api_user_key,\n        expire_date='10M'\n    )\n    print(rs)\n    \nexcept pastebin3.PastebinError as e:\n    print('Error: ' + str(e))\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgil9red%2Fpastebin3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgil9red%2Fpastebin3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgil9red%2Fpastebin3/lists"}