fguess
Like https://pym.dev/format but in your terminal.
Given an example of formatted output, fguess guesses the f-string format specification that would produce it.
Installation
Installing with uv tool:
uv tool install fguess
Installing with pipx:
pipx install fguess
You can also install fguess globally with pip, but I usually recommend installing command-line tools in their own separate environment.
Usage
Run fguess with an example of formatted output to see the format specification that would produce it:
$ fguess '$1,234.56'
Input: '$1,234.56'
----------------------------------------
float → f"${variable:,.2f}"
(e.g., variable = 1234.56)
str → f"${variable}"
(e.g., variable = '1,234.56')
Padded strings and datetimes are recognized too:
$ fguess "2030-01-24 05:45"
Input: '2030-01-24 05:45'
----------------------------------------
datetime → f"{variable:%Y-%m-%d %H:%M}"
(e.g., variable = datetime.datetime(2030, 1, 24, 5, 45))
Remember to quote the string you pass in, since format specifications often include characters your shell would otherwise interpret.
Run fguess with no arguments to analyze one string after another until you type quit.
Development
This project uses uv and just.
Run just to see every available task.
$ just test # run the test suite
$ just check # format, lint, and test
No setup step is needed: uv creates the virtual environment and installs dependencies on the first uv run.
To run the tests on every supported Python version:
just test-all
To see code coverage:
just test-cov
open htmlcov/index.html
If you would rather not install just, every task is a short uv command that you can run directly (check the justfile for the commands):
uv run pytest
Releasing
Releases are published to PyPI by GitHub Actions whenever a v* tag is pushed.
From an up-to-date main:
$ just bump minor # or patch, or major
$ git commit -am "Version 0.1.0"
$ just release
The release task refuses to run unless the checks pass, the working tree is clean, and you are on main.
It then tags the current version and pushes, which triggers the release workflow.
License
fguess is distributed under the terms of the MIT license.
Metadata
Release files for fguess 0.1.0
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 |
|---|---|---|---|---|
| fguess-0.1.0.tar.gz | 14.7 kB | Without provenance | Details for fguess-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fguess-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fguess-0.1.0-py3-none-any.whl |
Total release size: 23.8 kB
Release files / fguess-0.1.0.tar.gz
| Download URL | fguess-0.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8151976e8f873a2b113f322a5d0c156ed110d1e9dbcf5bb90e86d7dd9a5cc98
|
|
BLAKE2b-256 checksum How to use checksums |
8c067bfe435b4f820cc90baad5a5a68d7a8fbccbf683baf8f6d3390cd307c7f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fguess-0.1.0-py3-none-any.whl
| Download URL | fguess-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
878eaad2ceb9faaa5a23fd17aaa746e20cb4cc7ac860eba8e5ec00b9dd6087e0
|
|
BLAKE2b-256 checksum How to use checksums |
1e5c963c09780a4461877be228b8288b78619fe9f29c2e179b723b2dc12a5c3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fguess 0.1.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.
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.