GithubHelp home page GithubHelp logo

almarklein / timetagger Goto Github PK

View Code? Open in Web Editor NEW
1.1K 16.0 98.0 3.71 MB

Tag your time, get the insight

Home Page: https://timetagger.app

License: GNU General Public License v3.0

Python 94.42% HTML 1.21% Dockerfile 0.72% JavaScript 0.67% SCSS 2.97%
python timetracker

timetagger's Introduction

CI Documentation Status PyPI version

TimeTagger

Tag your time, get the insight - an open source time-tracker with an interactive user experience and powerful reporting.

Introduction

TimeTagger is a web-based time-tracking solution that can run locally or on a server. It's aimed at individuals and freelancers, and has the following features:

  • Intuitive UI based around an interactive timeline.
  • Lightweight feel by use of tags rather than projects.
  • Reporting in PDF and CSV.
  • Set daily/weekly/monthly targets.
  • Integrated Pomodoro method (experimental).
  • Responsive: works well on small and large screens.
  • Sync between devices.

Under the hood

The server runs on async Python using uvicorn and asgineer - which is fun and bloody fast. It uses SQLite via itemdb to store the data, making it easy to deploy.

The client is a mix of HTML, CSS, Markdown, and ... Python! PScript is used to compile the Python to JavaScript. This may be a bit idiosyncratic, but it's fun! Maybe I'll someday implement it in something that compiles down to Wasm :)

Install and run

TimeTagger is implemented as a Python library that requires Python 3.6 or higher. The dependencies are listed in requirements.txt - these are installed automatically when you install TimeTagger with Pip.

# Install
pip install -U timetagger

# Run
python -m timetagger

If the server runs on your local machine, you can use single-user mode out-of-the-box.

Self-hosting your time tracker

Docker images are provided via the Github container registry, so you can use e.g. Docker-compose to easily host your own server.

There are two variants, one that runs the server as root inside the container and a nonroot variant that runs as user 1000:

See this article for more information about self hosting.

Authentication using credentials

If you want multiple users, or if the server is not on localhost, you may want to provide the server with user credentials using an environment variable or a command line arg (see the docs on config).

# Using command-line args
python -m timetagger --credentials=test:$2a$08$0CD1NFiIbancwWsu3se1v.RNR/b7YeZd71yg3cZ/3whGlyU6Iny5i

# Using environment variables
export TIMETAGGER_CREDENTIALS='test:$2a$08$0CD1NFiIbancwWsu3se1v.RNR/b7YeZd71yg3cZ/3whGlyU6Iny5i'
python -m timetagger

The credentials take the form ":", where the hash is a (salted) BCrypt hash of the password. You can generate credentials using e.g. https://timetagger.app/cred.

Authentication using a reverse proxy

If you have a reverse proxy which already authenticates users (e.g. Authelia) and provides the username through a HTTP header, you can tell TimeTagger to use this information. To configure it there are three environment variables and command line arguments (see the docs on config).

# Using command-line args
python -m timetagger --proxy_auth_enabled=True --proxy_auth_trusted=127.0.0.1 --proxy_auth_header=X-Remote-User

# Using environment variables
export TIMETAGGER_PROXY_AUTH_ENABLED=True TIMETAGGER_PROXY_AUTH_TRUSTED=127.0.0.1 TIMETAGGER_PROXY_AUTH_HEADER=X-Remote-User
python -m timetagger

Show your support

