mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2024-12-05 02:06:53 +00:00
Утилита для загрузки/синхронизации в календарь Google событий из файла в формате iCalendar
51ccf2fc88
Bumps the pypi-updates group with 7 updates: | Package | From | To | | --- | --- | --- | | [google-auth](https://github.com/googleapis/google-auth-library-python) | `2.34.0` | `2.35.0` | | [google-api-python-client](https://github.com/googleapis/google-api-python-client) | `2.144.0` | `2.147.0` | | [icalendar](https://github.com/collective/icalendar) | `5.0.13` | `6.0.0` | | [pytz](https://github.com/stub42/pytz) | `2024.1` | `2024.2` | | [pytest](https://github.com/pytest-dev/pytest) | `8.3.2` | `8.3.3` | | [types-pytz](https://github.com/python/typeshed) | `2024.1.0.20240417` | `2024.2.0.20240913` | | [types-pyyaml](https://github.com/python/typeshed) | `6.0.12.20240808` | `6.0.12.20240917` | Updates `google-auth` from 2.34.0 to 2.35.0 - [Release notes](https://github.com/googleapis/google-auth-library-python/releases) - [Changelog](https://github.com/googleapis/google-auth-library-python/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-auth-library-python/compare/v2.34.0...v2.35.0) Updates `google-api-python-client` from 2.144.0 to 2.147.0 - [Release notes](https://github.com/googleapis/google-api-python-client/releases) - [Commits](https://github.com/googleapis/google-api-python-client/compare/v2.144.0...v2.147.0) Updates `icalendar` from 5.0.13 to 6.0.0 - [Release notes](https://github.com/collective/icalendar/releases) - [Changelog](https://github.com/collective/icalendar/blob/main/CHANGES.rst) - [Commits](https://github.com/collective/icalendar/compare/v5.0.13...v6.0.0) Updates `pytz` from 2024.1 to 2024.2 - [Release notes](https://github.com/stub42/pytz/releases) - [Commits](https://github.com/stub42/pytz/compare/release_2024.1...release_2024.2) Updates `pytest` from 8.3.2 to 8.3.3 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3) Updates `types-pytz` from 2024.1.0.20240417 to 2024.2.0.20240913 - [Commits](https://github.com/python/typeshed/commits) Updates `types-pyyaml` from 6.0.12.20240808 to 6.0.12.20240917 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: google-auth dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pypi-updates - dependency-name: google-api-python-client dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pypi-updates - dependency-name: icalendar dependency-type: direct:production update-type: version-update:semver-major dependency-group: pypi-updates - dependency-name: pytz dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pypi-updates - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pypi-updates - dependency-name: types-pytz dependency-type: direct:development update-type: version-update:semver-minor dependency-group: pypi-updates - dependency-name: types-pyyaml dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pypi-updates ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.github | ||
docs | ||
sync_ics2gcal | ||
tests | ||
.gitignore | ||
.readthedocs.yml | ||
how-it-works.png | ||
LICENSE | ||
poetry.lock | ||
pyproject.toml | ||
README.md | ||
sample-config.yml |
sync_ics2gcal
Python scripts for sync .ics file with Google calendar
Installation
To install from PyPI with pip, run:
pip install sync-ics2gcal
Or download source code and install using poetry:
# install poetry
pip install poetry
# install project and deps to virtualenv
poetry install
# run
poetry run sync-ics2gcal
Configuration
Create application in Google API Console
- Create a new project: console.developers.google.com/project
- Choose the new project from the top right project dropdown (only if another project is selected)
- In the project Dashboard, choose "Library"
- Find and Enable "Google Calendar API"
- In the project Dashboard, choose "Credentials"
- In the "Service Accounts" group, click to "Manage service accounts"
- Click "Create service account"
- Choose service account name and ID
- Go back to "Service Accounts" group in "Credentials"
- Edit service account and click "Create key", choose JSON and download key file.
Create working directory
For example: /home/user/myfolder
.
- Save service account key in file
service-account.json
. - Download sample config and save to file
config.yml
. For example:
wget https://raw.githubusercontent.com/b4tman/sync_ics2gcal/develop/sample-config.yml -O config.yml
- (Optional) Place source
.ics
file,my-calendar.ics
for example.
Configuration parameters
start_from
- start date:- full format datetime,
2018-04-03T13:23:25.000001Z
for example - or just
now
- full format datetime,
- (Optional)
service_account
- service account filename, remove it from config to use default credentials - (Optional)
logging
- config to setup logging google_id
- target google calendar id,my-calendar@group.calendar.google.com
for examplesource
- source.ics
filename,my-calendar.ics
for example
Usage
Manage calendars
manage-ics2gcal GROUP | COMMAND
GROUPS:
- property - get/set properties (see CalendarList resource), subcommands:
- get - get calendar property
- set - set calendar property
COMMANDS:
- list - list calendars
- create - create calendar
- add_owner - add owner to calendar
- remove - remove calendar
- rename - rename calendar
Use -h for more info.
Sync calendar
just type:
sync-ics2gcal
How it works
Documentation is available at sync-ics2gcal.readthedocs.io.