Skip to main content

Fyrefly

A lightweight Python library to run SQL on databases & compute quant based mathematical operations.

📖 Full documentation: every function, with its formula, what each argument means, and what it returns.

pip install fyrefly

A quick tour

from fyrefly import *

# Math and quant
add(5, 4, 6, 10)                  # 25
ci(1000, 2, 10)                   # 210.0   compound interest
circle.area(7)                    # 153.94
eqn.q(1, 3, 4)                    # roots of x² + 3x + 4
sin(30)                           # 0.5     degrees by default
convert(10, "km", "miles")        # 6.2137

# Data, SQL, Excel-style lookups
c = load("data.csv")              # CSV, Excel, or a shared Google Sheet
d = sql("select * from c where age > 30")
vlook("Alice", "salary")          # like Excel's VLOOKUP
viz(c, "department", "salary")    # 12+ chart types, no API key

# AI (needs an API key; the provider is detected from the key)
ask(c, "total sales by region?", api_key="...")

# Test an API in a Postman-style window
api.gui()

# Physics, all in SI units
projectile.range(20, 45)                 # 40.77 m
circuit.ohm(V=12, R=4)                   # 3.0 A
lorentz.time_dilation(1, lorentz.speed(0.8))   # 1.667 s
nucleus.semf_binding(26, 56)             # 495 MeV

Never commit an API key. Set GEMINI_API_KEY, OPENAI_API_KEY or ANTHROPIC_API_KEY as an environment variable instead.

What's inside

Area Functions
Math and quant add mul div mod diff, si ci profit loss, ap gp hp, avg mode median, hyp slope dist
Mensuration 14 2D shapes and 10 3D shapes: circle, cube, cylinder, cone, sphere, ...
Algebra and trig eqn.l eqn.q, log exp sqrt curt nroot, sin cos tan cosec sec cot
Units and types convert, cast, round (round-half-up, like Excel)
Data and SQL load loadh loadc loads clean sql xtract
Excel lookups vlook xlook countif sumif avgif
AI ask, insights
Charts viz and viz.bar .scatter .line .box .hist .pie .heatmap ...
API testing api.gui(): requests, collections, environments, secrets, Postman import/export

Physics

Every physics function shows its formula in the docs. Angles are in degrees unless you pass mode="rad".

Domain Namespaces
Classical mechanics newton motion projectile gravity energy momentum circular friction inertia rotation shm damping orbit pulley fluid elasticity
Quantum and atomic constants photon matter bohr box qho tunnel nuclear xray
Thermodynamics gas heat entropy engine stat
Fluid mechanics pipe drag surface hydro channel
Electricity and magnetism charge capacitor circuit magnet induction ac emwave
Relativity lorentz relmech doppler gr
Nuclear and particle nucleus radiation reactor fusion particle

Development

pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for fyrefly 0.12.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 fyrefly 0.12.0
File Size Uploaded Provenance Actions
fyrefly-0.12.0.tar.gz 3.1 MB With provenance Details for fyrefly-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fyrefly 0.12.0
File Interpreter ABI Platform Actions
fyrefly-0.12.0-py3-none-any.whl Python 3 none any Details for fyrefly-0.12.0-py3-none-any.whl

Total release size: 3.3 MB

Release files / fyrefly-0.12.0.tar.gz

Download URL fyrefly-0.12.0.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1c6b2a363d7a8d2b5c56202e0b9eebd9989920ef49b22cde50a19f21924b98bd
BLAKE2b-256 checksum
How to use checksums
c1d39ccdb09d2f6799dce1010576ab308e1934a3a17d32cd8d428b2de43cd192
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release files / fyrefly-0.12.0-py3-none-any.whl

Download URL fyrefly-0.12.0-py3-none-any.whl
Size 146.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a811fda557a4c489466274e7be2e1eb64d15fffe0d28580a453507d0a44308b1
BLAKE2b-256 checksum
How to use checksums
ec36c34fd4708a8c70e70d435415cc27195dde381a7e50b2b92264df34207f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Security for fyrefly 0.12.0

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 fyrefly-0.12.0.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 Oct 13, 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.

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