Skip to main content

Compose complex notion formulas in Python.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notion_formulas-1.0.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

notion_formulas-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file notion_formulas-1.0.0.tar.gz.

File metadata

  • Download URL: notion_formulas-1.0.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for notion_formulas-1.0.0.tar.gz
Algorithm Hash digest
SHA256 23c5cc7189aac36fc60c8e3822a80a2b87181c005ced573c8afa52ff04ce6d6d
MD5 3fe7b19ce7e4bad05f9a3c82bb3ea157
BLAKE2b-256 2b69791fabc5a779d59d2f8c9fd3a279d1560cb77c73b7534274083e23a92cc9

See more details on using hashes here.

Provenance

File details

Details for the file notion_formulas-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for notion_formulas-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38490a43f1d83cefe070a35bbcabf3b971962636bc3bc39ce8db0d717ef92042
MD5 5d1beb326f37bf7d53e50f1fc26fdf15
BLAKE2b-256 2d8abefe7ecf72f281de7384d6af7cbecad03b5d6bdd8c4813d05871298aa009

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page