Metadata-Version: 2.4
Name: wafpy
Version: 0.1.0
Summary: WAFRN API Wrapper written in Python
Author: maxie
License-Expression: AGPL-3.0-or-later
Project-URL: Homepage, https://codeberg.org/maxeepy/wafpy
Project-URL: Issues, https://codeberg.org/maxeepy/wafpy/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.30
Dynamic: license-file

# wafpy

A library for WAFRN api that aims to be as simple as possible

## Usage example

```py
from wafpy import Wafrn

wafrn = Wafrn(base_url = "https://waf.moe") # by default its https://app.wafrn.net
# automatically updates the Authorization header in Wafrn object
wafrn.login(
  "username@gmail.com",
  "password"
)
# --- or ---
wafrn = Wafrn("token here", base_url = "https://waf.moe") # you could alternatively do this


wafrn.get_user("maxie") # returns a User object

wafrn.get_post("01a0bb9e-cb12-77fa-8f2e-29ec417a1deb") # returns a Post object
with open("image.png", "rb") as fp:
  media = wafrn.upload_media(fp) # returns an Attachment object
wafrn.create_post("hello fediverse", media = media) # returns a Post object
wafrn.delete_post("01a0bb9e-cb12-77fa-8f2e-29ec417a1deb") # returns a boolean

# returns a Media object
media = wafrn.bulk_upload_media(
  [
    (open("image.png", "rb")),
    (open("image2.png", "rb"), "this is an alt text"),
    (open("image3.png", "rb"), "this is an alt text 2", True) # the boolean marks if the media is NSFW
  ]
)

timeline = wafrn.get_timeline() # returns a Timeline object
# timeline = wafrn.get_timeline(page = 12, level = "following")
for post in timeline:
  print(post.content) # prints post's contents
timeline.next_page() # gets the next page of the timeline
timeline.previous_page() # gets the previous page of the timeline

# thats all for now, this package is in very early development stages, help would be appreciated
```
