your-telegraph


Nameyour-telegraph JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/alterxyz/ytelegraph
SummaryA simple Python wrapper for the Telegraph API
upload_time2024-07-16 10:47:23
maintainerNone
docs_urlNone
authoralterxyz
requires_python>=3.8
licenseNone
keywords telegraph api wrapper markdown publishing
VCS
bugtrack_url
requirements beautifulsoup4 Markdown requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # YTelegraph

[![PyPi Package Version](https://img.shields.io/pypi/v/your-telegraph.svg)](https://pypi.python.org/pypi/your-telegraph)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/your-telegraph.svg)](https://pypi.python.org/pypi/your-telegraph)
[![PyPi downloads](https://img.shields.io/pypi/dm/your-telegraph.svg)](https://pypi.org/project/your-telegraph/)
[![PyPi status](https://img.shields.io/pypi/status/your-telegraph.svg?style=flat-square)](https://pypi.python.org/pypi/your-telegraph)
![License](https://img.shields.io/github/license/alterxyz/ytelegraph)

YTelegraph is a simple, user-friendly Python wrapper for the Telegraph API. Publish your content to Telegraph with just a few lines of code!

## Table of Contents

- [YTelegraph](#ytelegraph)
    - [Table of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Quick Start](#quick-start)
    - [Key Features](#key-features)
    - [Why YTelegraph?](#why-ytelegraph)
    - [More Examples](#more-examples)
        - [Create a page from a Markdown file](#create-a-page-from-a-markdown-file)
        - [Use your own Telegraph token](#use-your-own-telegraph-token)
        - [Advanced Usage](#advanced-usage)
    - [Token Management](#token-management)
    - [Testing](#testing)
    - [Versioning](#versioning)
    - [Support](#support)
    - [Contributing](#contributing)
    - [License](#license)

## Installation

```bash
pip install your-telegraph
```

## Quick Start

Publish a Telegraph page in just 4 lines of code:

```python
from ytelegraph import TelegraphAPI

ph = TelegraphAPI()
content = "# Hello, Telegraph!\n\nThis is my first Telegraph page using YTelegraph."
ph_link = ph.create_page_md("My First Page", content)
print(f"Your page is live at: {ph_link}")
```

That's it! No need to worry about tokens, account creation, or complex API calls.

## Key Features

- **Simple**: Create and publish Telegraph pages with minimal code.
- **Markdown Support**: Write your content in Markdown and let YTelegraph handle the conversion.
- **Flexible Token Management**: Use your own token or let YTelegraph handle account creation.
- **Full API Access**: For advanced users, complete access to Telegraph API features is available.

## Why YTelegraph?

"All you need is a title and content. That's it. Just like <https://telegra.ph/>, but in Python."

YTelegraph brings the simplicity of Telegraph's web interface to your Python projects. Whether you're creating a bot, a content management system, or just want to quickly publish some content, YTelegraph makes it easy.

## More Examples

### Create a page from a Markdown file

```python
from ytelegraph import TelegraphAPI

ph = TelegraphAPI()

with open('my_article.md', 'r') as f:
    content = f.read()

ph_link = ph.create_page_md("My Article", content)
print(f"Article published at: {ph_link}")
```

### Use your own Telegraph token

```python
from os import environ
from ytelegraph import TelegraphAPI

TELEGRA_PH_TOKEN = environ.get("TELEGRA_PH_TOKEN")

ph = TelegraphAPI(TELEGRA_PH_TOKEN)
```

This method is useful if you want to use an existing Telegraph account or manage tokens yourself.

### Advanced Usage

Try and see the `example/second_usage.py` at [here](examples/second_usage.py).

## Token Management

YTelegraph offers flexible token management:

1. **Automatic**: If no token is provided, YTelegraph creates a new account and manages the token for you.
2. **Environment Variable**: Set the `TELEGRA_PH_TOKEN` environment variable, and YTelegraph will use it automatically.
3. **Direct Input**: Pass your token directly to the `TelegraphAPI` constructor.

Choose the method that best fits your workflow and security requirements.

## Testing

To run the basic integration tests, execute the examples in the `examples/` directory:

```bash
python examples/basic_usage.py
python examples/second_usage.py
```

## Versioning

For the versions available, see the [CHANGELOG.md](CHANGELOG.md) file.

## Support

If you encounter any problems or have any questions, please [open an issue](https://github.com/alterxyz/ytelegraph/issues) on our GitHub repository.

## Contributing

We welcome contributions! Feel free to submit issues or pull requests.

## License

YTelegraph is released under the MIT License. See [LICENSE](LICENSE) for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alterxyz/ytelegraph",
    "name": "your-telegraph",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "telegraph api wrapper markdown publishing",
    "author": "alterxyz",
    "author_email": "88554920+alterxyz@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/99/f1/9e63441d8de2f0f366eaed58ecc73685f8c874709d3c007b3fc59d299545/your_telegraph-0.2.0.tar.gz",
    "platform": null,
    "description": "# YTelegraph\r\n\r\n[![PyPi Package Version](https://img.shields.io/pypi/v/your-telegraph.svg)](https://pypi.python.org/pypi/your-telegraph)\r\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/your-telegraph.svg)](https://pypi.python.org/pypi/your-telegraph)\r\n[![PyPi downloads](https://img.shields.io/pypi/dm/your-telegraph.svg)](https://pypi.org/project/your-telegraph/)\r\n[![PyPi status](https://img.shields.io/pypi/status/your-telegraph.svg?style=flat-square)](https://pypi.python.org/pypi/your-telegraph)\r\n![License](https://img.shields.io/github/license/alterxyz/ytelegraph)\r\n\r\nYTelegraph is a simple, user-friendly Python wrapper for the Telegraph API. Publish your content to Telegraph with just a few lines of code!\r\n\r\n## Table of Contents\r\n\r\n- [YTelegraph](#ytelegraph)\r\n    - [Table of Contents](#table-of-contents)\r\n    - [Installation](#installation)\r\n    - [Quick Start](#quick-start)\r\n    - [Key Features](#key-features)\r\n    - [Why YTelegraph?](#why-ytelegraph)\r\n    - [More Examples](#more-examples)\r\n        - [Create a page from a Markdown file](#create-a-page-from-a-markdown-file)\r\n        - [Use your own Telegraph token](#use-your-own-telegraph-token)\r\n        - [Advanced Usage](#advanced-usage)\r\n    - [Token Management](#token-management)\r\n    - [Testing](#testing)\r\n    - [Versioning](#versioning)\r\n    - [Support](#support)\r\n    - [Contributing](#contributing)\r\n    - [License](#license)\r\n\r\n## Installation\r\n\r\n```bash\r\npip install your-telegraph\r\n```\r\n\r\n## Quick Start\r\n\r\nPublish a Telegraph page in just 4 lines of code:\r\n\r\n```python\r\nfrom ytelegraph import TelegraphAPI\r\n\r\nph = TelegraphAPI()\r\ncontent = \"# Hello, Telegraph!\\n\\nThis is my first Telegraph page using YTelegraph.\"\r\nph_link = ph.create_page_md(\"My First Page\", content)\r\nprint(f\"Your page is live at: {ph_link}\")\r\n```\r\n\r\nThat's it! No need to worry about tokens, account creation, or complex API calls.\r\n\r\n## Key Features\r\n\r\n- **Simple**: Create and publish Telegraph pages with minimal code.\r\n- **Markdown Support**: Write your content in Markdown and let YTelegraph handle the conversion.\r\n- **Flexible Token Management**: Use your own token or let YTelegraph handle account creation.\r\n- **Full API Access**: For advanced users, complete access to Telegraph API features is available.\r\n\r\n## Why YTelegraph?\r\n\r\n\"All you need is a title and content. That's it. Just like <https://telegra.ph/>, but in Python.\"\r\n\r\nYTelegraph brings the simplicity of Telegraph's web interface to your Python projects. Whether you're creating a bot, a content management system, or just want to quickly publish some content, YTelegraph makes it easy.\r\n\r\n## More Examples\r\n\r\n### Create a page from a Markdown file\r\n\r\n```python\r\nfrom ytelegraph import TelegraphAPI\r\n\r\nph = TelegraphAPI()\r\n\r\nwith open('my_article.md', 'r') as f:\r\n    content = f.read()\r\n\r\nph_link = ph.create_page_md(\"My Article\", content)\r\nprint(f\"Article published at: {ph_link}\")\r\n```\r\n\r\n### Use your own Telegraph token\r\n\r\n```python\r\nfrom os import environ\r\nfrom ytelegraph import TelegraphAPI\r\n\r\nTELEGRA_PH_TOKEN = environ.get(\"TELEGRA_PH_TOKEN\")\r\n\r\nph = TelegraphAPI(TELEGRA_PH_TOKEN)\r\n```\r\n\r\nThis method is useful if you want to use an existing Telegraph account or manage tokens yourself.\r\n\r\n### Advanced Usage\r\n\r\nTry and see the `example/second_usage.py` at [here](examples/second_usage.py).\r\n\r\n## Token Management\r\n\r\nYTelegraph offers flexible token management:\r\n\r\n1. **Automatic**: If no token is provided, YTelegraph creates a new account and manages the token for you.\r\n2. **Environment Variable**: Set the `TELEGRA_PH_TOKEN` environment variable, and YTelegraph will use it automatically.\r\n3. **Direct Input**: Pass your token directly to the `TelegraphAPI` constructor.\r\n\r\nChoose the method that best fits your workflow and security requirements.\r\n\r\n## Testing\r\n\r\nTo run the basic integration tests, execute the examples in the `examples/` directory:\r\n\r\n```bash\r\npython examples/basic_usage.py\r\npython examples/second_usage.py\r\n```\r\n\r\n## Versioning\r\n\r\nFor the versions available, see the [CHANGELOG.md](CHANGELOG.md) file.\r\n\r\n## Support\r\n\r\nIf you encounter any problems or have any questions, please [open an issue](https://github.com/alterxyz/ytelegraph/issues) on our GitHub repository.\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! Feel free to submit issues or pull requests.\r\n\r\n## License\r\n\r\nYTelegraph is released under the MIT License. See [LICENSE](LICENSE) for details.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple Python wrapper for the Telegraph API",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/alterxyz/ytelegraph/issues",
        "Documentation": "https://github.com/alterxyz/ytelegraph/blob/main/README.md",
        "Homepage": "https://github.com/alterxyz/ytelegraph",
        "Source Code": "https://github.com/alterxyz/ytelegraph"
    },
    "split_keywords": [
        "telegraph",
        "api",
        "wrapper",
        "markdown",
        "publishing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba26aa66273589a2dc308ce01b8f25939384ce4fbd9f184008b3361ebf518249",
                "md5": "77558d676ff5f74c9093a350c98aafa4",
                "sha256": "8dfdc8cd73de320acb182fd255f20dd8e80f93151a581625269e8fc6c10fe44b"
            },
            "downloads": -1,
            "filename": "your_telegraph-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "77558d676ff5f74c9093a350c98aafa4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12033,
            "upload_time": "2024-07-16T10:47:21",
            "upload_time_iso_8601": "2024-07-16T10:47:21.304899Z",
            "url": "https://files.pythonhosted.org/packages/ba/26/aa66273589a2dc308ce01b8f25939384ce4fbd9f184008b3361ebf518249/your_telegraph-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99f19e63441d8de2f0f366eaed58ecc73685f8c874709d3c007b3fc59d299545",
                "md5": "4268e32124bad22a31de5dcd63c0d4b6",
                "sha256": "8ca441ad4ef74a3ed9523992b060d57517b974622de408b91356661c0df40bed"
            },
            "downloads": -1,
            "filename": "your_telegraph-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4268e32124bad22a31de5dcd63c0d4b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10632,
            "upload_time": "2024-07-16T10:47:23",
            "upload_time_iso_8601": "2024-07-16T10:47:23.121083Z",
            "url": "https://files.pythonhosted.org/packages/99/f1/9e63441d8de2f0f366eaed58ecc73685f8c874709d3c007b3fc59d299545/your_telegraph-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-16 10:47:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alterxyz",
    "github_project": "ytelegraph",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    ">=",
                    "4.12.3"
                ],
                [
                    "<",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "Markdown",
            "specs": [
                [
                    ">=",
                    "3.6"
                ],
                [
                    "<",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "<",
                    "3.0.0"
                ],
                [
                    ">=",
                    "2.32.3"
                ]
            ]
        }
    ],
    "lcname": "your-telegraph"
}
        
Elapsed time: 0.35397s