pasteconnect


Namepasteconnect JSON
Version 0.6.2 PyPI version JSON
download
home_pagehttps://github.com/heartlog/pasteconnect
SummaryPackage to read and upload code/text to pastebin.com.
upload_time2023-11-08 16:35:27
maintainer
docs_urlNone
authorHeartlog
requires_python>=3.7
license
keywords pastebin pastebinapi client opensource
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pasteconnect package

PasteConnect is a Python library for interacting with Pastebin. It allows you to check account validity, authenticate, create pastes, delete pastes, and retrieve raw paste content.

[![PyPI](https://img.shields.io/pypi/v/pasteconnect?style=for-the-badge&logo=pypi&label=PYPI&color=blue)](https://pypi.org/project/pasteconnect/)
[![Licence](https://img.shields.io/pypi/l/pasteconnect?style=for-the-badge)](https://github.com/heartlog/pasteconnect/blob/main/LICENSE)

## Installation
**Python 3.7 or higher is required.**
[![Python](https://img.shields.io/pypi/pyversions/pasteconnect?style=flat-square&logo=python&label=PYTHON&color=blue)](https://pypi.org/project/pasteconnect/)

You can install PasteConnect using `pip`:
```diff
+$ pip install pasteconnect
```

Install from source repository
```diff
+$ pip install git+https://github.com/heartlog/pasteconnect.git
```

## Getting Started
> To get(create) your `username`, `password` » login to your [pastebin account](https://pastebin.com/signup)
>> after creating your account, [head over to the api documentation](https://pastebin.com/doc_api) and grab your `api_key` under __Your Unique Developer API Key__
---

### Usage
```py
from pasteconnect import PasteConn

# Sync Client
pastebin = PasteConn(username, password, api_key)
# Account_status(check validity of account)
account_status = pastebin.check_account()
print(account_status)

title = "My Paste Title"
content = "This is the content of my paste."

# Paste text to pastebin
paste_url = pastebin.create_paste(title, content, privacy=1)
print(f"Paste created: {paste_url}")
```


## Initialize client
### `pastebin = PasteConn(username, password, api_key)` ![Static Badge](https://img.shields.io/badge/Required-eb2525?style=for-the-badge)
```diff
-required for other modules to work
```

[![Username](https://img.shields.io/badge/Username-blue)](#getting-started)
[![Password](https://img.shields.io/badge/password-blue)](#getting-started)
[![Api_key](https://img.shields.io/badge/api__key-blue)](#getting-started)

Refer [Getting Started](#getting-started)

```py
username = "username"
password = "*******"
api_key = "123456abcdefg"
# Define Client
pastebin = PasteConn(username, password, api_key)
```
Alternatively, you can initialize with [predefined environment variables](https://rentry.co/setenv)
```py
pastebin = PasteConn() # with pre define env var
```

## Check account existance
#### `pastebin.check_account()`
![dash](https://img.shields.io/badge/-----grey)

Check validity of pastebin.com account.
```py
result = pastebin.check_account()
print(result)  # Response: '[heartlog] is Valid Account. User key : "user_key"'
```

## Authentication
To authenticate and get your `user_key`:

#### `pastebin.auth()`
![dash](https://img.shields.io/badge/-----grey)

Get `user_key` using give credentials.
```py
result = pastebin.auth()
print(result)  # Response: "user_key"
```

#### `pastebin.create_paste(title, content, privacy=1)`
![privacy](https://img.shields.io/badge/privacy-green)
![title](https://img.shields.io/badge/title-blue)
![content](https://img.shields.io/badge/content-purple)

```py
# 0 : public | 1 : unlisted | 2 : private
privacy = 1 # (default - private)
title = "Title of paste"
content = """
Hello
This is multiline text
"""
pastebin.create_paste(title, content, privacy=1)
```

#### `pastebin.delete_paste(url)`
![Static Badge](https://img.shields.io/badge/url-blue)

```py
url = "https://pastebin.com/kZATAWhe"
result = pastebin.delete_paste(url)
print(result)  # Response: "Paste Removed"
```

## Get raw content
To retrieve the raw content of a paste using its URL or ID:
#### `pastebin.get_raw_content(url)`

![url](https://img.shields.io/badge/url-purple)

```py
from pasteconnect import get_raw

result = get_raw(url)
print(result)
```

Alternatively, you can use the `get_raw` function:

```py
url = "https://pastebin.com/kZATAWhe"
result = pastebin.get_raw_content(url)
print(result)  # Response: "Content of paste"
```

---
# Made with ❤️ by [Heartlog](https://github.com/heartlog/)

## Special Thanks 
venaxyt for [pastebinapi](https://github.com/venaxyt/pastebinapi/). Helped a lot in project. 😁

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/heartlog/pasteconnect",
    "name": "pasteconnect",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "pastebin,pastebinapi,client,opensource",
    "author": "Heartlog",
    "author_email": "heartlog@skiff.com",
    "download_url": "https://files.pythonhosted.org/packages/16/09/4e96c47f5d355b186a9d9062a33bb52eb0bbb3439d23fbfc459c9c391184/pasteconnect-0.6.2.tar.gz",
    "platform": null,
    "description": "# Pasteconnect package\n\nPasteConnect is a Python library for interacting with Pastebin. It allows you to check account validity, authenticate, create pastes, delete pastes, and retrieve raw paste content.\n\n[![PyPI](https://img.shields.io/pypi/v/pasteconnect?style=for-the-badge&logo=pypi&label=PYPI&color=blue)](https://pypi.org/project/pasteconnect/)\n[![Licence](https://img.shields.io/pypi/l/pasteconnect?style=for-the-badge)](https://github.com/heartlog/pasteconnect/blob/main/LICENSE)\n\n## Installation\n**Python 3.7 or higher is required.**\n[![Python](https://img.shields.io/pypi/pyversions/pasteconnect?style=flat-square&logo=python&label=PYTHON&color=blue)](https://pypi.org/project/pasteconnect/)\n\nYou can install PasteConnect using `pip`:\n```diff\n+$ pip install pasteconnect\n```\n\nInstall from source repository\n```diff\n+$ pip install git+https://github.com/heartlog/pasteconnect.git\n```\n\n## Getting Started\n> To get(create) your `username`, `password` \u00bb login to your [pastebin account](https://pastebin.com/signup)\n>> after creating your account, [head over to the api documentation](https://pastebin.com/doc_api) and grab your `api_key` under __Your Unique Developer API Key__\n---\n\n### Usage\n```py\nfrom pasteconnect import PasteConn\n\n# Sync Client\npastebin = PasteConn(username, password, api_key)\n# Account_status(check validity of account)\naccount_status = pastebin.check_account()\nprint(account_status)\n\ntitle = \"My Paste Title\"\ncontent = \"This is the content of my paste.\"\n\n# Paste text to pastebin\npaste_url = pastebin.create_paste(title, content, privacy=1)\nprint(f\"Paste created: {paste_url}\")\n```\n\n\n## Initialize client\n### `pastebin = PasteConn(username, password, api_key)` ![Static Badge](https://img.shields.io/badge/Required-eb2525?style=for-the-badge)\n```diff\n-required for other modules to work\n```\n\n[![Username](https://img.shields.io/badge/Username-blue)](#getting-started)\n[![Password](https://img.shields.io/badge/password-blue)](#getting-started)\n[![Api_key](https://img.shields.io/badge/api__key-blue)](#getting-started)\n\nRefer [Getting Started](#getting-started)\n\n```py\nusername = \"username\"\npassword = \"*******\"\napi_key = \"123456abcdefg\"\n# Define Client\npastebin = PasteConn(username, password, api_key)\n```\nAlternatively, you can initialize with [predefined environment variables](https://rentry.co/setenv)\n```py\npastebin = PasteConn() # with pre define env var\n```\n\n## Check account existance\n#### `pastebin.check_account()`\n![dash](https://img.shields.io/badge/-----grey)\n\nCheck validity of pastebin.com account.\n```py\nresult = pastebin.check_account()\nprint(result)  # Response: '[heartlog] is Valid Account. User key : \"user_key\"'\n```\n\n## Authentication\nTo authenticate and get your `user_key`:\n\n#### `pastebin.auth()`\n![dash](https://img.shields.io/badge/-----grey)\n\nGet `user_key` using give credentials.\n```py\nresult = pastebin.auth()\nprint(result)  # Response: \"user_key\"\n```\n\n#### `pastebin.create_paste(title, content, privacy=1)`\n![privacy](https://img.shields.io/badge/privacy-green)\n![title](https://img.shields.io/badge/title-blue)\n![content](https://img.shields.io/badge/content-purple)\n\n```py\n# 0 : public | 1 : unlisted | 2 : private\nprivacy = 1 # (default - private)\ntitle = \"Title of paste\"\ncontent = \"\"\"\nHello\nThis is multiline text\n\"\"\"\npastebin.create_paste(title, content, privacy=1)\n```\n\n#### `pastebin.delete_paste(url)`\n![Static Badge](https://img.shields.io/badge/url-blue)\n\n```py\nurl = \"https://pastebin.com/kZATAWhe\"\nresult = pastebin.delete_paste(url)\nprint(result)  # Response: \"Paste Removed\"\n```\n\n## Get raw content\nTo retrieve the raw content of a paste using its URL or ID:\n#### `pastebin.get_raw_content(url)`\n\n![url](https://img.shields.io/badge/url-purple)\n\n```py\nfrom pasteconnect import get_raw\n\nresult = get_raw(url)\nprint(result)\n```\n\nAlternatively, you can use the `get_raw` function:\n\n```py\nurl = \"https://pastebin.com/kZATAWhe\"\nresult = pastebin.get_raw_content(url)\nprint(result)  # Response: \"Content of paste\"\n```\n\n---\n# Made with \u2764\ufe0f by [Heartlog](https://github.com/heartlog/)\n\n## Special Thanks \nvenaxyt for [pastebinapi](https://github.com/venaxyt/pastebinapi/). Helped a lot in project. \ud83d\ude01\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Package to read and upload code/text to pastebin.com.",
    "version": "0.6.2",
    "project_urls": {
        "Download": "https://github.com/heartlog/pasteconnect/releases",
        "Homepage": "https://github.com/heartlog/pasteconnect"
    },
    "split_keywords": [
        "pastebin",
        "pastebinapi",
        "client",
        "opensource"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8bb6bca34c73a43b577963cf4e51acfe326947a41c48ddfe218b6df2161a1396",
                "md5": "d51a4a809b3c2295e1e67574c64186ea",
                "sha256": "1970c2405269990b49cb466f06754ffcc80d0b8be605dff3520386caa7524519"
            },
            "downloads": -1,
            "filename": "pasteconnect-0.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d51a4a809b3c2295e1e67574c64186ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6022,
            "upload_time": "2023-11-08T16:35:26",
            "upload_time_iso_8601": "2023-11-08T16:35:26.256649Z",
            "url": "https://files.pythonhosted.org/packages/8b/b6/bca34c73a43b577963cf4e51acfe326947a41c48ddfe218b6df2161a1396/pasteconnect-0.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16094e96c47f5d355b186a9d9062a33bb52eb0bbb3439d23fbfc459c9c391184",
                "md5": "a89dccd70f5b14ec434e9de71248a707",
                "sha256": "0524d090bc3c955ececf0a779fc2689b29822d0c3c440a157c39be836c71f02e"
            },
            "downloads": -1,
            "filename": "pasteconnect-0.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a89dccd70f5b14ec434e9de71248a707",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5384,
            "upload_time": "2023-11-08T16:35:27",
            "upload_time_iso_8601": "2023-11-08T16:35:27.420004Z",
            "url": "https://files.pythonhosted.org/packages/16/09/4e96c47f5d355b186a9d9062a33bb52eb0bbb3439d23fbfc459c9c391184/pasteconnect-0.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-08 16:35:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "heartlog",
    "github_project": "pasteconnect",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pasteconnect"
}
        
Elapsed time: 0.13701s