Skip to main content

Simple py driver for bundlr

Project description

pybundlr

Simple py driver for bundlr

Constructed by wrapping bundlr CLI.

Prerequisites

Ensure prerequisites:

  • Linux/MacOS
  • Python 3.8.5+
  • Bundlr CLI: npm install -g @bundlr-network/client

Install Pybundlr Library

Open a new terminal and:

#Create & activate venv
python -m venv venv
source venv/bin/activate

#main install
pip install pybundlr

Using Pybundlr Library

From terminal: python. Then, in Python console:

from pybundlr import pybundlr
address = "Ry2bDGfBIvYtvDPYnf0eg_ijH4A1EDKaaEEecyjbUQ4"
bal = pybundlr.balance(address)
print(f"bal: {bal}")

Developing pybundlr

This section is for those further improving the pybundlr library.

Installation

In a new terminal:

#clone the repo and enter into it
git clone https://github.com/oceanprotocol/pybundlr
cd pybundlr

#Create & activate venv
python -m venv venv
source venv/bin/activate

#Install modules in the environment
pip install -r requirements.txt

Usage

From the same terminal: python. Then, in Python console:

from src.pybundlr import pybundlr
address = "Ry2bDGfBIvYtvDPYnf0eg_ijH4A1EDKaaEEecyjbUQ4"
bal = pybundlr.balance(address)
print(f"bal: {bal}")

Release Process

Find the current version number at pypi.

Open pyproject.toml in an editor, and update the value in "version" = x.y.z.

In terminal:

#go to root of directory
cd ~/code/pybundlr

#ensure repo is up-to-date
git commit -am "Release x.y.z"
git push

#turn off virtual env't
deactivate

#ensure `dist/` folder is empty
rm -rf dist

#generate distribution archives: create `dist` folder with two files 
python -m build

#run twine to upload `dist` files
python -m twine upload dist/*

# -when prompted, give username: __token__
# -when prompted, given password: <pypi API token>

Done! The updated package will be at pypi.

Notes: this section is based on packaging.python.org tutorial.

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

pybundlr-0.0.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

pybundlr-0.0.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pybundlr-0.0.4.tar.gz.

File metadata

  • Download URL: pybundlr-0.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pybundlr-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f83c6838430dc51a6de9fbea00f9ac0a310d09c8e705314b66b92dc1d7ab2081
MD5 b6513afbb13e73263b3ec28aec95f41f
BLAKE2b-256 225ff5003f94dad8b728c6f0047928068d131864660441a7e83250d4f91ed8f8

See more details on using hashes here.

File details

Details for the file pybundlr-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pybundlr-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pybundlr-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9139144f793ec60dc67ef9a34f88863092b720e398f4584be19fb0ad04f47b9b
MD5 050efe69ccca7a0d166d5179947986c8
BLAKE2b-256 6fee80a90cd7051a4becc26be17f259e55d0d639661720096618b53a653e2403

See more details on using hashes here.

Supported by

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