Skip to main content

fb2cal

Export Facebook birthdays to calendar and contact files.

CI Latest release License: GPL-3.0

This repository is a maintained fork of mobeigi/fb2cal. The upstream project is preserved as a reference and as a possible source of focused upstream contributions.

What it does

Facebook no longer provides the original birthday calendar export. fb2cal reads the authenticated birthday page session and queries the same birthday data used by Facebook's web interface. It deduplicates the visible birthdays for a full year and exports them as:

  • ICS calendar events for Google Calendar, Apple Calendar, and similar clients;
  • JSON contact data for automation and inspection;
  • vCard 4.0 contacts for address-book imports, with a vCard 3.0 compatibility mode for older clients.

The export includes only birthdays visible to the authenticated Facebook account. A total profile friend count is not available in the birthday query and is intentionally not fetched through a fragile profile-page scrape.

Requirements

  • An authenticated Facebook account;
  • Python 3.10 or newer;
  • uv.

The command never scans browser profiles or decrypts browser databases. It requires an explicit JSON export of the cookies from a browser session that is already logged in to Facebook.

Installation

Install the exact wheel published with the tagged GitHub Release:

uv tool install https://github.com/alsd4git/fb2cal/releases/download/v2.0.1/fb2cal_fork-2.0.1-py3-none-any.whl
fb2cal --help

For a one-off run without keeping the tool installed:

uvx --from https://github.com/alsd4git/fb2cal/releases/download/v2.0.1/fb2cal_fork-2.0.1-py3-none-any.whl fb2cal --help

pip can install the same wheel when preferred:

python -m pip install https://github.com/alsd4git/fb2cal/releases/download/v2.0.1/fb2cal_fork-2.0.1-py3-none-any.whl

The examples select the exact fb2cal wheel from a concrete release. Its dependencies are still resolved by the installer; use a checkout with uv sync --locked for the development dependency versions recorded in uv.lock. When selecting another release, copy the exact wheel URL from its GitHub Release page.

Quick start

Validate an exported browser session:

fb2cal doctor --cookies ./facebook-cookies.json

Export birthdays to an ICS calendar:

fb2cal export --cookies ./facebook-cookies.json \
  --format ics --output ./out/birthdays.ics

The out/ directory is ignored by Git when working from a checkout. Keep generated files private because they contain personal contact data.

Export formats

fb2cal export --cookies ./facebook-cookies.json --format ics --output ./out/birthdays.ics
fb2cal export --cookies ./facebook-cookies.json --format json --output ./out/birthdays.json
fb2cal export --cookies ./facebook-cookies.json --format vcf --output ./out/birthdays.vcf
fb2cal export --cookies ./facebook-cookies.json --format vcf \
  --vcard-version 3.0 --output ./out/birthdays-v3.vcf

Without --output, the selected format is written to stdout. The extraction summary is always written to stderr, so exported JSON, VCF, and ICS remain machine-readable:

Extraction summary:
  friends with visible birthdays: 621
  birthdays with year: 493
  birthdays without year: 128
  total profile friends: unavailable from the birthday query

The JSON export contains the same counts under its top-level summary object.

The VCF export uses vCard 4.0 by default. Dates use the standards-defined basic format, including --MMDD when Facebook exposes a birthday without a year. Use --vcard-version 3.0 only for address-book clients that do not support vCard 4.0; that legacy format keeps the older hyphenated date representation and may be less interoperable for yearless birthdays.

Exporting Chrome cookies safely

Treat the exported file as a password: cookies are bearer credentials.

  1. Open https://www.facebook.com/events/birthdays/ in Chrome and confirm that the page works.

  2. Use a trusted cookie-export tool to export the complete facebook.com cookie jar as JSON. On Chrome, Cookie-Editor can export the current site's cookies. Remove the extension when finished. A JavaScript snippet cannot export HttpOnly cookies.

  3. Save the file outside Git, restrict it with chmod 600 facebook-cookies.json, and never paste its contents into chat, issues, logs, or screenshots. The file must include c_user and all other Facebook session cookies.

  4. Validate the session without writing an export:

    fb2cal doctor --cookies ./facebook-cookies.json
    
  5. If the session expires, authenticate in Chrome again and export a fresh file.

