Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToDo List #174

Closed
40 of 42 tasks
jarun opened this issue Jul 19, 2017 · 59 comments
Closed
40 of 42 tasks

ToDo List #174

jarun opened this issue Jul 19, 2017 · 59 comments

Comments

@jarun
Copy link
Owner

jarun commented Jul 19, 2017

Continued from #135.

Notes

The list below is a growing one. While suggesting new features please consider contributing to Buku. The code is intentionally kept simple and easy to understand with comments. We'll be happy to assist any new contributor. We need your help!

Some of the fresh-baked features may not have been released yet. Grab the master branch for those.

Identified tasks

  • Android app (using the same database) (probably a distinct project)
  • Text-mode user agent for Buku
  • Read default Firefox profile name from profiles.ini (see Firefox auto-import breaks if profile name does not end with .default #212, thanks @alex-bender)
  • Support --format in search results (ref, thanks @mosegontar)
  • API documentation (comments need to be in NumPy format) (thanks @mosegontar)
  • Auto-import: optionally add parent folder name as tag, ask for unique tag [like importdb()]
  • Support custom colours (thanks @shv-q3)
  • Generate packages on Travis-CI using PackageCore (see Generate packages using PackageCore and Travis CI #189) (thanks @shaggytwodope)
  • Search multiple tags, exclusion in tag search (thanks @mosegontar)
  • Auto-import Firefox and Google Chrome bookmarks (thanks @alex-bender)
  • Suggest tags those go together
  • Append/overwrite/remove tags from prompt
  • Rest API for webapps (thanks @kishore-narendran)
  • Add more tests (ongoing activity @rachmadaniHaryono)
  • A browser plugin (thanks @samhh for bukubrow)
  • Text editor support (thanks @ZwodahS)
  • Need a PyPI maintainer (thanks @shaggytwodope)
  • Make refreshdb faster using threads (record updates should be synchronized)
  • Show usage count in tag list
  • Proxy support (thanks @denisfalqueto)
  • Continuous search at prompt
  • Add prompt help
  • Specify custom DB file to class BukuDb (library usage, no exposed option)
  • Move to urllib3
  • Handle redirects using referrer masking. Example URL. Fixed with urllib3.
  • Support URL shortening. This helps to share URLs. (see Support adding shortened URLs to the database #92 for limitations)
  • Make a bookmark title immutable via refreshdb()
  • Markdown import/export
  • Regex search
  • Ubuntu PPA (thanks @shaggytwodope)
  • Export specific tags to HTML
  • Exact word match using REGEX. Make substring match optional.
  • Delete all records based on a search result
  • Delete multiple items, support combination of indices and ranges
  • Append tags
  • Travis CI integration
  • Ubuntu deb package generation on new tag
  • Merge bookmark database files (for users who work on multiple systems)
  • Export bookmarks in FF or Chrome html format.
  • Option to add folder names as tags while importing HTML (thanks @Mohammadkhalifa)
  • Check and show upstream version
  • Anything else which would add value (please discuss in this thread)
@jarun jarun mentioned this issue Jul 19, 2017
37 tasks
@mosegontar
Copy link
Contributor

I saw there was some discussion last year of integrating with Pinboard. Is this still a desired feature? (I personally would like it). If so, I can take it. Pinboard has a nice API with an endpoint for fetching all bookmarks and recent bookmarks (up to 100), so an import to Buku feature at least seems doable.

@jarun
Copy link
Owner Author

jarun commented Aug 16, 2017

I have to think about it. Whether we really want to integrate or want to go solo. ;)

@mosegontar
Copy link
Contributor

Gotcha, sounds good!

@jarun
Copy link
Owner Author

jarun commented Aug 16, 2017

I was going through the Pinboard docs. They do support export/import to/from html. I think we can refrain from adding some service specific code to authenticate to pinboard, probably along with some auth token hanging around. Buku is a solution in itself, not an ad-hoc to any solution.

Now, coming to the integration part with popular web services, why don't we just document the fact that Buku supports bookmarks.html? That should be enough to have all your bookmarks in from anywhere (that too, incrementally).

Yes, it's a manual procedure. But it's safer/smarter than accessing any random web service's data directly.

@mosegontar
Copy link
Contributor

Yeah that's reasonable, especially given that we can't integrate with every service. Sounds like import via bookmarks.html format should satisfy most services. Didn't know about the html format being the standard for bookmarks, interesting.

(I might write some separate small pinboard-to-buku script using https://user:[email protected]/v1/posts/all?format=json endpoint to allow for a straight dump into buku)

Where are you thinking of documenting the support for bookmarks.html? I could add a line in the Import section of the Operational Notes wiki, just to be explicit about it. Should it go elsewhere too?

@jarun
Copy link
Owner Author

jarun commented Aug 17, 2017

I might write some separate small pinboard-to-buku script

Of course!

I could add a line in the Import section of the Operational Notes wiki

You are in the right place!

@jarun
Copy link
Owner Author

jarun commented Aug 17, 2017

Additionally, in the Introduction, please make the following modification:

"For GUI integration (or to sync bookmarks with your favourite bookmark management service), refer to the wiki page on System integration."

shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 17, 2017
# imported collections module for named tuple
# add "colormap" from googler project
# add named tuple for id and title, url, desc, tag
# adjusted print_single_rec so colors can be changed for each item
# add valid color string checker from googler
# adjusted man options
# add autocompletions
@jarun
Copy link
Owner Author

jarun commented Aug 17, 2017

@alex-bender the colors support is alredy being worked on by @shv-q3 here. He hijacked this but he is almost done! ;) I changed the owner.

EDIT: Now I remember he attempted to do this once before with colord. The current approach has been our preferred approach.

@jarun
Copy link
Owner Author

jarun commented Aug 18, 2017

@mosegontar I have added the note on web service integration.

@mosegontar
Copy link
Contributor

Ah thanks; (funny timing, I was just about to do this). I've updated the man page (and I'll update the wiki), PR coming in a second.

@jarun
Copy link
Owner Author

jarun commented Aug 18, 2017

Now I see what has happened. I had the README change locally, forgot to push it and went to sleep. :) Pushed it now.

shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 18, 2017
# sorted import in alphabetical order
# adjusted var name's
# add color table to man page
shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 18, 2017
shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 18, 2017
# sorted import in alphabetical order
# adjusted var name's
# add color table to man page
# add --colors option to readme "Usage" section
shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 18, 2017
# imported collections module for named tuple
# add "colormap" from googler project
# add named tuple for id and title, url, desc, tag
# adjusted print_single_rec so colors can be changed for each item
# add valid color string checker from googler
# adjusted man options
# add autocompletions
shv-q3 added a commit to shv-q3/Buku that referenced this issue Aug 18, 2017
# sorted import in alphabetical order
# adjusted var name's
# add colors table to man file
# add color os ENV option
# add --color documentation in README under "Usage"
jarun pushed a commit that referenced this issue Aug 22, 2017
* implement "Support custom colours" from (#174)

# imported collections module for named tuple
# add "colormap" from googler project
# add named tuple for id and title, url, desc, tag
# adjusted print_single_rec so colors can be changed for each item
# add valid color string checker from googler
# adjusted man options
# add autocompletions

* Hotfix - implement "Support custom colours" from (#174)
# sorted import in alphabetical order
# adjusted var name's
# add colors table to man file
# add color os ENV option
# add --color documentation in README under "Usage"

* fix typo error in man page color section

* Update buku-completion.bash

--color reordered in alphabetical order

* Update buku.fish

--color reordered in alphabetical order

* Update _buku

--color reordered in alphabetical order

* Hotfix2 - implement "Support custom colours" - restructure feature
# separated id from ID_str and ID_DB_STR so it can have separate color
# add 5 string color for (id, title, url, desc, tag)
# adjusted print_single_rec for 5 colors result
# fixed syntax .BI \--colors " COLORS" in man page
# replaced four with five letter string for color
# fixed default colors to "GKlxe" and "\x1b[2m" for DB index
# add example to README and man page
# removed check for colorstr_env set by user for the moment

* Fixed reviews

* Review fixes
@jarun
Copy link
Owner Author

jarun commented Aug 27, 2017

@alex-bender @mosegontar how is it going? Planning to make a release early next month, probably in the first week. Can we expect to have the features assigned to you in?

@mosegontar
Copy link
Contributor

mosegontar commented Aug 27, 2017

@jarun sorry I've been a bit delayed. I'm moving this week and things have been hectic.

I've updated about half of buku.py docstrings into NumPy style. I just pushed the current work, mosegontar@626e4d9, so please take a look and let me know your thoughts. If things look okay, I can certainly finish the rest by early next month.

With regard to generating the documentation with Sphinx, I experimented a bit with it last week. I should be able to do it, but I do expect there will be some finicky aspects. Also wrt autogenerating the docs, that's something I still need to look into. So this part might not be finished in time for the release.

@alex-bender
Copy link
Contributor

Hi @jarun! Im going back from vacation right now so cant say for sure for now. I'll ping you in a few days.

@jarun
Copy link
Owner Author

jarun commented Aug 28, 2017

Thanks guys!

@jarun
Copy link
Owner Author

jarun commented Aug 28, 2017

@mosegontar I can see it's going very well! 👍

@mosegontar
Copy link
Contributor

Just an update, docstrings are updated up to the Editor Mode Functions, so about 80% complete. Hoping to be done by tomorrow or Tuesday!

@jarun
Copy link
Owner Author

jarun commented Sep 3, 2017

Simply awesome!

@lkarbownik
Copy link

Hi @jarun

First, amazing work. I love using Buku.
Have you considered adding support for -t --stag flags when using --print and -f<num>?
Currently using -t/--stag with these flags overrides the behaviour and runs app in interactive mode.
My goal is to combine buku with other tools in a way that would allow to pre-query bookmarks by providing a tag, i.e.:
buku -p -f3 -t $sometag | fzf ...

I know there is a --np to disable interactive mode but it does not seem to support other output formats and parsing multiline output is not ideal.

@jarun
Copy link
Owner Author

jarun commented Sep 18, 2017

-f is the print format specifier. I believe what you want is search options should honor -f. @mosegontar would you like to try it out?

@rachmadaniHaryono
Copy link
Collaborator

rachmadaniHaryono commented Oct 13, 2017

I'm thinking something with aiohttp to fetch page.

Reference https://stackoverflow.com/questions/8546273/is-non-blocking-i-o-really-faster-than-multi-threaded-blocking-i-o-how

But looking at the code, not sure how feasible this is and if this is maintainable

It also only used when importing a lot of bookmark which is not essential. So I'm still not sure about this

@jarun
Copy link
Owner Author

jarun commented Oct 13, 2017

short answer: it's more about the overhead of having a thread per connection. non-blocking io lets one avoid having a thread per connection.

The thread is more of a propaganda than having any real meat. Here's my take:

  • We are in the age of i7s and SSDs. The overhead of threading for fetching webpages is insignificant.
  • We have minimal data processing overhead and NO graphical overhead. We get the data and we are done.
  • Even if we use asynchronous IO the program waits for the slowest thread (as defined by the timeout [currently 40 secs?]). We can't exit.
  • Full refresh is a once-in-a-while operation.

@hubitor
Copy link

hubitor commented Oct 13, 2017

I had several URLs in my notepad and I couldn't find a way to import them directly into buku. The add option accepts only one URL. So first I add them with an add-on in firefox, then export all the bookmarks and finally import them into buku. The problem was that it took some time because not only the new bookmarks were imported but also some thousands bookmarks which were already in firefox.

So, what about importing from a text file which contains URLs separated by new lines or spaces or semicolons? Or even batch import from the console?

@jarun
Copy link
Owner Author

jarun commented Oct 13, 2017

Or even batch import from the console?

It would be a very small script in ANY scripting language (shell/python/perl...). Please write it yourself.

@jarun
Copy link
Owner Author

jarun commented Oct 15, 2017

@mosegontar @rachmadaniHaryono can you guys audit the add bookmark path and see if there's any way to optimize the performance anywhere? It can be reduction of condition checks, loops, less variables, anything... It's not that we are slow, but it's always great to be audited (other than IRS).

@mosegontar
Copy link
Contributor

Sure 👍 i'll take a look

@questor
Copy link

questor commented Oct 16, 2017

two suggestions:

  • html-export with template (already done, I can make a pull request if you want; helpful to create a static website with filtering possibilities in JS)
  • it would be cool to have some sort of plugins to update the database, for example if you have a github-repo bookmarked to automatically create tags based on the license and language. something to make it easier to grab more information to a url based on hints on the webpage, but with a plugin concept to be able to use different "services". (I can help with coding for this, but I dunno how to do a plugin-concept in python.
    any comments?

[edit] found python plugin concept, will make an implementation as proposal

@jarun
Copy link
Owner Author

jarun commented Oct 16, 2017

html-export with template (already done, I can make a pull request if you want; helpful to create a static website with filtering possibilities in JS)

This is definitely a new plugin/project. Please create one and I'll add a mention to it.

@jarun
Copy link
Owner Author

jarun commented Oct 16, 2017

it would be cool to have some sort of plugins to update the database, for example if you have a github-repo bookmarked to automatically create tags based on the license and language. something to make it easier to grab more information to a url based on hints on the webpage, but with a plugin concept to be able to use different "services". (I can help with coding for this, but I dunno how to do a plugin-concept in python.
any comments?

Are you creating a plugin framework or a plugin in this case? The framework would be a part of Buku, the plugin will be a separate project.

@rachmadaniHaryono
Copy link
Collaborator

rachmadaniHaryono commented Oct 16, 2017

See also http://yapsy.sourceforge.net

I'm thinking the plugin workflow should be like this

  • buku have a default plugin folder or user can set that
  • User add plugin( python file) to that folder
  • each time user add bookmark, if the bookmarks match with given condition on plugin (regex or simple function), the e.g. Add additional tags or modify the url, etc
  • the plugin can be run for other actions such as
    • crud of tags, title and title
    • searching in buku, ie. If not found, search in google and add it in buku
    • automatically download /archive url on certain condition

Buku just have to provide a way to enable/disable plugin.

See project beet with their plugin system

@jarun
Copy link
Owner Author

jarun commented Oct 16, 2017

I think it would be greatly useful. Please collaborate and go ahead. Please add an issue and a branch (plugin-fw) to work on this.

@questor I am adding you as a collab. Please accept and work on the branch for plugin framework.

@jarun
Copy link
Owner Author

jarun commented Oct 16, 2017

I have created the branch plugin-fw.

Guys,

I'll be away for a few days till next Sun and won't be active other than responding to mails (family time ;)). For the plugin fw branch please do peer code review, merge and work together.

@questor
Copy link

questor commented Oct 17, 2017

okay, to give you some more insights what I want to achieve and what workflow I have in mind some explanations:

  • I want to handle the plugins in the update function, an extra plugin-update-handling could also be possible (with selection which plugin to run?)
  • but if the user changed something the plugin should not overwrite user-content. this one is tricky because tags can be updated on a tag-basis (if it's not already set in the tag-list add it), but if the user decides to change the description and the plugin detects a different description on the webpage the user-content should not be overwritten (but if the content on the webpage changes and the user has not changed it the description should be updated). I'm not sure how this can be handled with the current db format, one way would be to allow extra tables for each plugin to store additional infos.
  • the filtering should be handled in the plugin itself; the plugin nows best what to do and how. here a special handling might be needed in the plugin (example: webpage downloading service where special handling for github-webpages is a good idea (to download the repo and not the webpage itself))

I have already started with a very simple plugin system, but I need some help with the decisions where to store additional information from or in the plugin (external table or in the current table). But I agree, the plugin-framework has to be part of buku, but the plugins are separate projects.

@questor
Copy link

questor commented Oct 17, 2017

btw: the template changes are really simple and does not interfere with the other options. the changes can be seen here: https://github.com/questor/Buku/commit/eb4b8c745f793eb631842e290a650d3a8259e6ff

@jarun
Copy link
Owner Author

jarun commented Oct 17, 2017

I will need some time to think about it. At the same time, the plugins should be as detached as possible.

@jarun
Copy link
Owner Author

jarun commented Oct 17, 2017

I think a plugin should have its own database for its own data. The foreign key should be the URL which is unique in Buku DB.

Also, for any changes to Buku database the plugin should use Buku APIs or request.

@jarun
Copy link
Owner Author

jarun commented Oct 17, 2017

Let's say the user updates description through plugin. It should be in the desc field of Buku. For fields which are available both Buku and plugins work on the same field. That is, no data duplication.

@jarun
Copy link
Owner Author

jarun commented Oct 17, 2017

@rachmadaniHaryono are there any test cases for shorten and expand? I believe for well-known services like google the shortened url is always the same. Can you please add the test case if not in place already? This we ensure we know if the tny.im service is active.

@rachmadaniHaryono
Copy link
Collaborator

@jarun sorry it may take some time as i focus on other things on these recent days

@jarun
Copy link
Owner Author

jarun commented Oct 20, 2017

Sure! Please take your time.

@jarun
Copy link
Owner Author

jarun commented Oct 25, 2017

@questor are you working on the plugin framework?

@jarun
Copy link
Owner Author

jarun commented Oct 25, 2017

Also @questor, please raise a PR for the template stuff so we can review it.

@questor
Copy link

questor commented Oct 25, 2017

I'm thinking through the stuff and the things I want to have (which of course might not necessarily is the same the rest want to have). my current idea is to have a template-output (already done, will make a PR later) with the possibility to have a static webpage with the output and some javascript code to make filtering in the page (something like filtrify).
here bringing plugins into play would mean (when I want to use additional infos in the html-export) that I have to make special handling of template export for plugins (which also would mean bigger changes needed) or I can somehow put the additional infos into the main database of buku and the export-plugin can use the "normal" database to do the export with the additional information from other plugins.

I opted for the "template-export" orthogonal to "plugin-concept" approach simply because it's easier to code as I'm not a python-guru myself. but I can push what I have so far (but I have to admit it's not that much up to now). the more extensive option would be to make the template-export somehow aware of plugins and make the export query the plugins for more information (more work, but cleaner design).

@jarun
Copy link
Owner Author

jarun commented Oct 25, 2017

If the requirement is to have a template from which a static webpage can be generated I don't think we would really need a plugin. Have the template and build it up by fetching data from the webpages separately. What one really needs is the links. Why would we need to store additional data for this requirement in the Buku database. If you want a cool page, you need to ave the thumbnails which would need page fetches anyway.

@questor
Copy link

questor commented Oct 25, 2017

okay, you are thinking about a datascraper-plugin and another export-plugin or something combined thinking about an export-plugin using the buku-db-url, downloading some more data and doing the export?
having two separate plugins would allow to use custom data-scraping plugins also for normal database population, but having the additional data in an extra database would mean that using the special data in an export plugin creates an dependency hierarchy (export plugin X needs scrape-plugin A and B to be able to work correctly).

my approach would have been to make separate scrape-plugins (with the tables in the main-database) and an generic export-plugin where you can specify from where to take the data to insert into the page (and the possibility to specify multiple tables in one page).

To get things going I try to do an complete example to be able to transport my idea what I want to have and then you can decide if you want to go that way or another one.

@jarun
Copy link
Owner Author

jarun commented Oct 25, 2017

My idea is pretty straight for this plugin (set of plugins): get the urls from the DB and do whatever you want with your own data.

@jarun jarun mentioned this issue Nov 11, 2017
48 tasks
@jarun
Copy link
Owner Author

jarun commented Nov 11, 2017

Rolled at #233.

@jarun jarun closed this as completed Nov 11, 2017
Repository owner locked and limited conversation to collaborators Nov 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants