Commit abb56dcc authored by Johan Bjäreholt's avatar Johan Bjäreholt
Browse files

Restructuring

parent 7627f550
......@@ -10,23 +10,16 @@ Known as aw-server, it handles storage and retrieval of all activities/entries i
The server also hosts the Web UI (aw-webui) which does all communication with the server using the REST API.
Clients
-------
The server doesn't do anything very interesting on its own, for that we need clients. Most specifically a certain type of client known as watchers.
Writing these clients is something we've tried to make as easy as possible by creating client libraries with a clear API.
Currently the primary client library is written in Python (known simply as aw-client) but a client library written in JavaScript is on the way and is expected to have the same level of support in the future.
Client libraries:
- `aw-client <https://github.com/ActivityWatch/aw-client>`_ (Python)
- `aw-client-js <https://github.com/ActivityWatch/aw-client-js>`_ (JavaScript, work in progress)
Watchers
--------
Since aw-server doesn't do any data collection on it's own, we need watchers that observe the world and sent the data off to aw-server for storage.
These utilize the :doc:`aw-client` library for making requests to the aw-server.
For a list of watchers, see :doc:`watchers`.
User interfaces
---------------
......@@ -49,9 +42,19 @@ The aw-core library contains many of the essential parts of ActivityWatch, notab
- The datastore layer
- Utilities (configuration, logging, decorators)
aw-client
^^^^^^^^^
Writing these clients is something we've tried to make as easy as possible by creating client libraries with a clear API.
A client could both be a watcher which sends data as well as a visualizer which fetches and presents data from the aw-server.
Currently the primary client library is written in Python (known simply as aw-client) but a client library written in JavaScript is on the way and is expected to have the same level of support in the future.
- `aw-client <https://github.com/ActivityWatch/aw-client>`_ (Python)
- `aw-client-js <https://github.com/ActivityWatch/aw-client-js>`_ (JavaScript, work in progress)
aw-analysis
^^^^^^^^^^^
There are also plans to create a library called `aw-analysis <https://github.com/ActivityWatch/aw-analysis>`_ to aid in
different types of analysis and transformation one might want to make using ActivityWatch data.
......@@ -66,4 +66,4 @@ v0.7.2 (planned)
- New query2 API for querying and transforming data
- Web UI now has a view for the most-visited domains
- Web UI now has a button for removing buckets
......@@ -9,31 +9,27 @@ We've tried to make things easy for you (and ourselves) so here's some advice on
Collecting more data
--------------------
ActivityWatch is written to be flexible to be able to gather most types of data.
Except for the included aw-watcher-window and aw-watcher-afk which tracks your application usage and are included by default in ActivityWatch, there are additional so-called :doc:`watchers` for activitywatch.
If there is some kind of data you would want to track but are not
To do this you'd want to write a so-called watcher. Watchers are small programs that collect data and send it off to the server.
See :doc:`writing-watchers`.
Exporting data programatically
------------------------------
Exporting data is as simple as:
TODO
Writing visualizers
-------------------
.. note::
This section is uncomplete and should probably be moved to it's own section later
There are multiple ways to analyze data in activitywatch.
There are a couple of ways to analyze data in activitywatch.
aw-server supplies an "/query" endpoint (also accesible via aw-client's query method) which supplies a basic scripting language which you can utilize to do transformations on the server-side.
This option is good for basic analysis and for lightweight clients (such as aw-webui).
Another option is to fetch events from the "/buckets/bucketname/events" endpoint (also accesible via aw-client's get_events method) and either program your own transformations or use transformation methods available in the aw-analysis python library (which includes all transformations available in the query endpoint).
Another option is to fetch events from the "/buckets/bucketname/events" endpoint (also accesible via aw-client's get_events method) and either program your own transformations or use transformation methods available in the aw-analysis python library (which includes all transformations available in the query endpoint). This require a lot of more work since you will likely have to reprogram transformations already available in the query API, but on the other hand it is much more flexible.
This is an example of how you can do analysis and aggregation with the query method in aw-client
......
......@@ -5,5 +5,6 @@ Here we will document a few features.
.. toctree::
features/user-interface
features/exporting-data
features/pausing-logging
features/filtering-data
Exporting data
==============
If you go to the "Raw Data" page in the ActivityWatch webui you can download any of the buckets which contain every collected datapoint in ActivityWatch as a single file.
You can also export data programatically using the REST API, but we do not have a guide for that yet **todo: explain how**
......@@ -9,6 +9,8 @@ ActivityWatch comes with a web interface which currently has the following featu
- Activity overview
- Most used applications by day
- Timeline
- Most time spent on a website
*(requires the ActivityWatch browser extension)*
- Bucket overview
- When a bucket was last updated
- Listing of the latest events
......
......@@ -18,7 +18,6 @@ Welcome to the ActivityWatch documentation!
faq
features
watchers
extending
.. _dev-docs:
......@@ -26,12 +25,13 @@ Welcome to the ActivityWatch documentation!
:maxdepth: 3
:caption: Developer documentation
extending
development
architecture
buckets-and-events
writing-watchers
installing-from-source
api-reference
writing-watchers
rest
changelog
......
......@@ -91,10 +91,7 @@ The heartbeat API is one of the most useful endpoints for writing watchers.
POST /api/0/buckets/<bucket_id>/heartbeat
View API
Query API
~~~~~~~~~~~~~
.. warning::
This API should not be relied on. It's messy and has a bunch of issues that we hope to resolve by designing it.
No documentation here, because you shouldn't use it (yet).
**TODO: Add link to writing queries once that page is done**
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment