2023-07-07 00:36:49 +02:00
# pt / libpt
2023-07-06 22:05:34 +02:00
2024-02-21 23:10:41 +01:00
![Project badge ](https://img.shields.io/badge/language-Rust-blue.svg )
![Crates.io License ](https://img.shields.io/crates/l/libpt )
![Gitea Release ](https://img.shields.io/gitea/v/release/PlexSheep/pt?gitea_url=https%3A%2F%2Fgit.cscherr.de )
![Gitea language count ](https://img.shields.io/gitea/languages/count/PlexSheep/pt?gitea_url=https%3A%2F%2Fgit.cscherr.de )
[![cargo checks and tests ](https://github.com/PlexSheep/pt/actions/workflows/cargo.yaml/badge.svg )](https://github.com/PlexSheep/pt/actions/workflows/cargo.yaml)
2024-02-21 23:14:31 +01:00
2023-08-24 17:31:42 +02:00
![pt-logo ](data/media/pt-logo.svg )
2023-07-07 00:36:49 +02:00
`pt` stands for either one of "personal tool", "plex tool", "pete" or something among those lines.
It is a collection of tools that i might or might not use. The intended purpose of this repo is that
I program whatever i feel is worth having in a personal thing into it, then use it as either a lib,
crate, python module or executable.
Let's see if I make it a bloated mess or stop committing after 30 hello worlds.
2024-02-21 23:10:41 +01:00
* [Original Repository ](https://git.cscherr.de/PlexSheep/pt )
* [GitHub Mirror ](https://github.com/PlexSheep/pt )
* [Codeberg Mirror ](https://codeberg.org/PlexSheep/pt )
* [crates.io ](https://crates.io/crates/libpt )
* [docs.rs ](https://docs.rs/crate/libpt/ )
2023-07-08 15:01:22 +02:00
## Dependencies
2023-07-20 22:13:25 +02:00
2023-07-08 15:01:22 +02:00
- See `cargo.toml`
2023-07-09 20:44:53 +02:00
- [openssl bindings for rust ](https://docs.rs/openssl/latest/openssl/ )
2023-07-08 15:01:22 +02:00
- [Python ](https://www.python.org/ )
- [`maturin` ](https://maturin.rs ) - `pip install maturin`
2023-07-07 00:36:49 +02:00
2023-07-08 15:01:22 +02:00
## Compiling & Installing from source
2023-07-20 22:13:25 +02:00
2023-07-08 16:20:34 +02:00
If you only want the rust library, you can simply build it with `cargo build` . Add it to your
project like any other local dependency.
2023-07-08 15:01:22 +02:00
If you want to use the python variant too, you need to compile with maturing.
2023-07-08 14:43:11 +02:00
2023-07-08 15:01:22 +02:00
- Install in `venv` : `maturin develop --release`
- Install in system: `maturin build --release && pip install target/wheels/libpt-x.x.x-*`
2023-07-07 00:36:49 +02:00
2023-07-09 21:41:39 +02:00
## Installing from [pypi](https://pypi.org)
2023-07-20 22:13:25 +02:00
2023-07-09 21:41:39 +02:00
`libpt` has been packaged for [pypi.org ](https://pypi.org/project/libpt/ ).
You can install it with `pip install libpt`
2023-07-08 15:01:22 +02:00
## Installing from [crates.io](https://crates.io)
2023-07-20 22:13:25 +02:00
2023-07-08 16:20:34 +02:00
`libpt` has been packaged for [crates.io ](https://crates.io/crates/libpt ).
You can add the library to your project with `cargo add libpt` .
2023-07-08 15:01:22 +02:00
## Installing from my personal package registry
2023-07-20 22:13:25 +02:00
2023-07-08 16:20:34 +02:00
`libpt` has been packaged for [git.cscherr.de ](https://git.cscherr.de ).
You can add the registry to your `config.toml` and then `cargo add libpt`
[Package ](https://git.cscherr.de/PlexSheep/-/packages/cargo/libpt/ )
2023-07-08 15:01:22 +02:00
## Testing
2023-07-20 22:13:25 +02:00
2023-07-08 15:01:22 +02:00
Testing needs to be done separately for the rust and python parts:
- Rust testing with `cargo test`
- Python testing with `./scripts/pytests.sh` or `python -m unittest discover -fs tests/python`
## Documentation
2023-07-20 22:13:25 +02:00
2023-07-08 15:01:22 +02:00
The documentation can be automatically generated with `cargo doc --open` .
2023-07-08 16:41:42 +02:00
An up to date version of the Documentation can be found [here ](https://docs.rs/libpt/ )
2023-07-08 15:01:22 +02:00
## License
2023-07-20 22:13:25 +02:00
2023-07-31 16:58:39 +02:00
**Pt is MIT Licensed**