-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffc8cf2
commit 2b5c6ce
Showing
1 changed file
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
# Requirements | ||
|
||
- Python3 | ||
- setuptools | ||
```bash | ||
pip install setuptools | ||
``` | ||
- setuptools_rust | ||
```bash | ||
pip install setuptools_rust | ||
``` | ||
- dateutil | ||
```bash | ||
pip install python-dateutil | ||
``` | ||
|
||
# Installation | ||
|
||
From the `languages/python/` directory, | ||
# Build locally | ||
## Requirements | ||
|
||
- Python 3 | ||
- `maturin` (install with `pip install maturin[patchelf]`) | ||
- `npm` | ||
|
||
## Build | ||
|
||
From the root of the repository: | ||
```bash | ||
python3 ./setup.py develop | ||
npm run schemas # generate schemas.py | ||
|
||
cd languages/python/ | ||
maturin develop | ||
``` | ||
|
||
Rename the the resulting `.so` file to `bitwarden_py.so`, if it isn't already there. | ||
You can now import `BitwardenClient` and `bitwarden_py` in your Python code. | ||
|
||
# Use without building locally | ||
|
||
```bash | ||
pip install BitwardenClient | ||
``` | ||
|
||
# Run | ||
|
||
Set the `BWS_ORG_ID` and `BWS_ACCESS_TOKEN` environment variables to your organization ID and access token, respectively. | ||
|
||
```bash | ||
python3 ./login.py | ||
python3 ./example.py | ||
``` |