If you're self-hosting TimeTagger and want to support the project, you can:

  • Write something about TimeTagger in a blog post or social media (and link to https://timetagger.app). This helps search engines find it better.
  • Contribute improvements via Github.
  • For financial support you can take a subscription or donate (see the donation links on the side).

Using the hosted version

You can also make use of https://timetagger.app so you don't have to worry about maintaining a server, backups, and all that. An account is just โ‚ฌ3 per month. With that you'd also sponsor this project and open source in general.

Copyright and license

As usual, copyright applies to whomever made a particular contribution in this repository, which can be inspected via e.g. git blame. The owner of the copyright (i.e. the author) is free to use their code in any way.

This code is also subject to the GPL-3.0 License, to protect it from being used commercially by other parties.

Contributors must agree to the Contributor License Agreement to grant me (Almar) the right to use their contributions at e.g. the TimeTagger.app service. By making a contribution to this project, you agree to this CLA.

Developers

Clone the repo and install in development mode:

git clone https://github.com/almarklein/timetagger.git
cd timetagger
pip install -e .

Install additional developer dependencies:

pip install invoke black flake8 pytest pytest-cov requests

Then these commands can be used during development:

  • invoke -l to see available invoke tasks
  • invoke clean to remove temporary files
  • invoke format to autoformat the code (using black)
  • invoke lint to detect linting errors (using flake8)
  • invoke tests to run tests (using pytest)

timetagger's People

Contributors

almarklein avatar arne-cl avatar axelknock avatar danielhass avatar dorianim avatar edgardleal avatar joergsteffens avatar kraftner avatar maresmar avatar michaellenaghan avatar mtn-mathi avatar robin-moser avatar rynoxx avatar staddi99 avatar tagirijus avatar tderflinger avatar vchigrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timetagger's Issues

Function to continue a entry

I"d like to see the possibility to continue a time entry. The function basically copies the description from an existing entry to a new one.

Thanks for delivering great software!

Enable deleting records

Technically this is possible. Well it's more like hiding, because you cannot simply delete something because of syncing. Mostly a matter of UI.

Better styling of dark mode

In #67 I implemented the new style for dark mode, but it did not get the amount of attention that I gave to light mode. In part because I'm not a big fan of darkmode, so I don't have a good feeling of what looks "right".

Would be nice if someone with a love for darkmode would pitch in.

Code of interest:

CLI tool

Via the public API.

Can start simple, with just a way to start and stop a timer.

Pomodoro timer

Integrating a pomodoro workflow in TimeTagger was mentioned as a user request, and would be really nice!

Rethink tag suggestions

Tag suggestions are nice, but I find myself clicking them and be less tempted to actually write a description. It also feels somewhat awkward when the tag I want to use is not in the suggestions (we can only show a few). I'm afraid the suggestions promote a bad habit of only using shown tags and not writing a useful description.

I'm thinking of using auto-completion instead. Let's see how that works out on mobile...

uvicorn missing in requirements

Hi Almar,
after installing timetagger (pip install -r requirements.txt && python setup.py install),
I get this error:

(timetagger) arne@t470:~/repos/timetagger$ python run.py
[INFO 2021-01-14 12:00:29] Compiled pscript from dialogs.py
[INFO 2021-01-14 12:00:29] Compiled pscript from front.py
[INFO 2021-01-14 12:00:29] Compiled pscript from dt.py
[INFO 2021-01-14 12:00:29] Compiled pscript from auth.py
[INFO 2021-01-14 12:00:29] Compiled pscript from stores.py
[INFO 2021-01-14 12:00:29] Compiled pscript from utils.py
[INFO 2021-01-14 12:00:29] Collected 11 assets from /home/arne/repos/timetagger/timetagger/client/.
[INFO 2021-01-14 12:00:29] Collected 9 assets from /home/arne/repos/timetagger/timetagger/static/.
[INFO 2021-01-14 12:00:29] Collected 13 assets from /home/arne/repos/timetagger/timetagger/images/.
Traceback (most recent call last):
  File "run.py", line 51, in <module>
    asgineer.run(main_handler, "uvicorn", "0.0.0.0:80", log_level="warning")
  File "/home/arne/.virtualenvs/timetagger/lib/python3.7/site-packages/asgineer/_run.py", line 39, in run
    return func(appname, bind, **kwargs)
  File "/home/arne/.virtualenvs/timetagger/lib/python3.7/site-packages/asgineer/_run.py", line 55, in _run_uvicorn
    from uvicorn.main import main
ModuleNotFoundError: No module named 'uvicorn'

Option to start a new record and auto-stop the current running record

Hello. Thank you for your software.
Once thing i do frequently is switch from one task to another. Currently this means stopping the current record and then starting a new record.
Is there a way to just switch to a new record, stopping the current one, and running a new one ?
If not, as a feature request, there could be a list of already existing tags in some dropdown where clicking on an entry would stop the current record and create a new one with the tag.
What do you think ?

In overview panels (timeline when zoomed out) show hint of selection

Right now, if you select tags in the overview, days that did not have any time clocked for that tag will show zero hours. This can be confusing (e.g. if you forgot you had a tag selected). Let's show some hint, by also showing total time, filling in the panel in some way, or both.

Actually make it a PWA

The website advertises that TimeTagger can be installed because it's a Progressive Web App. I meant to implement this soon, but so far other issues have gotten priority.

KeyError when deleting an entry

Hi, i am running the local setup and when i am delting an entry i get a message box "KeyError: some token" everytime. But the entry gets deleted finally.
Not sure where this comes from.
Do you have an idea?

Thank you for this nice project!

Round the inner corners of records

The 90 degree corners of a rectangular shape are relatively easy to make round. But for the pieces that connect the two parts of the record representation, we'd have to calculate angles etc. I've left that for later because other things have higher priority. See image below.
image

Look into better colour selection of multi-tag records

Ideas: somehow mix the hue value corresponding to the individual tags and use a darker flavor.


Idea: make a checkerboard, so that all colors are shown, but are not "ordered". Feels cluttered.

Idea: simple bands, more bands become a bit narrower. I think this could work. The only thing is that the bands are ordered. Must we just accept that, or perhaps adopt the same ordering for the colors as the overview pane decides for the tags?

Read through HN post to collect suggestions

https://news.ycombinator.com/item?id=25762715#25765847

Suggestions

  • Possibility to delete a record.
  • The icon in the tab is hard to see on a dark background.
  • The "House" for "Snap to now" and calendar for time-range feel unintuitive, but that is subjective.
  • That burger menu is, pardon me, somewhat of a problem. There is so much information. I can see "Install App" in the installed App. "Export" happens there but also on the main screen. Which features belong where? Im missing a hierarchy here.
  • Your hint text in the "Manage tags" dialog is too long.
  • Is that a refresh button next to the burger menu (left side)? I can click an empty button. Wait, what?
  • I really do like that infinite scroll and stuff. Looks cool. On the other hand it is quite easy to get lost.
  • Please don't require headings over button groups at all (and then even mix that with my initials!)
  • the dashed line indicating 'now' is really easy to overlook and it should be visually more prominent (other color, thicker, ...)
  • In the overview (this week, this month, ...) the records should be display somehow. Indicating records visually in the overviews makes it easier to grasp the work distribution over longer periods of time. Additionally, if I mess up the month/year of a record (which I frequently do ;-) ) I have no chance to find it again except that I scroll through every day and look for it. So maybe assigning a separate color to each tag and display them in the big grey fields next to the time line would work...
  • Checkout ActivityWatch
  • Add to https://wintermute.app/repositories
  • Some people seem to be confused about the representation of records in the timeline.
  • Many people seem to like the interactive timeline. (One post seemed both.)
  • Faster way to start a timer, e.g. via a keyboard shortcut.
  • Combine the two ways to start a timer into one button in some smart way. Perhaps in the start-dialog you can also stop it directly?
  • When selecting tags on the right, also hide (or gray out) records on the left.
  • In the save to csv, include a column for the just the tags
  • Make sure you have a robust plugin layer as people will want to integrate this into their existing systems.
  • Public API so other tools can hook into it.
  • Allow a company to purchase N licenses at once.
  • Does not work on Safari mobile iOS 14.3.
  • I would love some transitions on the popup elements
  • Keyboard control over the forms :)
  • I asked whether a CLI interface would be of interest. 5 ppl showed interest.
  • via email: use a CLA to resolve copyright vs duallicensing issue.
  • Explain the low price (no free users).

