wandera / 1password-client

Python wrapper for OnePassword CLI developed at Wandera.
MIT License
47 stars 25 forks source link

Basic usage fails with json errors #56

Open Haydnspass opened 9 months ago

Haydnspass commented 9 months ago

Describe the bug Basic usage examples fails (at least in my conda env)

To Reproduce

from onepassword import OnePassword
import json

op = OnePassword()

# List all vaults 
json.loads(op.list_vaults())

# List all items in a vault, default is Private
op.list_items()

Screenshots

image

Context ~  op --version  ✔  1pass  2.24.0

conda env

# packages in environment at /Users/lucasmueller/miniforge3/envs/1pass:
#
# Name                    Version                   Build  Channel
1password                 1.0.7                    pypi_0    pypi
bzip2                     1.0.8                h93a5062_5    conda-forge
ca-certificates           2023.11.17           hf0a4a13_0    conda-forge
libblas                   3.9.0           20_osxarm64_openblas    conda-forge
libcblas                  3.9.0           20_osxarm64_openblas    conda-forge
libcxx                    16.0.6               h4653b0c_0    conda-forge
libexpat                  2.5.0                hb7217d7_1    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_1    conda-forge
libgfortran5              13.2.0               hf226fd6_1    conda-forge
liblapack                 3.9.0           20_osxarm64_openblas    conda-forge
libopenblas               0.3.25          openmp_h6c19121_0    conda-forge
libsqlite                 3.44.2               h091b4b1_0    conda-forge
libzlib                   1.2.13               h53f4e23_5    conda-forge
llvm-openmp               17.0.6               hcd81f8e_0    conda-forge
ncurses                   6.4                  h463b476_2    conda-forge
numpy                     1.26.2          py312h5d55045_0    conda-forge
openssl                   3.2.0                h0d3ecfb_1    conda-forge
pexpect                   4.9.0                    pypi_0    pypi
pip                       23.3.2             pyhd8ed1ab_0    conda-forge
ptyprocess                0.7.0                    pypi_0    pypi
pycryptodome              3.19.1                   pypi_0    pypi
python                    3.12.1          hdf0ec26_1_cpython    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pyyaml                    6.0.1                    pypi_0    pypi
readline                  8.2                  h92ec313_1    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
tzdata                    2023d                h0c530f3_0    conda-forge
wget                      3.2                      pypi_0    pypi
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
dtpryce commented 9 months ago

Hey @Haydnspass this looks a lot like an already raised issue around usage and installation within an conda env. Not sure we will get to this issue very quickly, just setting expectations but when we do I will get back to you via here / that issue #34

Also if you do want to look into it yourself and contribute please do raise a PR and we will endeavor to test and merge it :)

dtpryce commented 9 months ago

One quick check ... did you try just op.list_vaults() ? Just without the json.loads. I seem to remember seeing something around this, thought we updated our README to be better there but will check back now.