{"id":15685876,"url":"https://github.com/bachya/aiopinboard","last_synced_at":"2025-04-16T05:58:00.340Z","repository":{"id":39498562,"uuid":"292658250","full_name":"bachya/aiopinboard","owner":"bachya","description":"A Python 3, asyncio-based library to interact with the Pinboard API","archived":false,"fork":false,"pushed_at":"2025-03-28T08:17:48.000Z","size":1390,"stargazers_count":10,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-03-29T05:05:55.875Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bachya.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":"2020-09-03T19:12:02.000Z","updated_at":"2025-01-19T06:24:37.000Z","dependencies_parsed_at":"2024-10-24T21:15:07.049Z","dependency_job_id":"f4fcf47f-3363-4d68-86b8-be333b96824e","html_url":"https://github.com/bachya/aiopinboard","commit_stats":{"total_commits":131,"total_committers":4,"mean_commits":32.75,"dds":"0.48091603053435117","last_synced_commit":"4a0797413b9f9418924fbc899c9c3ed42ff11e1d"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiopinboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiopinboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiopinboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachya%2Faiopinboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachya","download_url":"https://codeload.github.com/bachya/aiopinboard/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249205858,"owners_count":21230008,"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-10-03T17:32:24.381Z","updated_at":"2025-04-16T05:58:00.317Z","avatar_url":"https://github.com/bachya.png","language":"Python","funding_links":["https://www.buymeacoffee.com/bachya1208P"],"categories":[],"sub_categories":[],"readme":"# 📌 aiopinboard: A Python 3 Library for Pinboard\n\n[![CI][ci-badge]][ci]\n[![PyPI][pypi-badge]][pypi]\n[![Version][version-badge]][version]\n[![License][license-badge]][license]\n[![Code Coverage][codecov-badge]][codecov]\n[![Maintainability][maintainability-badge]][maintainability]\n\n\u003ca href=\"https://www.buymeacoffee.com/bachya1208P\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n`aiopinboard` is a Python3, `asyncio`-focused library for interacting with the\n[Pinboard][pinboard] API.\n\n- [Installation](#installation)\n- [Python Versions](#python-versions)\n- [API Token](#api-token)\n- [Usage](#usage)\n  - [Bookmarks](#bookmarks)\n    - [The `Bookmark` Object](#the--bookmark--object)\n    - [Getting the Last Change Datetime](#getting-the-last-change-datetime)\n    - [Getting Bookmarks](#getting-bookmarks)\n    - [Adding a Bookmark](#adding-a-bookmark)\n    - [Deleting a Bookmark](#deleting-a-bookmark)\n  - [Tags](#tags)\n    - [Getting Tags](#getting-tags)\n    - [Getting Suggested Tags](#getting-suggested-tags)\n    - [Deleting a Tag](#deleting-a-tag)\n    - [Renaming a Tag](#renaming-a-tag)\n  - [Notes](#notes)\n    - [The `Note` Object](#the--note--object)\n    - [Getting Notes](#getting-notes)\n- [Contributing](#contributing)\n\n# Installation\n\n```bash\npip install aiopinboard\n```\n\n# Python Versions\n\n`aiopinboard` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# API Token\n\nYou can retrieve your Pinboard API token via\n[your account's settings page][pinboard-settings].\n\n# Usage\n\n`aiopinboard` endeavors to replicate all of the endpoints in\n[the Pinboard API documentation][pinboard-api] with sane, usable responses.\n\nAll API usage starts with creating an `API` object that contains your Pinboard API token:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    # do things!\n\n\nasyncio.run(main())\n```\n\n## Bookmarks\n\n### The `Bookmark` Object\n\nAPI endpoints that retrieve one or more bookmarks will return `Bookmark` objects, which\ncarry all of the expected properties of a bookmark:\n\n- `hash`: the unique identifier of the bookmark\n- `href`: the bookmark's URL\n- `title`: the bookmark's title\n- `description`: the bookmark's description\n- `last_modified`: the UTC date the bookmark was last modified\n- `tags`: a list of tags applied to the bookmark\n- `unread`: whether the bookmark is unread\n- `shared`: whether the bookmark is shared\n\n### Getting the Last Change Datetime\n\nTo get the UTC datetime of the last \"change\" (bookmark added, updated, or deleted):\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    last_change_dt = await api.bookmark.async_get_last_change_datetime()\n    # \u003e\u003e\u003e datetime.datetime(2020, 9, 3, 13, 7, 19, tzinfo=\u003cUTC\u003e)\n\n\nasyncio.run(main())\n```\n\nThis method should be used to determine whether additional API calls should be made –\nfor example, if nothing has changed since the last time a request was made, the\nimplementing library can halt.\n\n### Getting Bookmarks\n\nTo get a bookmark by its URL:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_get_bookmark_by_url(\"https://my.com/bookmark\")\n    # \u003e\u003e\u003e \u003cBookmark href=\"https://my.com/bookmark\"\u003e\n\n\nasyncio.run(main())\n```\n\nTo get all bookmarks\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_get_all_bookmarks()\n    # \u003e\u003e\u003e [\u003cBookmark ...\u003e, \u003cBookmark ...\u003e]\n\n\nasyncio.run(main())\n```\n\nYou can specify several optional parameters while getting all bookmarks:\n\n- `tags`: an optional list of tags to filter results by\n- `start`: the optional starting index to return (defaults to the start)\n- `results`: the optional number of results (defaults to all)\n- `from_dt`: the optional datetime to start from\n- `to_dt`: the optional datetime to end at\n\nTo get all bookmarks created on a certain date:\n\n```python\nimport asyncio\nfrom datetime import date\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    \"\"\"Run!\"\"\"\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_get_bookmarks_by_date(date.today())\n    # \u003e\u003e\u003e [\u003cBookmark ...\u003e, \u003cBookmark ...\u003e]\n\n    # Optionally filter the results with a list of tags – note that only bookmarks that\n    # have all tags will be returned:\n    await api.bookmark.async_get_bookmarks_by_date(date.today(), tags=[\"tag1\", \"tag2\"])\n    # \u003e\u003e\u003e [\u003cBookmark ...\u003e, \u003cBookmark ...\u003e]\n\n\nasyncio.run(main())\n```\n\nTo get recent bookmarks:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_get_recent_bookmarks(count=10)\n    # \u003e\u003e\u003e [\u003cBookmark ...\u003e, \u003cBookmark ...\u003e]\n\n    # Optionally filter the results with a list of tags – note that only bookmarks that\n    # have all tags will be returned:\n    await api.bookmark.async_get_recent_bookmarks(count=20, tags=[\"tag1\", \"tag2\"])\n    # \u003e\u003e\u003e [\u003cBookmark ...\u003e, \u003cBookmark ...\u003e]\n\n\nasyncio.run(main())\n```\n\nTo get a summary of dates and how many bookmarks were created on those dates:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    dates = await api.bookmark.async_get_dates()\n    # \u003e\u003e\u003e {datetime.date(2020, 09, 05): 4, ...}\n\n\nasyncio.run(main())\n```\n\n### Adding a Bookmark\n\nTo add a bookmark:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_add_bookmark(\"https://my.com/bookmark\", \"My New Bookmark\")\n\n\nasyncio.run(main())\n```\n\nYou can specify several optional parameters while adding a bookmark:\n\n- `description`: the optional description of the bookmark\n- `tags`: an optional list of tags to assign to the bookmark\n- `created_datetime`: the optional creation datetime to use (defaults to now)\n- `replace`: whether this should replace a bookmark with the same URL\n- `shared`: whether this bookmark should be shared\n- `toread`: whether this bookmark should be unread\n\n### Deleting a Bookmark\n\nTo delete a bookmark by its URL:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_delete_bookmark(\"https://my.com/bookmark\")\n\n\nasyncio.run(main())\n```\n\n## Tags\n\n### Getting Tags\n\nTo get all tags for an account (and a count of how often each tag is used):\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.tag.async_get_tags()\n    # \u003e\u003e\u003e {\"tag1\": 3, \"tag2\": 8}\n\n\nasyncio.run(main())\n```\n\n### Getting Suggested Tags\n\nTo get lists of popular (used by the community) and recommended (used by you) tags for a\nparticular URL:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.bookmark.async_get_suggested_tags(\"https://my.com/bookmark\")\n    # \u003e\u003e\u003e {\"popular\": [\"tag1\", \"tag2\"], \"recommended\": [\"tag3\"]}\n\n\nasyncio.run(main())\n```\n\n### Deleting a Tag\n\nTo delete a tag:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.tag.async_delete_tag(\"tag1\")\n\n\nasyncio.run(main())\n```\n\n### Renaming a Tag\n\nTo rename a tag:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.tag.async_rename_tag(\"old-tag\", \"new-tag\")\n\n\nasyncio.run(main())\n```\n\n## Notes\n\n### The `Note` Object\n\nAPI endpoints that retrieve one or more notes will return `Note` objects, which\ncarry all of the expected properties of a note:\n\n- `note_id`: the unique ID\n- `title`: the title\n- `hash`: the computed hash\n- `created_at`: the UTC datetime the note was created\n- `updated_at`: the UTC datetime the note was updated\n- `length`: the length\n\n### Getting Notes\n\nTo get all notes for an account:\n\n```python\nimport asyncio\n\nfrom aiopinboard import API\n\n\nasync def main() -\u003e None:\n    api = API(\"\u003cPINBOARD_API_TOKEN\u003e\")\n    await api.note.async_get_notes()\n    # \u003e\u003e\u003e [\u003cNote ...\u003e, \u003cNote ...\u003e]\n\n\nasyncio.run(main())\n```\n\n# Contributing\n\nThanks to all of [our contributors][contributors] so far!\n\n1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].\n2. [Fork the repository][fork].\n3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`\n4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`\n5. Install the dev environment: `script/setup`\n6. Code your new feature or bug fix on a new branch.\n7. Write tests that cover your new functionality.\n8. Run tests and ensure 100% code coverage: `poetry run pytest --cov aiopinboard tests`\n9. Update `README.md` with any new documentation.\n10. Submit a pull request!\n\n[aiohttp]: https://github.com/aio-libs/aiohttp\n[ambient-weather-dashboard]: https://dashboard.ambientweather.net\n[ambient-weather-rate-limiting]: https://ambientweather.docs.apiary.io/#introduction/rate-limiting\n[ambient-weather]: https://ambientweather.net\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/bachya/aiopinboard/test.yml\n[ci]: https://github.com/bachya/aiopinboard/actions\n[codecov-badge]: https://codecov.io/gh/bachya/aiopinboard/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/aiopinboard\n[contributors]: https://github.com/bachya/aiopinboard/graphs/contributors\n[fork]: https://github.com/bachya/aiopinboard/fork\n[issues]: https://github.com/bachya/aiopinboard/issues\n[license-badge]: https://img.shields.io/pypi/l/aiopinboard.svg\n[license]: https://github.com/bachya/aiopinboard/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/4c0360a07493d3c1fd03/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/aiopinboard/maintainability\n[new-issue]: https://github.com/bachya/aiopinboard/issues/new\n[new-issue]: https://github.com/bachya/aiopinboard/issues/new\n[pinboard-api]: https://pinboard.in/api\n[pinboard-settings]: https://pinboard.in/settings/password\n[pinboard]: https://pinboard.in\n[pypi-badge]: https://img.shields.io/pypi/v/aiopinboard.svg\n[pypi]: https://pypi.python.org/pypi/aiopinboard\n[version-badge]: https://img.shields.io/pypi/pyversions/aiopinboard.svg\n[version]: https://pypi.python.org/pypi/aiopinboard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faiopinboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachya%2Faiopinboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachya%2Faiopinboard/lists"}