padlet-py


Namepadlet-py JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA Padlet API wrapper written in python using async/await syntax
upload_time2024-08-17 10:42:03
maintainerNone
docs_urlNone
authorHypurrnating
requires_python>=3.10
licenseMIT License Copyright (c) 2024 Hypurrnating Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords padlet padlet api padlet wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # padlet py
 A Padlet API wrapper written in python using async/await syntax

 ## Usage

### Get started
 ``` 
 pip install padlet-py 
 ```
In your file:
 ```py
import padlet

api_key = "pdlt_0000"  # your padlet api key.
board_id = "mwrsf0033"  # The board id you are interested in.

# Create an user object.
user = padlet.user(api_key)

# This will create a board object, but it won't have any data yet.
board = user.board(board_id)
```
```py
# You must fetch the data from the api using:
await board.fetch()
# The board attributes, sections, and posts (including attachments) are 
# now loaded into the object.
 ```

 ### How to use
 ```py
# The boards posts are stored in a dictionary by their ID.
a_post_that_i_need = board.posts['post_id']
a_section_that_i_need = board.sections['section_id']
 ```
 At the moment, this dictionary is editable, so take care to not overwrite any values in it. \
 You can .fetch() the board again to load the posts and sections again from scratch.
 

 Heres you can create a post to the padlet board:
 ```py
async def create_post():
    # I'm going to grab the first section of my board
    section = board.sections.values()[0] 
    await board.create('args go here')
 ```
 Here are the args that you can pass to the .create() function:

 |Arg|Type|Optional?|
 |---|---|---|
 | subject | str | No |
 | body | str | No |
 | color | Literal['red', 'orange', 'green', 'blue', 'purple'] | Yes |
 | attachment_url | str | Yes |
 | attachment_caption | str | Yes |
 | status | Literal['approved', 'pending_moderation', 'scheduled'] | Yes |
 | map | map_object | Yes |
 | canvas | canvas_object | Yes |
 | previous_post | post_object | Yes |

Notice that some of the args are `objects`. You can deal with those like this:
```py
# Import all the objects you need
from padlet import user, map_object, canvas_object, post_object, section_object

async def create(section: section_object):
    # You can create your own map object by the method below
    # or depending on your needs, reference one from another post
    map = map_object()
    map.latitude = 321
    map.longitude = 321
    map.location_name = 'Python HQ'

    # You can also construct your own post object, using just the id.
    post = post_object()
    post.id = 'post_id'
    # Again, its recommended that you reference another post from the board:
    post = section.board.posts['post_id'] 

    await section.create(subject='Python',
                         body='Just testing',
                         status='approved',
                         map=map,
                         previous_post=post)
```


## Caveats?
At the moment this wrapper does not deal with ratelimits or error codes. That is already planned.

I also hope to make this wrapper more forwards compatible, so that it doesn't break due to any sudden changes in the padlet API.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "padlet-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "padlet, padlet api, padlet wrapper",
    "author": "Hypurrnating",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c4/51/23d8116f3dad971858965379e53720be9b8945389ba1fd793021b825c5b8/padlet_py-1.0.1.tar.gz",
    "platform": null,
    "description": "# padlet py\n A Padlet API wrapper written in python using async/await syntax\n\n ## Usage\n\n### Get started\n ``` \n pip install padlet-py \n ```\nIn your file:\n ```py\nimport padlet\n\napi_key = \"pdlt_0000\"  # your padlet api key.\nboard_id = \"mwrsf0033\"  # The board id you are interested in.\n\n# Create an user object.\nuser = padlet.user(api_key)\n\n# This will create a board object, but it won't have any data yet.\nboard = user.board(board_id)\n```\n```py\n# You must fetch the data from the api using:\nawait board.fetch()\n# The board attributes, sections, and posts (including attachments) are \n# now loaded into the object.\n ```\n\n ### How to use\n ```py\n# The boards posts are stored in a dictionary by their ID.\na_post_that_i_need = board.posts['post_id']\na_section_that_i_need = board.sections['section_id']\n ```\n At the moment, this dictionary is editable, so take care to not overwrite any values in it. \\\n You can .fetch() the board again to load the posts and sections again from scratch.\n \n\n Heres you can create a post to the padlet board:\n ```py\nasync def create_post():\n    # I'm going to grab the first section of my board\n    section = board.sections.values()[0] \n    await board.create('args go here')\n ```\n Here are the args that you can pass to the .create() function:\n\n |Arg|Type|Optional?|\n |---|---|---|\n | subject | str | No |\n | body | str | No |\n | color | Literal['red', 'orange', 'green', 'blue', 'purple'] | Yes |\n | attachment_url | str | Yes |\n | attachment_caption | str | Yes |\n | status | Literal['approved', 'pending_moderation', 'scheduled'] | Yes |\n | map | map_object | Yes |\n | canvas | canvas_object | Yes |\n | previous_post | post_object | Yes |\n\nNotice that some of the args are `objects`. You can deal with those like this:\n```py\n# Import all the objects you need\nfrom padlet import user, map_object, canvas_object, post_object, section_object\n\nasync def create(section: section_object):\n    # You can create your own map object by the method below\n    # or depending on your needs, reference one from another post\n    map = map_object()\n    map.latitude = 321\n    map.longitude = 321\n    map.location_name = 'Python HQ'\n\n    # You can also construct your own post object, using just the id.\n    post = post_object()\n    post.id = 'post_id'\n    # Again, its recommended that you reference another post from the board:\n    post = section.board.posts['post_id'] \n\n    await section.create(subject='Python',\n                         body='Just testing',\n                         status='approved',\n                         map=map,\n                         previous_post=post)\n```\n\n\n## Caveats?\nAt the moment this wrapper does not deal with ratelimits or error codes. That is already planned.\n\nI also hope to make this wrapper more forwards compatible, so that it doesn't break due to any sudden changes in the padlet API.\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Hypurrnating  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Padlet API wrapper written in python using async/await syntax",
    "version": "1.0.1",
    "project_urls": {
        "Repository": "https://github.com/Hypurrnating/padlet-py"
    },
    "split_keywords": [
        "padlet",
        " padlet api",
        " padlet wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f63524a096d0779c35470dc7da99840242362847b94ed1bd3954ebeb41733fd",
                "md5": "5592642a9fd9e730a4a3d569f44132c5",
                "sha256": "d655795ac277c31e5d78aa72dc0709a28dba4652de2588b5716f02d5483c0631"
            },
            "downloads": -1,
            "filename": "padlet_py-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5592642a9fd9e730a4a3d569f44132c5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7422,
            "upload_time": "2024-08-17T10:42:02",
            "upload_time_iso_8601": "2024-08-17T10:42:02.540506Z",
            "url": "https://files.pythonhosted.org/packages/7f/63/524a096d0779c35470dc7da99840242362847b94ed1bd3954ebeb41733fd/padlet_py-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c45123d8116f3dad971858965379e53720be9b8945389ba1fd793021b825c5b8",
                "md5": "8f01d5e361012f666554a47a2fd3b48b",
                "sha256": "96480b60c21d94d16e9ee13a060038968fd1c63cd4f78aac56e15e94ff5d7000"
            },
            "downloads": -1,
            "filename": "padlet_py-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8f01d5e361012f666554a47a2fd3b48b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6732,
            "upload_time": "2024-08-17T10:42:03",
            "upload_time_iso_8601": "2024-08-17T10:42:03.918640Z",
            "url": "https://files.pythonhosted.org/packages/c4/51/23d8116f3dad971858965379e53720be9b8945389ba1fd793021b825c5b8/padlet_py-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-17 10:42:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Hypurrnating",
    "github_project": "padlet-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "padlet-py"
}
        
Elapsed time: 0.33624s