Code Monkey home page Code Monkey logo

paperless-cli's Issues

Use XDG config directory instead of home directory

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:

  1. just run it

Expected behavior
use $XDG_CONFIG_HOME/paperless-cli/config.yaml (e.g.)

Desktop (please complete the following information):

  • OS: linux
  • Go version:
  • paperless-cli version:

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

I'd like to download the PDF(s) of a document(s)

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]

Document List is serial and slow for large document sets

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:

  1. paperless-cli documents list on a large paperless instance
  2. You'll wait 2-3m for a response in the experience of my dataset.

Expected behavior
Implement some optimization so that this is completed faster.

Screenshots
n/a

Desktop (please complete the following information):

  • Version: 0.6.1

Add Travis-CI for CI/CD

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

I'd like to be able to edit a {tag,correspondent,document}

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]

some errors while installing

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):

  • OS: Debian 9 Stretch
  • Go version: go1.15.3 linux/amd64

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.

Latest commit to gjson removed Unmarshal

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

I'd like to upload the PDF(s) of (a) document(s)

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.

Show tag colors (paperless-ng)

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

Improve the docstrings for paperless-cli go documentation

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:

  1. Visit 'https://godoc.org/github.com/stgarf/paperless-cli' and view documentation
  2. ...
  3. PROFIT!!!

Expected behavior
Clear and concise descriptions of the paperless-cli code.

Screenshots or Stacktrace
N/A

Desktop (please complete the following information):

  • OS: N/A
  • Go version: N/A
  • paperless-cli version: v0.6.2

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.