Skip to main content

Byte API Wrapper for Python

Project description

pybyte-logo


Byte API Wrapper for Python

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
    

Features

  • View Byte Profile ByteUser, ByteAccount
  • View Byte Posts: BytePost
  • Send authenticated requests to Byte API ByteSession
  • Upload Bytes
  • Follow Users
  • Rebyte Posts
  • Comment on Posts
  • Like Posts

To Do

  • Update user information
  • Change Username
  • Show feed ~

Usage

View your account

>> import pybyte

>> byte = pybyte.Byte(<google auth token>)
>>> me = byte.me()
>>> me
<pybyte.user.ByteAccount object at 0x1069a2150>

...

>>> me.user().user_id
'MZBW6JBYUBDKBMQK62LCBS7I6Q'
>>> me.user().username
'gjoder'
>>> me.user().registered
datetime.datetime(2020, 1, 26, 4, 40, 57, tzinfo=tzutc())
>>> 

View a post

>>> import pybyte
>>> 
>>> byte = pybyte.Byte()
2020-01-26 12:28:12.623 | INFO     | pybyte.byte:__init__:87 - loaded from cache.
>>> post = byte.get_post("4ZPUKLE5OZB7JJGIBLVMIYQLBU")

>>> post.caption
'@peaks '

>>> post.date
datetime.datetime(2020, 1, 26, 15, 35, 32, tzinfo=tzutc())

>>> post.mentions
[<pybyte.user.ByteUser object at 0x104d03c90>]
>>> 

Upload a video

>>> import pybyte
>>>
>>> byte = pybyte.Byte()
2020-01-26 12:28:12.623 | INFO     | pybyte.byte:__init__:87 - loaded from cache.

>> byte.upload("sample.mp4", caption="Hello from pybyte!")
True

Attention: You'll only need to supply a google OAuth (Soon to be done automatically) once and pybyte will cache the authorization token for you. After doing this one time, simply call pybyte.Byte without any arugments.

Tests

Coming soon

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybyte-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybyte-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pybyte-0.1.3.tar.gz.

File metadata

  • Download URL: pybyte-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pybyte-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ba317b72e4db6feadf7ef9caf3374de77bb07e51b91682e80889e44554b34a36
MD5 402188a3804e2989364436c0d3fa91ec
BLAKE2b-256 e5ddc27bb3d679c2aabc1a0bab89ea46edd5d3dbd1ad37d2fa7716e76d57749d

See more details on using hashes here.

File details

Details for the file pybyte-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pybyte-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pybyte-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b841018b2a78b32e52c92e0965f774c59d6d7af328ad1e2b4af1ac2676435068
MD5 8d9a7f62ceac2e760bf90b8f0dc473c0
BLAKE2b-256 b391a6aee0779d91f97cccae1b6efa2cc2ebdbece0e997fb60f8669781f2b8ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page