Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RGB-Tools/rgb-lib-python
https://github.com/RGB-Tools/rgb-lib-python
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/RGB-Tools/rgb-lib-python
- Owner: RGB-Tools
- License: mit
- Created: 2022-09-12T14:38:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T15:16:10.000Z (3 months ago)
- Last Synced: 2024-10-09T17:49:44.145Z (2 months ago)
- Language: Shell
- Size: 109 KB
- Stars: 9
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rgb-protocol - RGB Lib Python bindings
README
# RGB Lib Python bindings
This project builds a Python library, `rgb-lib`, for the [rgb-lib]
Rust library, which is included as a git submodule. The bindings are created by
the [rgb-lib-uniffi] project, which is located inside the rgb-lib submodule.## Install from PyPI
Install the [latest release] by running:
```shell
pip install rgb-lib
```## Demo
The `demo/` directory contains a demonstration of the most common operations in
the form of a Jupyter notebook. See the included `README.md` file for more
details.## Install locally
### Requirements
- [cargo]
- [poetry] 1.4+In order to install the project locally, run:
```shell
# Update the submodule
git submodule update --init# Generate the bindings
./generate.sh# Build the source and wheels archives
poetry build# Install the wheel (replacing with built version)
pip install ./dist/rgb_lib--py3-none-any.whl# or install the sdist (replacing with built version)
pip install ./dist/rgb_lib-.tar.gz
```## Build in Docker
In order to build the project in a Docker container, run:
```shell
# Update the submodule
git submodule update --init# run the build script
./build_in_docker.sh
```The `build_in_docker.sh` script will build the docker image and use it to first
generate the bindings, then build the source and wheel archives. Once the build
completes, archives will be available in the `dist/` directory as if they were
built locally.## Publish
Publishing to PyPI is handled with Poetry.
To configure the access token, which only needs to be done once, run:
```shell
poetry config pypi-token.pypi
```To publish a new release run:
```shell
poetry publish
```[cargo]: https://github.com/rust-lang/cargo
[rgb-lib]: https://github.com/RGB-Tools/rgb-lib
[rgb-lib-uniffi]: https://github.com/RGB-Tools/rgb-lib/tree/master/bindings/uniffi
[latest release]: https://pypi.org/project/rgb-lib/
[poetry]: https://github.com/python-poetry/poetry