Skip to main content

Notion Formulas

Build MIT License Version Python Version

Notion Formulas is a Python library designed for composing and manipulating complex formulas for Notion programmatically. Enhance your Notion workspace by leveraging the power of Python to create and manage formulas.

Installation

To get started with Notion Formulas, you can install the package using pip:

pip install notion-formulas

Usage

from notion_formulas import Number, prop

x: Number = prop("x")
y: Number = prop("y")

print(x + y)  # Prints `prop("x") + prop("y")`

API

The complete Notion Formulas API maintains consistency with the original names, with the following adjustments:

  • Camel casing is converted to snake case (e.g., replaceAll() becomes replace_all()).
  • Functions matching python keywords are modified with a trailing underscore: (i.g. if() becomes if_()).
  • Constants are uppercased (i.g. e becomes E).

Data types

The api is fully typed and defines following data types for expressions: Boolean, Number, String, and Date, allowing your formulas to be typed checked by mypy.

Examples

For a comprehensive example, refer to the code that generates a Taskwarrior style urgency score for a Notion task database in examples/urgency.py and the associated output examples/urgency.txt.

Contributing

Contributions to Notion Formulas are welcome and appreciated. If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and update the tests as needed.
  4. Submit a pull request with your changes.

For major changes, please open an issue first to discuss what you would like to change.

License

Notion Formulas is released under the MIT license, which allows for free and open use, modification, and distribution.

Metadata

Release files for notion-formulas 1.1.0

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

Source distribution (sdist)

Source distribution for notion-formulas 1.1.0
File Size Uploaded
notion_formulas-1.1.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for notion-formulas 1.1.0
File Interpreter ABI Platform
notion_formulas-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / notion_formulas-1.1.0.tar.gz

Download URL notion_formulas-1.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5fabf60afabaca76f8d45ad6fc285aff06a69c169ba31ce653306bb5d7f0578f
BLAKE2b-256 checksum
How to use checksums
47870db24e2ea95bc2c5606cc5e9ff20bb163532a84ec20bdc2593645d7d1eea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release files / notion_formulas-1.1.0-py3-none-any.whl

Download URL notion_formulas-1.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86aade4097286a84236a0fe8bce9cf81305ef80dc85e4d14e1fc48fcb54c3372
BLAKE2b-256 checksum
How to use checksums
f2cc6be92a4f02b99f503af2e0709542428c5e8cb6ac59ee6535e33b92f52826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

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