{"id":22114306,"url":"https://github.com/froosty/aiorentry","last_synced_at":"2025-07-25T08:31:26.844Z","repository":{"id":255486721,"uuid":"838267353","full_name":"froosty/aiorentry","owner":"froosty","description":"Asynchronous API client for pastebin service https://rentry.co/ (https://rentry.org/)","archived":false,"fork":false,"pushed_at":"2024-11-18T17:22:29.000Z","size":165,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-18T18:38:49.514Z","etag":null,"topics":["markdown","pastebin","pastebin-client","rentry","rentryco","rentryorg"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/froosty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-05T09:43:43.000Z","updated_at":"2024-11-18T17:21:03.000Z","dependencies_parsed_at":"2024-11-19T05:21:31.250Z","dependency_job_id":null,"html_url":"https://github.com/froosty/aiorentry","commit_stats":null,"previous_names":["froosty/aiorentry"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froosty%2Faiorentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froosty%2Faiorentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froosty%2Faiorentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froosty%2Faiorentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/froosty","download_url":"https://codeload.github.com/froosty/aiorentry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227544345,"owners_count":17785198,"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":["markdown","pastebin","pastebin-client","rentry","rentryco","rentryorg"],"created_at":"2024-12-01T11:11:21.948Z","updated_at":"2025-07-25T08:31:26.804Z","avatar_url":"https://github.com/froosty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aiorentry\n\nAsynchronous API client for [rentry.co](https://rentry.co) (mirror: [rentry.org](https://rentry.org))\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/froosty/aiorentry/lint_and_test.yml)](https://github.com/froosty/aiorentry/actions/workflows/lint_and_test.yml)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/froosty/aiorentry/daily_test.yml?label=daily%20check)](https://github.com/froosty/aiorentry/actions/workflows/daily_test.yml)\n[![codecov](https://codecov.io/gh/froosty/aiorentry/graph/badge.svg?token=FJBRTOQ2HR)](https://codecov.io/gh/froosty/aiorentry)\n[![PyPI - Version](https://img.shields.io/pypi/v/aiorentry)](https://pypi.org/project/aiorentry/)\n[![GitHub License](https://img.shields.io/github/license/froosty/aiorentry)](https://github.com/froosty/aiorentry/blob/main/LICENSE)\n\n## About\n\nThis package allows you to interact with the [rentry.co](https://rentry.co) (or [rentry.org](https://rentry.org)) service.\n\nRentry.co is a markdown pastebin and publishing service that offers features such as previews, custom URLs, and editing.\n\n**Please note** that this library is not developed by the official authors of rentry.co. It replicates the functionality of the [official console utility](https://github.com/radude/rentry), but provides it as an asynchronous API client. With this package you can manage your pages: create, edit and delete, as well as get raw text. All directly from your asynchronous Python application.\n\n## Installation\n\n```bash\npip install aiorentry\n```\n\n## Setup client\n\nYou can setup client in 2 ways:\n\n### As classic object\n\n\u003e [!CAUTION]\n\u003e If you prefer the classic way, you should call `await client.setup()` during initialization and `await client.close()` during completion\n\n```python\nimport asyncio\n\nfrom aiorentry.client import Client\n\n\nasync def main():\n    client = Client('https://rentry.co')\n    await client.setup()\n\n    # Your code here\n\n    await client.close()\n\n\nasyncio.run(main())\n```\n\n### As async context manager\n\n```python\nimport asyncio\n\nfrom aiorentry.client import Client\n\n\nasync def main():\n    async with Client('https://rentry.co') as client:\n        # Your code here\n\n\nasyncio.run(main())\n```\n\n## Examples\n\n### Create new page\n\n```python\n...\n# Create new page\npage = await client.new_page(\n    '## Hello world from awesome API',\n)\n\nprint(page)\n...\n```\n\n```bash\nPage(url='m2e2wpe8', edit_code='hUHeRUei', text='## Hello world from awesome API')\n```\n\n```python\n...\n# Create new page with custom url and edit_code\nawesome_page = await client.new_page(\n    '## Hello world from awesome API',\n    url='awesome-url',\n    edit_code='qwerty=)'\n)\n\nprint(awesome_page)\n...\n```\n\n```bash\nPage(url='awesome-url', edit_code='qwerty=)', text='## Hello world from awesome API')\n```\n\n### Edit page\n\n```python\n...\n# Edit page\nawait client.edit_page(\n    '### Updated Hello world',\n    url='awesome-url',\n    edit_code='qwerty=)',\n)\n...\n```\n\n### Delete page\n\n```python\n...\n# Delete page\nawait client.delete_page(\n    url='awesome-url',\n    edit_code='qwerty=)',\n)\n...\n```\n\n### Get raw page text\n\n\u003e [!NOTE]\n\u003e This rentry functionality has limitations now. You can't just view the source text of any page.\n\n```python\n...\n# Get raw content\ncontent = await client.raw(\n    'awesome-url',\n    secret_raw_access_code='YOUR_CODE_HERE',  # optional\n)\nprint(content)\n...\n```\n\n```\n### Updated Hello world\n```\n\nTo view the source text you have 2 options:\n1. Specify your personal code inside page metadata. In this case, everyone will have access to the source text of the page through the API.\n2. Specify your personal code when trying to get the source text of any page. In this case, you will be able to get the source text, regardless of the metadata of the target page\n\n### Get PDF file\n\n\u003e [!NOTE]\n\u003e This functionality has been removed from the library as it is no longer available in the original service via API. This method will be completely removed in the next version.\n\n### Get PNG\n\n\u003e [!NOTE]\n\u003e This functionality has been removed from the library as it is no longer available in the original service via API. This method will be completely removed in the next version.\n\n## Custom ClientSession\n\n\u003e [!NOTE]\n\u003e By default, a new instance of `aiohttp.ClientSession` will be created automatically. So normally you don't need to worry about this.\n\nIf you don't want to automatically create the session object inside the client, you can pass an existing `aiohttp.ClientSession` to the client constructor.\n\n\u003e [!CAUTION]\n\u003e If you pass an existing session object to the client constructor, then you should care about releasing resources yourself. \\\n\u003e **The session will not be closed automatically!** Even if the asynchronous context manager was used.\n\n```python\nfrom aiohttp import ClientSession, TCPConnector\nfrom aiorentry.client import Client\n\nconnector = TCPConnector(\n    limit=5,  # Just for example\n)\n\nsession = ClientSession(\n    connector=connector,\n)\n\n\nasync with Client('https://rentry.co', session=session) as client:\n    # Your code here\n\nasync with session.get(...) as response:\n    # You can still use this session object\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroosty%2Faiorentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffroosty%2Faiorentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroosty%2Faiorentry/lists"}