Things people were excited about

  • I think the fact being open source is the main source for the popularity of that post.
    • Able to see the code.
    • In case I like the service and it is discontinued for any reason, able to host it by myself.
    • Adds another layer of trust and I have the feeling I can influence the product.
  • That was perhaps the most compelling landing page I've ever seen. When you mentioned the lack of cookie banner I found it strangely exciting.
  • I really like the concept of the continuous scrolling main time bar on the left.
  • Also one toxic comment without further explanation: "The UI makes me want to vomit."

Cross-browser visual tests

I took a lambdatest account to solve #73. Might as well include visual tests in CI now. They won't prevent a bug like #73, but they would for something like #22.

Dockerfile

This would be an awesome app to run in Docker/kubernetes. If you could create a working docker file, I can build an Helm chart for Kubernetes for you.

Make timeline snap so finer points

The snapping feels quite coarse now, which can be annoying. I think snapping is still a good idea, but perhaps finer steps can be used.

Redesign

Just an issue to track the redesign that we're working on.

Library API docs

Either via readthedocs, or perhaps by injecting in the readme.

Remind user when a record is running x hours

Because maybe the user forgot to stop the time. This is very user-specific. Some users may do many different things, each taking just a few minutes, other may work on one thing for several hours. Therefore this should probably be configurable.
The notifying is probably best done via web notifications.

Faster way to start/stop a record

E.g. via a keyboard shortcut. Just start the record with an empty record description - the user can fill it in later when needed.

Performance tweaks

A general issue as a reminder that there are several places were performance tweaks are possible. Not a high priority, since it's working relatively smooth even on my Nokia 1, but would not hurt to shave off some CPU cycles.

Public API

Plus some way to create an API key or similar.

Bring back the coloured tags?

There have been multiple users who came from TimeTurtle who asked about the return of colored tags. So it is worth thinking about how we can bring this back. In their words:

Being able to color code my day and see at a glance what my day consisted of via colors is one of the key features that made Timeturtle valuable

Really liked that feature in TimeTurtle especially when seeing the time distribution in colour over the course of the day.

However, it's not a matter of just enabling that feature again:

  • Tags are implicit. We can assign a color to a tag automatically, but not let the user chose one. Or well, we could, but it would be a bit weird, since tags are implicitly derived from the use of hashtags in the record description.
  • Records can have multiple tags, and so have the elements in the overview panel. In a very early version of TimeTagger (which was never deployed) I showed a colour for each tag, but this resulted in so many colors that it did not help at all. Which is one of the reasons why I removed it. But perhaps we could assign a color based on tag combo's instead of individual tags.

We should also think what it was about this feature (in TimeTurtle) that was helpful, because there might be other ways (compared to using color) to bring this back.

Better documentation for the self-hosted version

The README.md is lacking critical information on how to get the project running.

Installation
pip(3) install X is nice but then what?

Uninstall
How to cleanly uninstall?

Requirements
What python version is required?

For now it was unusable for me.

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.