stgarf / paperless-cli Goto Github PK
View Code? Open in Web Editor NEWA golang command line binary to interact with a Paperless instance
License: Apache License 2.0
A golang command line binary to interact with a Paperless instance
License: Apache License 2.0
Describe the bug
paperless-cli currently clutters the home directory by placing the configuration file directly in ~/.paperless-cli.yaml
To Reproduce
Steps to reproduce the behavior:
Expected behavior
use $XDG_CONFIG_HOME/paperless-cli/config.yaml (e.g.)
Desktop (please complete the following information):
Additional context
https://wiki.archlinux.org/index.php/XDG_Base_Directory
for crossplatform support, you could use https://github.com/shibukawa/configdir
there is a longer discussion [1] about integrating support into golang directly
[1] golang/go#29960
Is your feature request related to a problem? Please describe.
I'd like to be able to download the PDF(s) of a particular document or set of documents.
Describe the solution you'd like
Something like paperless-cli documents {fetch,get,download} [document ids]
Describe the bug
If you run a paperless-cli documents list
on a large Paperless instance this will cause a serial lookup of the correspondent and each tag on that document because of what the Paperless API returns -- a link to the tag/correspondent and not it's name. This lookup should be optimized.
To Reproduce
Steps to reproduce the behavior:
paperless-cli documents list
on a large paperless instanceExpected behavior
Implement some optimization so that this is completed faster.
Screenshots
n/a
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
Add Travis-CI for CI/CD
Describe the solution you'd like
Add Travis-CI for CI and to push builds back to GitHub.
Describe alternatives you've considered
I haven't thought of others but maybe GitLab.
Additional context
n/a
Is your feature request related to a problem? Please describe.
I'd like to be able to edit the information related to {tag,correspondent,document} such as name, title, slug, match, matching algorithm, tag, etc.
Describe the solution you'd like
Something like
paperless-cli tags edit [id]
paperless-cli correspondents edit [id]
paperless-cli documents edit [id]
Describe the bug
When running $GOPATH/src/github.com/stgarf/paperless-cli/build.sh
this
Need govvv, building and installing..cannot find package "github.com/ahmetb/govvv" in any of:
/usr/local/go/src/github.com/ahmetb/govvv (from $GOROOT)
/home/ludde/go/src/github.com/ahmetb/govvv (from $GOPATH)
and this
Need gox, building and installing..cannot find package "github.com/mitchellh/gox" in any of:
/usr/local/go/src/github.com/mitchellh/gox (from $GOROOT)
/home/ludde/go/src/github.com/mitchellh/gox (from $GOPATH)
happened.
I solved it with
go get -v -u github.com/ahmetb/govvv github.com/mitchellh/gox
Next error i got when running the build script was this
Building..failed to collect values: failed to get commit: git: error="exit status 128" stderr=fatal: inte ett git-arkiv (eller någon av föräldrakatalogerna): .git
failed to collect values: failed to get commit: git: error="exit status 128" stderr=fatal: inte ett git-arkiv (eller någon av föräldrakatalogerna): .git
Number of parallel builds: 3
. Build complete.
which is due to the use of relative paths.
I solved it with
cd $(readlink -f $0 | xargs dirname)
at the beginning of the build script, and
cd - 1>/dev/null
at the end.
Desktop (please complete the following information):
May I also suggest writing
ln -s $GOPATH/src/github.com/stgarf/paperless-cli/bin/paperless-cli.<OS>.<Arch> $GOPATH/bin/paperless-cli
in README.md
instead of using cp
.
Trying to create a docker container to use with my Paperless ecosystem
Is your feature request related to a problem? Please describe.
Error getting paperless-cli package
running go get -u github.com/stgarf/paperless-cli
output
src/github.com/stgarf/paperless-cli/paperless/correspondent.go:49:3: undefined: gjson.Unmarshal
src/github.com/stgarf/paperless-cli/paperless/correspondent.go:71:3: undefined: gjson.Unmarshal
src/github.com/stgarf/paperless-cli/paperless/document.go:67:3: undefined: gjson.Unmarshal
src/github.com/stgarf/paperless-cli/paperless/document.go:102:3: undefined: gjson.Unmarshal
src/github.com/stgarf/paperless-cli/paperless/tag.go:112:3: undefined: gjson.Unmarshal
src/github.com/stgarf/paperless-cli/paperless/tag.go:134:3: undefined: gjson.Unmarshal
I checked gson and found out that
The Gjson commit (d10932a) removed Unmarshal function.
some detail from commit to gjson.go (removed code)
...
// Unmarshal loads the JSON data into the value pointed to by v.
//
// This function works almost identically to json.Unmarshal except that
// gjson.Unmarshal will automatically attempt to convert JSON values to any Go
// type. For example, the JSON string "100" or the JSON number 100 can be
// equally assigned to Go string, int, byte, uint64, etc. This rule applies to
// all types.
//
// Deprecated: Use encoder/json.Unmarshal instead
func Unmarshal(data []byte, v interface{}) error {
...
Thanks
Similar to #7 except I'd like to be able to upload a document with the bare minimum required fields. Flags/args for extra optional fields are a bonus for first MVP.
It's similar to #16 except it's likely a post request with a few required arguments. I'll poke around the Paperless API if I decide to start looking at this.
Is your feature request related to a problem? Please describe.
I like to easily recognize assigned tags etc. of documents to understand it's classification faster.
Describe the solution you'd like
Show CLI with ANSI colorcodes that represent the colors of tags. This could be possible at least for paperless-ng API
Describe the bug
Improve the docstrings for paperless-cli go documentation when viewing
https://godoc.org/github.com/stgarf/paperless-cli
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Clear and concise descriptions of the paperless-cli code.
Screenshots or Stacktrace
N/A
Desktop (please complete the following information):
Additional context
N/A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.