buffer-app-python (buffpy)
Simple to use python library for Buffer App
ORM`ish
Bufferapp.com details some useful entities:
- user
- profile
- update
- link
- info
Every entity can be seen as an object that has attributes and methods. Those methods and attributes are linked to certain endpoints.
All objects are special dicts. For example, you can do something like:
user.id => '12455678976asd'
user => {...}
If you want to see more complete examples, click here
Authorization
Get access_token using buffer docs
service = AuthService(client_id, client_secret, redirect_uri)
url = service.authorize_url
# Access the url and retrieve the token
auth_code = #Paste the code from the redirected url
access_token = service.get_access_token(auth_code)
api = service.create_session(access_token)
User
A user represents a single Buffer user account.
api = API(client_id='client_id',
client_secret='client_secret',
access_token='access_token')
# instantiate an user object
user = User(api=api)
print(user)
print(user.id)
print(user.timezone)
Profile
A Buffer profile represents a connection to a single social media account.
profiles = Profiles(api=api)
print(profiles.all()) # get all profiles
# filter profiles using some criteria
profile = Profiles(api=api).filter(service='twitter')[0]
print(profile) # my twitter profile
# get schedules of my twitter profile
print(profile.schedules)
# update schedules times for my twitter profile
profile.schedules = {
'days': ['tue', 'thu'],
'times': ['13:45']
}
Update
An update represents a single post to a single social media account.
# retrieve a single update based on an id
update = Update(api=api, id='51de8d33e48c051712000019')
print(update)
# get update's interactions
print(update.interactions)
# edit
update = update.edit(text="Hey!")
# publish now
update.publish()
# move to top
update.move_to_top()
# delete
update.delete()
Updates and profiles
# get all pending updates of a social network profile
profile = Profiles(api=api).filter(service='twitter')[0]
print(profile.updates.pending)
# get all sent updates of a social network profile
print(profile.updates.sent)
# retrieve all update's interactions
print(profile.updates.sent[0].interactions)
# shuffle updates
print(profile.updates.shuffle(count=10))
# reorder updates
print(profile.updates.reorder(['51dd27629f7fdf520d00009a']))
# create an update
print(profile.updates.new("Hello there", now=True))
Links
A link represents a unique URL that has been shared through Buffer
# get a link's shares
print(Link(api=api, url='http%3A%2F%2Fbufferapp.com').shares)
Info
Returns an object with the current configuration that Buffer is using, including supported services, their icons and the varying limits of character and schedules.
# instantiate the api object
api = API(client_id='client_id',
client_secret='client_secret',
access_token='access_token')
# get api's info
print(api.info)
Metadata
Release files for buffpy 3.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| buffpy-3.1.1.tar.gz | 9.2 kB | Without provenance | Details for buffpy-3.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| buffpy-3.1.1-py3-none-any.whl | Python 3 | none | any | Details for buffpy-3.1.1-py3-none-any.whl |
Total release size: 20.8 kB
Release files / buffpy-3.1.1.tar.gz
| Download URL | buffpy-3.1.1.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
839f47ed784655592cb0af3d33817a1dff81b852feb12c0db6be464fe3b94985
|
|
BLAKE2b-256 checksum How to use checksums |
6c2990090cf74b43784e2075dde684af2195b3e34d732ea22c213dd25cedbb29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Release files / buffpy-3.1.1-py3-none-any.whl
| Download URL | buffpy-3.1.1-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1617539c6ad4beedfdcfe15ed1c8414bf40dbf089ee2c8d0a5ac876b3d1927fc
|
|
BLAKE2b-256 checksum How to use checksums |
9597b271fd404f89d8901b87e61d7af524bb9f95215de2622e05e86fcd212ebd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Security for buffpy 3.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.