Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 834ea96

Browse files
authored
Documentation Update for Timely (airbytehq#17755)
* Updating timely.md * Documentation update for Timely source connector. * Updated timely.md * Updated Timely.md * Timely Readme.md Update
1 parent 9c46e5a commit 834ea96

File tree

2 files changed

+155
-20
lines changed

2 files changed

+155
-20
lines changed
Lines changed: 125 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,132 @@
1-
This is the first python custom source connector which is made for Timely.<br>
2-
To get started using this connector, you will be needing three things.<br>
1+
# Timely Source
32

4-
1. Account ID
5-
2. Bearer Token
6-
3. Start-date
3+
This is the repository for the Timely source connector, written in Python.
4+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/timely).
75

8-
**Account ID** - Anyone who has admin access to Timelyapp.com you can find your account id, on the URL of your home page.
6+
## Local development
97

10-
Once, you have the account create an application on the Timelyapp.com where you need to specify your application name, this will generate Client_secret, Client_id, and redirect_uri.
8+
### Prerequisites
9+
**To iterate on this connector, make sure to complete this prerequisites section.**
1110

12-
**Bearer Token** - To connect to the timelyapp API, I recommend using Postman or any other open source application that will get you the bearer token.
13-
For Postman users, it will ask you to enter Auth url, Token url, Client_id, Client secret. For more details on how to work with timelyapp, please click [here](https://dev.timelyapp.com/#introduction)
11+
#### Minimum Python version required `= 3.7.0`
1412

15-
**Start-date** - Please enter the start date in yy-mm--dd format to get the enteries from the start-date, this will pull all the record from the date entered to the present date.
13+
#### Build & Activate Virtual Environment and install dependencies
14+
From this connector directory, create a virtual environment:
15+
```
16+
python -m venv .venv
17+
```
1618

17-
That's all you need to get this connector working
19+
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
20+
development environment of choice. To activate it from the terminal, run:
21+
```
22+
source .venv/bin/activate
23+
pip install -r requirements.txt
24+
pip install '.[tests]'
25+
```
26+
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
1827

19-
**Working locally**- navigate yourself to the source-timely/sample_files/config.json, and enter the ID, token and date to get this connector working.
28+
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
29+
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
30+
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
31+
should work as you expect.
32+
33+
#### Building via Gradle
34+
You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow.
35+
36+
To build using Gradle, from the Airbyte repository root, run:
37+
```
38+
./gradlew :airbyte-integrations:connectors:source-timely:build
39+
```
40+
41+
#### Create credentials
42+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/timely)
43+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_timely/spec.yaml` file.
44+
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
45+
See `integration_tests/sample_config.json` for a sample config file.
46+
47+
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source timely test creds`
48+
and place them into `secrets/config.json`.
49+
50+
### Locally running the connector
51+
```
52+
python main.py spec
53+
python main.py check --config secrets/config.json
54+
python main.py discover --config secrets/config.json
55+
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
56+
```
57+
58+
### Locally running the connector docker image
59+
60+
#### Build
61+
First, make sure you build the latest Docker image:
62+
```
63+
docker build . -t airbyte/source-timely:dev
64+
```
65+
66+
You can also build the connector image via Gradle:
67+
```
68+
./gradlew :airbyte-integrations:connectors:source-timely:airbyteDocker
69+
```
70+
When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in
71+
the Dockerfile.
72+
73+
#### Run
74+
Then run any of the connector commands as follows:
75+
```
76+
docker run --rm airbyte/source-timely:dev spec
77+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-timely:dev check --config /secrets/config.json
78+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-timely:dev discover --config /secrets/config.json
79+
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-timely:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
80+
```
81+
## Testing
82+
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.
83+
First install test dependencies into your virtual environment:
84+
```
85+
pip install .[tests]
86+
```
87+
### Unit Tests
88+
To run unit tests locally, from the connector directory run:
89+
```
90+
python -m pytest unit_tests
91+
```
92+
93+
### Integration Tests
94+
There are two types of integration tests: Acceptance Tests (Airbyte's test suite for all source connectors) and custom integration tests (which are specific to this connector).
95+
#### Custom Integration tests
96+
Place custom tests inside `integration_tests/` folder, then, from the connector root, run
97+
```
98+
python -m pytest integration_tests
99+
```
100+
#### Acceptance Tests
101+
Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information.
102+
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
103+
To run your integration tests with acceptance tests, from the connector root, run
104+
```
105+
python -m pytest integration_tests -p integration_tests.acceptance
106+
```
107+
To run your integration tests with docker
108+
109+
### Using gradle to run tests
110+
All commands should be run from airbyte project root.
111+
To run unit tests:
112+
```
113+
./gradlew :airbyte-integrations:connectors:source-timely:unitTest
114+
```
115+
To run acceptance and custom integration tests:
116+
```
117+
./gradlew :airbyte-integrations:connectors:source-timely:integrationTest
118+
```
119+
120+
## Dependency Management
121+
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
122+
We split dependencies between two groups, dependencies that are:
123+
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
124+
* required for the testing need to go to `TEST_REQUIREMENTS` list
125+
126+
### Publishing a new version of the connector
127+
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
128+
1. Make sure your changes are passing unit and integration tests.
129+
1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)).
130+
1. Create a Pull Request.
131+
1. Pat yourself on the back for being an awesome contributor.
132+
1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.

docs/integrations/sources/timely.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
1-
---
2-
description: 'This connector extracts "events" from Timely'
3-
---
4-
51
# Timely
62

7-
Timely can track time spent in every web and desktop app automatically for you. Get a precise daily record of all the time you spend in documents, meetings, emails, websites and video calls with zero effort.[Timely APIs](https://dev.timelyapp.com/).
3+
This page contains the setup guide and reference information for the Timely source connector.
4+
5+
## Prerequisites
6+
7+
1. Please follow these [steps](https://dev.timelyapp.com/#authorization) to obtain `Bearer_token` for your account. <br>
8+
2. Login into your `https://app.timelyapp.com` portal, fetch the `account-id` present in the URL. <br>
9+
URL `https://app.timelyapp.com/12345/calendar` <br>
10+
account-id `12345` <br>
11+
3. Get a start-date to your events. <br>
12+
Dateformat `YYYY-MM-DD`
13+
14+
## Setup guide
15+
## Step 1: Set up the Timely connector in Airbyte
16+
17+
### For Airbyte OSS:
18+
19+
1. Navigate to the Airbyte Open Source dashboard.
20+
2. In the left navigation bar, click **Sources**. In the top-right corner, click **+new source**.
21+
3. On the Set up the source page, enter the name for the Timely connector and select **Timely** from the Source type dropdown.
22+
4. Enter your `Bearer_token`, `account-id`, and `start-date`.
23+
5. Select `Authenticate your account`.
24+
6. Click **Set up source**.
25+
26+
## Supported sync modes
827

9-
Timely uses [Events](https://dev.timelyapp.com/#events) to store all the entries a user makes. Users can add, delete and edit all entries. Some user’s actions are restricted based on their access level in Timely.
28+
The Timely source connector supports the following [sync modes](https://docs.airbyte.com/cloud/core-concepts#connection-sync-modes):
1029

11-
# Timely credentials
30+
| Feature | Supported? |
31+
| :---------------- | :--------- |
32+
| Full Refresh Sync | Yes |
33+
| Incremental Sync | No |
1234

13-
You should be able to create a Timely `Bearer Token` as described in [Intro to the Timely API](https://dev.timelyapp.com/#authorization)
35+
## Changelog
1436

1537
| Version | Date | Pull Request | Subject |
1638
| :------ | :--------- | :------------------------------------------------------- | :-------------- |

0 commit comments

Comments
 (0)