Command reference

fb2cal doctor --cookies PATH [--json] [--log-level LEVEL]
fb2cal export --cookies PATH [--format ics|json|vcf] [--vcard-version 4.0|3.0] [--output PATH] [--log-level LEVEL]

--log-level accepts DEBUG, INFO, WARNING, ERROR, or CRITICAL. The browser session is always supplied explicitly; email/password login and automatic browser-cookie discovery are not part of this fork.

Scheduling

Run the export once every 24 hours with the scheduler available on your operating system. This keeps the calendar current when friends are added or removed and respects later birthday privacy changes. The generated ICS file advertises a twelve-hour publication TTL.

Development

For source development, use a checkout instead of the installed Release artifact:

git clone https://github.com/alsd4git/fb2cal.git
cd fb2cal
uv sync --locked --dev
uv run fb2cal --help
uv run pytest -q
uv run python -m unittest discover tests
uv run ruff format --check fb2cal tests --exclude tests/mocks
uv run ruff check fb2cal tests
uv build

The test suite is fully offline and contains no Facebook credentials or personal data.

Packaging and releases

This fork ships wheel and source distributions through tagged GitHub Releases. New builds use the distribution name fb2cal-fork; the command and Python module are still fb2cal. The fb2cal distribution on PyPI belongs to upstream. Use separate environments if you need both variants because they install the same command and module.

For versions listed on PyPI, run uvx --from fb2cal-fork fb2cal --help or install with uv tool install fb2cal-fork.

CI runs tests on Linux, macOS, and Windows with Python 3.11–3.15, plus Python 3.10 on Linux. On Linux, CI builds the distributions on Python 3.15 and tests installing and running each one with Python 3.10 and 3.15. To prepare a new release, record user-visible changes in the changelog, update the project version, verify the build, and push a matching tag:

uv sync --locked --dev
uv build
git tag -a vX.Y.Z -m "Release vX.Y.Z"
git push origin vX.Y.Z

The tag workflow creates a GitHub Release with wheel and sdist artifacts. It does not publish to PyPI. Maintainers can run the separate Publish to PyPI workflow manually from main after verifying both assets on the matching stable GitHub Release. It uploads those same files rather than rebuilding them.

For the first PyPI publication, configure a pending Trusted Publisher for project fb2cal-fork, owner alsd4git, repository fb2cal, workflow publish-pypi.yml, and GitHub environment pypi. Restrict that environment to main and complete the publication only after maintainer approval. No PyPI API token is needed.

Upstream and contributions

Report fork-specific bugs and feature requests in this repository's issue tracker. Fork-specific pull requests are welcome here; small changes compatible with the upstream architecture may later be proposed upstream as focused pull requests. Report vulnerabilities privately as described in SECURITY.md.

License

GNU General Public License v3.0 or later. See LICENSE.

Metadata

Release files for fb2cal-fork 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fb2cal-fork 2.0.1
File Size Uploaded Provenance Actions
fb2cal_fork-2.0.1.tar.gz 36.4 kB With provenance Details for fb2cal_fork-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fb2cal-fork 2.0.1
File Interpreter ABI Platform Actions
fb2cal_fork-2.0.1-py3-none-any.whl Python 3 none any Details for fb2cal_fork-2.0.1-py3-none-any.whl

Total release size: 69.2 kB

Release files / fb2cal_fork-2.0.1.tar.gz

Download URL fb2cal_fork-2.0.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c63bb65764efb2535f6f721c7383cc5d2acfe4efdc55666522c6d63a48456b1d
BLAKE2b-256 checksum
How to use checksums
eda5eeb9e8b778d1c71d3b04cc4d01ad4bd61128ddb20201d4d1de2b49155c09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / fb2cal_fork-2.0.1-py3-none-any.whl

Download URL fb2cal_fork-2.0.1-py3-none-any.whl
Size 32.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b92540d2e2abd08f850c990c52473225a1ae4b60d987899e46dbf6b20824bcc4
BLAKE2b-256 checksum
How to use checksums
139b9d35ef78f8a28b62926e040793bb210d91997c50e1b88882d19b0cfcea4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for fb2cal-fork 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fb2cal_fork-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page