Metadata-Version: 2.4
Name: bufferpy
Version: 0.2.3
Summary: Buffer API
License-File: LICENSE
Author: danialcala94
Author-email: danielalcalavalera@gmail.com
Requires-Python: >=3.8,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: requests (>=2.32.4,<9999.0.0)
Project-URL: Homepage, https://github.com/Implosiv3/bufferpy
Project-URL: Issues, https://github.com/Implosiv3/bufferpy/issues
Description-Content-Type: text/markdown

# Buffer social media platform API

Unofficial Buffer API in python, but the easiest way to interact with the Buffer API - https://buffer.com

This project is working with their __GraphQL API__, which is the one they are maintaining.


# Functionality
We are __currently developing__ the wrapper. By now it is only able to schedule post and notifications for Instagram, Facebook and Tiktok.

# Explanation
Buffer platform has 3 main functionalities:
  - __Schedule a POST__ that will be automatically published on the date and time you set.
  - __Set a REMINDER__ that will send a notification to your app at that specific time so you can post it manually by yourself.
  - __Add POST or REMINDER to the queue__ that will add the post or reminder to the next available slot in your queue. The queue must be set in your Buffer account and will publish the videos on it when the moment comes.

# Usage
I recommend you to visit the `tests` in the code to see how it works, but here you have __some examples__:

1. Schedule a __post__ of __a reel__ on __Instagram__:
```
client = BufferClient(API_KEY)

# Y, M, D, m, s
DATE = PublicationDate(2026, 8, 7, 16, 50)

post = client.instagram.schedule_reel_post(
    channel_id = INSTAGRAM_CHANNEL_ID,
    video_url = VIDEO_ASSET_DIRECT_LINK,
    text = 'Automated post from bufferpy python library 🚀',
    publish_at = DATE,
    do_add_to_queue = False,
    # specific fields
    do_share_to_feed = True,
    is_ai_generated = True,
)
```

2. Post a __reel__ on __Instagram__ __right now__:
```
client = BufferClient(API_KEY)

post = client.instagram.schedule_reel_post(
    channel_id = INSTAGRAM_CHANNEL_ID,
    video_url = VIDEO_ASSET_DIRECT_LINK,
    text = 'Automated post from bufferpy python library 🚀',
    publish_at = None,
    do_add_to_queue = False,
    # specific fields
    do_share_to_feed = True,
    is_ai_generated = True,
)
```

3. __Add__ a post of a __reel__ on __Instagram__ to the __queue__:
```
client = BufferClient(API_KEY)

post = client.instagram.schedule_reel_post(
    channel_id = INSTAGRAM_CHANNEL_ID,
    video_url = VIDEO_ASSET_DIRECT_LINK,
    text = 'Automated post from bufferpy python library 🚀',
    publish_at = None,
    do_add_to_queue = True,
    # specific fields
    do_share_to_feed = True,
    is_ai_generated = True,
)
```

4. Schedule a __post__ of __a picture__ on __Facebook__:
```
client = BufferClient(API_KEY)

# Y, M, D, m, s
DATE = PublicationDate(2026, 8, 7, 16, 50)

post = client.facebook.schedule_post_post(
    channel_id = FACEBOOK_CHANNEL_ID,
    image_url = IMAGE_ASSET_DIRECT_LINK,
    text = 'Automated post from bufferpy python library 🚀',
    publish_at = None,
    do_add_to_queue = False
)
```

5. Set a __notification reminder__ on __Tiktok__ on __a specific date__:
```
client = BufferClient(API_KEY)

# Y, M, D, m, s
DATE = PublicationDate(2026, 8, 7, 16, 50)

post = client.tiktok.schedule_reel_notification(
    channel_id = TIKTOK_CHANNEL_ID,
    video_url = VIDEO_ASSET_DIRECT_LINK,
    text = 'Automated post from bufferpy python library 🚀',
    publish_at = DATE,
    do_add_to_queue = False
)
```

# Annotations
The Buffer platform doesn't make a copy of the resources in their servers (by now) when using the API, thats why __you have to provide a direct link to the resource__ you want to upload.

That __link__ has to be __public and accessible at the time__ the post will be actually published. If the link is down, the scheduled post will fail.

# Testing
You can test the functionality through our different test files. Add the environment variables you need in the `.env` file to test it directly with your real data from Buffer. See the `.env.example` to know what to include.
