Comments (3)
I have build a Rails app to export Hamster data to the third party online service Freckle using their API: https://github.com/jhilden/frecklinghamster
Maybe this can be useful for somebody. I would certainly be interested in feedback.
from hamster.
Awesome and i'm sure it will be useful!
Haven't really worked with ruby projects i was surprised about the sheer amount of files in the project (and the empty dirs - wonder if you can get rid of those or if that's a hardwired demand from the framework)
If i can suggest - you might be better off consuming the d-bus API instead of going straight to the sqlite file.
The dbus bits are less scary than one might think and the hamster service, if installed, will be started on demand by dbus to answer those queries.
The benefits are that you don't break logic (for example - hamster day - we start days by default at 5am and task is considered to belong to the day it has the largest part in), don't have to worry about changes in db structures and file location and can make use of search interface and other bits. If you are concerned where would you store the info added by freckle - you could combine in another sql lite database for this meta information.
The API is fully used by hamster itself (the backend is fully separated from frontend). Here are the implementations:
- API: https://github.com/projecthamster/hamster/blob/master/src/hamster/storage.py#L43 (i can recommend using d-feet to experiment with the API vai a GUI)
- Python bindings: https://github.com/projecthamster/hamster/blob/master/src/hamster/client.py
There is also bit of javascript wrapping but that hasn't been isolated cleanly just yet (https://github.com/projecthamster/shell-extension)
As for the export part - it looks like freckle is using consolidated form of reporting (exactly what we need) - in such case why not have a simple set of categories one would want export and instead keeping track of each individual record, and export the whole day at once, allowing exporting several times by overwriting (if the API permits - i couldn't see the list of endpoints in their docu - http://developer.letsfreckle.com/)
Very nice job, thank you! :)
from hamster.
Thanks a lot for the detailed feedback.
The general problem is, that I'm a 100% web developer and those are just the tools that I'm most familiar with. Rails is certainly not really a great fit, but it worked for me. And I don't really see myself looking into d-bus, even though it would make a lot of sense from an architecture perspective.
Concerning the exporting. This manual step in the end fits my personal process pretty well, since it usually also involves some reviewing of the work week. Don't know how other people feel about it.
They are just overhauling the Freckle API documentation, so I think there is currently some information about endpoints missing.
from hamster.
Related Issues (20)
- Misalignment of drop down menus HOT 2
- Keyboard shortcut to unselect current activity HOT 2
- Investigate and eventually replace waf build system HOT 5
- Update / refactor translations / i18n HOT 2
- Flatpak improvements
- Github workflow improvements
- Allow running without installed gsettings schema HOT 1
- Add `--replace` option to replace existing services HOT 2
- Small fixes HOT 1
- Ideas for 3.0.4 release HOT 4
- [CVE-2023-36250] Arbitrary code exection possible through CSV import HOT 12
- hamster-indicator on Ubuntu 23.10 / Gnome 45.1 HOT 1
- commas in activity lead to strange behavior HOT 22
- keyboard shortcut for "end time = now" HOT 1
- layout flaw HOT 1
- Can't use hash character (#) in description field in "add activity" window HOT 4
- Should forbid comma in "activity/category" fields in "add/update activity window" HOT 1
- remove dependency on deprecated distutils package HOT 2
- Symlink'd db and template HOT 2
- Unable to scroll with Touchpad HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hamster.