fxy
Reusable computational namespaces for Python.
fxy is a small way to name, share, inspect, and reuse the imports that make a Python session feel like a particular mathematical or scientific language.
Instead of repeating setup cells across notebooks:
import sympy as sp from sympy import symbols, Eq, solve, diff, integrate from mpmath import mp
a profile can make that vocabulary explicit:
import fxy
fxy.use("mindey/cas")
The interpreter stays ordinary Python. The same profile can be used from CPython, IPython, Jupyter, QtConsole, scripts, or another Python host.
Quick start
Install the zero-runtime-dependency core:
pip install fxy
The core is pure Python and uses only the standard library. It can inspect, cache, and resolve profiles without installing a numerical stack:
import fxy
fxy.available()
# ('calc/v1', 'cas/v1', 'lab/v1')
fxy.describe("mindey/cas")
Install any vocabulary through the same profile API:
fxy.install("cas", approve=True)
fxy.use("cas/v1")
fxy.install("mindey/cas", approve=True)
fxy.use("mindey/cas")
Unversioned built-in names are aliases for their current profile:
fxy.use("cas") # currently cas/v1
A profile can also be pinned to a Git ref:
fxy.use("mindey/cas@main")
fxy.use("mindey/cas@44e0c10f778d8564fa4ff884b5a22ed651f368a5")
The last form pins an immutable Git commit and is preferable when a notebook must be reproducible.
What a profile is
A profile is a computational vocabulary: a set of imports plus optional dependency declarations.
Built-in profiles are registered by fxy itself. GitHub-hosted profiles use a declarative fxy.py at the repository root, for example:
__fxy_profile__ = 1
__requires__ = [
"sympy>=1.13",
"mpmath>=1.3",
]
import sympy as sp
from sympy import symbols, Eq, solve, diff, integrate
from mpmath import mp
The profile file is parsed, not executed. Schema version 1 permits import statements and literal fxy metadata; arbitrary statements such as function calls are rejected. Imported Python packages retain their normal import-time behavior.
This keeps two decisions separate:
Which names should exist in this computational vocabulary?
Which packages may be installed into this Python environment?
Dependency installation
Installing a profile’s declared dependencies is always explicit:
fxy.install("mindey/cas", approve=True)
For an interactive session, this is the equivalent one-step form:
fxy.use("mindey/cas", install_missing=True)
Without approval, a missing dependency raises an error showing what the profile declared rather than silently modifying the environment.
Profiles are cached under the user’s cache directory. Pass refresh=True to use(), namespace(), or describe() when you intentionally want to refetch an unpinned branch or tag.
Inspecting profiles
Profiles are inspectable without changing the current namespace:
fxy.names("cas/v1")
fxy.describe("cas/v1")
fxy.diff("cas/v1", "lab/v1")
To materialize a profile as a dictionary instead of injecting it:
ns = fxy.namespace("mindey/cas")
ns["solve"](...)
Built-in profiles
- calc/v1
The historical lightweight calculator vocabulary, centered on mpmath and eday.
- cas/v1
The historical symbolic vocabulary, centered on SymPy and mpmath.
- lab/v1
The historical numeric/data/scientific vocabulary.
The v1 profiles intentionally preserve the legacy import-selection semantics. Because the historical modules conditionally import optional dependencies, the exact names realized by a v1 profile can still depend on what is installed.
Future profile versions can be curated and dependency-declared without silently changing notebooks that explicitly requested v1.
Installing profile requirements
The default installation has no runtime dependencies:
pip install fxy
This is intentionally suitable for small Python environments, including terminal/mobile environments such as Termux: the resolver itself does not pull in NumPy, SymPy, mpmath, plotting libraries, or Jupyter.
A profile owns the declaration of the packages needed to realize its vocabulary. Built-in and GitHub-hosted profiles use the same operation and approval boundary:
fxy.install("calc", approve=True)
fxy.install("cas/v1", approve=True)
fxy.install("mindey/cas", approve=True)
There is deliberately no parallel fxy[...] installer namespace. Profile requirements have one source of truth.
A GitHub-hosted profile does not need its own PyPI package merely to define a vocabulary. Its repository can declare the packages it needs.
Publishing a profile
For a simple public profile:
Create a public GitHub repository, for example alice/cas.
Put a schema-1 fxy.py at its root.
Use it as fxy.use("alice/cas").
Pin a tag or commit when reproducibility matters.
This deliberately follows the familiar owner/repo[@ref] convention used by many plugin ecosystems. A future registry can therefore remain a thin discovery layer mapping short names to Git sources rather than becoming a second package repository.
Why profiles instead of predefined environments?
A predefined Jupyter kernel, shell environment, or QtConsole profile couples a vocabulary to one execution surface.
fxy instead makes the vocabulary reusable. A notebook and a terminal REPL can share the same profile while keeping their own interpreter, kernel, environment manager, and user interface.
That separation is the main design direction of fxy 0.8+.
Portability
The core package targets Python 3.8+ and has zero runtime dependencies. The wheel is platform-independent (py3-none-any). Platform-specific or compiled requirements belong to the profile or optional extra that actually needs them, not to the resolver itself.
This is deliberate: fxy should remain cheap to install even when the scientific environment it can describe is large.
Legacy compatibility
The older interfaces remain available for compatibility:
from fxy.calc import * from fxy.cas import * from fxy.lab import * from fxy.plot import *
and the historical fxy launcher options (including the CAS/LAB and QtConsole presets) continue to work.
For new notebooks and reusable code, these environment-style star imports and launcher presets are deprecated as the primary interface. Prefer fxy.use(...) or fxy.namespace(...) so the vocabulary is named, inspectable, shareable, and optionally version-pinned.
There is no removal date for the legacy interfaces in the 0.x series; they are kept as compatibility surfaces and may receive maintenance fixes.
Command-line calculator
The historical calculator command is optional. Install its profile requirements through the same API:
python -c "import fxy; fxy.install('calc', approve=True)"
Then:
fxy python -m fxy "pi**2"
Without those profile requirements, the command exits with an actionable message instead of silently opening a partial calculator.
The deprecated IPython/QtConsole launchers are execution frontends rather than computational vocabularies; their third-party frontend packages are intentionally not represented as fxy profile dependencies.
Links
Source: https://github.com/mindey/fxy
Example external profile: https://github.com/mindey/cas
Metadata
Release files for fxy 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fxy-0.8.2.tar.gz | 19.4 kB | Without provenance | Details for fxy-0.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fxy-0.8.2-py3-none-any.whl | Python 3 | none | any | Details for fxy-0.8.2-py3-none-any.whl |
Total release size: 36.4 kB
Release files / fxy-0.8.2.tar.gz
| Download URL | fxy-0.8.2.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c313032b3aebf8c4a48eecf6fa4a1d518105d082f82b70c9b0f6705111db61e
|
|
BLAKE2b-256 checksum How to use checksums |
8d0ac43392ce688894fedf42ef17e221da07052469edd022c561a79445047d3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / fxy-0.8.2-py3-none-any.whl
| Download URL | fxy-0.8.2-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d34a6e7e4eaf71a12fd27c845e3aa7076db5967263b56745cdc9311c045add34
|
|
BLAKE2b-256 checksum How to use checksums |
bc3905ca98bd619c589d817dfc52be5d980d72cd342e401356eee5d009fabca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for fxy 0.8.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.