Skip to main content

pybyte-logo


A Python wrapper for the byte.co app.

Python 3.6+ Required.


Attention: This project was built in a weekend (mostly in the weekend that it was launched) as such this is not production level software.

Byte does not have an official web API for developers, and most likely this will violate the ToS. Endpoints were found from the mobile app. As such, this wrapper can break at anytime. Do not rely on this wrapper.


Installation

  • PyPi (Recommended)
    pip install pybyte
    
  • Git repo
    git clone https://github.com/ms7m/py-byte
    cd py-byte
    python3 setup.py install
    

Usage

>>> import pybyte
>>> 
>>> byte = pybyte.Byte("7WMRREHUQRH4DBK7DQCV7YWL44")
>>> 
>>> byte.me().username
'BotBottyFace220'
>>> 
>>> my_timeline = byte.me().timeline()
>>> 
>>> # no rate limit protection yet. do it at your own risk!
... 
>>> import time
>>> 
>>> for post in my_timeline.feed:
...     print(f"Caption: {post.caption}")
...     time.sleep(1)
...     print(f"Author: {post.author.username}")
...     print('\n')
... 
Caption: 
Author: BotMcBotFace2300


Caption: Nice
Author: BotMcBotFace2300


Caption: 
Author: BotMcBotFace2300


Caption: 
Author: BotMcBotFace2300


Caption: @peaks 
Author: BotMcBotFace2300
# ...
>>> 
>>> 
>>> # Set your own username
... 
>>> byte.me().username = "BotMcBotFace2300"
>>> byte.me().username
'BotMcBotFace2300'
>>> 
>>> # Get Posts
... 
>>> post = byte.get_post("4ZPUKLE5OZB7JJGIBLVMIYQLBU")
>>> post.caption
'@peaks '
>>> post.mentions
[<pybyte.user.ByteUser object at 0x10b33b550>]
>>> 
>>> # rebyte / like posts
... 
>>> post.rebyte()
True
>>> post.like()
True
>>> 
>>> # comment posts
... 
>>> post.comment("Haha!")
True
>>> 
>>> # Upload Posts
... 
>> byte.upload('sample.mp4', caption="haha too funny!")
>> # Automatically generate a thumbnail
>> byte.upload('sample.mp4', caption="haha too funny!", generate_thumbnail=True)
>> # Supply your own thumbnail!
>> byte.upload('sample.mp4', caption="haha too funny", providedThumbnail="ultraCoolthumbnail.jpg")

Example Script

# Go through the global feed, comment and follow the author if they have < 10 followers

global_feed = byte.me().global_feed()

for post in global_feed.feed:
    if post.author.followers['followerCount'] > 10:
      	post.comment("Hey man, thanks for making me laugh!")
        post.like()
    else:
      	continue

Example Scripts

# Go through your posts and comment any post older than 3 days and has less than 200 likes

my_posts = byte.me().posts()
time_now = datetime.datetime.now()

for post in my_posts.feed:
    if (time_now - post.date).days > 3:
        if post.like_count < 200:
            # i am not popular :(
            post.comment("this post isn't making me popular")
         else:
            post.comment("Woohoo! I'm very popular!")
    else:
        # not old enough
        continue

Tests

Coming soon

Metadata

Release files for pybyte 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybyte 0.1.8
File Size Uploaded Provenance Actions
pybyte-0.1.8.tar.gz 33.6 kB Without provenance Details for pybyte-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybyte 0.1.8
File Interpreter ABI Platform Actions
pybyte-0.1.8-py3-none-any.whl Python 3 none any Details for pybyte-0.1.8-py3-none-any.whl

Total release size: 65.6 kB

Release files / pybyte-0.1.8.tar.gz

Download URL pybyte-0.1.8.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
97c6bf638d447c7be8c0b756a2c1716c0a62b076c6be12460219e9bc466e6a66
BLAKE2b-256 checksum
How to use checksums
bc796dc832364b6efd12823a18fd5d4c7307abb425330c6e8e063f5837c51971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

Release files / pybyte-0.1.8-py3-none-any.whl

Download URL pybyte-0.1.8-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2ab6d26a9e498e2cb8b78e24f6e6f8ca4b1a47e6045ef72bc5ada61a1a12214
BLAKE2b-256 checksum
How to use checksums
92be6ce71955c2850125753bed2a0c35625ebce51847318ca1afd6c491fca510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

Security for pybyte 0.1.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page