Skip to main content

Package for computing nerdy anniversaries

Project description

Two Pi Pies

Nerdyversary

MIT license GitHub repo build badge docs badge tests badge

Small project about finding "nerdy anniversaries". An obvious example would be that after 3.1415... years one could celebrate the $\pi$-th anniversary. The code in this repo finds nice combinations of numbers like $\pi$, $e$, $\phi$ and so on and can construct fractions for the approximation.

Installation

From PyPI

⚠️ Note: This project is currently not yet on PyPI.

From Source

  1. Clone the repository

    $ git clone https://github.com/rmnldwg/nerdyversary
    
  2. Create a Virtual Environment (optional, but recommended)

    $ python3 -m venv .venv
    

    You should do this with an installation of Python 3.10 or later. And don't forget to activate the environment with

    $ source .venv/bin/activate
    
  3. Use pip to install

    $ pip install -U pip setuptools setuptools-scm
    $ pip install .
    

Usage

Script

usage: nerdyversary [-h] [-v] [-d SPECIAL_DAY] [-s START] [-e END]
                    [--max-power MAX_POWER] [--factor-lim FACTOR_LIM]
                    [--format FORMAT]

Find beautiful nerdyversaries.

options:
  -h, --help            show this help message and exit
  -v, --version         Show the installed version and exit.
  -d SPECIAL_DAY, --special-day SPECIAL_DAY
                        Date of the special day in ISO format. (default: 2023-01-04)
  -s START, --start START
                        Date when to start with search in ISO format. (default:
                        2023-01-04)
  -e END, --end END     Date when to end the search in ISO format. (default:
                        2024-01-04)
  --max-power MAX_POWER
                        Largest exponent to consider for building the nerdyversaries.
                        (default: 5)
  --factor-lim FACTOR_LIM
                        Largest multiple of a symbol that is accepted. (default: 10)
  --format FORMAT       The output format that will be used by the `tabulate` package.
                        (default: simple)

The FORMAT argument must be one of the strings the tabulate package understands.

An example: The input

$ nerdyversary -d 2012-12-21 -s 2023-01-01 -e 2024-01-01 --format pipe --factor-lim 4 --max-power 3

will yield the following table:

Date Days Years Expression
6. Jan 2023 3668 10.04 $\frac{e^{3}}{2}$
24. Feb 2023 3717 10.18 $\frac{5 e^{3}}{\pi^{2}}$
12. Jun 2023 3825 10.47 $4 \phi^{2}$
19. Jun 2023 3832 10.49 $\frac{5 \pi^{3}}{2 e^{2}}$
25. Jul 2023 3868 10.59 $\frac{5 \phi^{3}}{2}$
5. Nov 2023 3971 10.87 $4 e$
12. Nov 2023 3978 10.89 $\frac{3 \pi^{2}}{e}$
14. Dec 2023 4010 10.98 $\frac{3 \pi^{3}}{2 \phi^{3}}$

The symbols here are

  • the golden ratio $\phi \approx 1.618\ldots$
  • the number $\pi \approx 3.1415\ldots$
  • Euler's number $e \approx 2.718\ldots$

When using this package as a library, arbitrary constants may be defined as symbols.

Library API

The API documentation is hosted here.

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

nerdyversary-0.1.0.tar.gz (292.0 kB view details)

Uploaded Source

Built Distribution

nerdyversary-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file nerdyversary-0.1.0.tar.gz.

File metadata

  • Download URL: nerdyversary-0.1.0.tar.gz
  • Upload date:
  • Size: 292.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for nerdyversary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 be29fcdc20d54e5f5ad6557123590a6a05c123a97eaa941c34360dbb906cddf0
MD5 5db96d30efc334665c7f91a3d33b1ba7
BLAKE2b-256 f7b5ddc413bc89480a3d2256dc26f277bef944d1011e162c921cd7f6c5014bd1

See more details on using hashes here.

File details

Details for the file nerdyversary-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nerdyversary-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb76b0fc98416100c037f540ea4c90aaf353d984a6d00108373ea7dd58508cf7
MD5 0f1f2e4064e34b5e71206fc82276adf1
BLAKE2b-256 f83e996c099b6a0198b46b2b368f7eebe03e3a8ee028a1fd6cbba7231525dfe3

See more details on using hashes here.

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