esf-format
Read and write esf/1, the plain-text format for EVE Online ship fits. Text, canonical and binary forms. No dependencies.
pip install esf-format
Usage
import esf_format
from esf_format import Entry, EsfFit, Location, State
fit = EsfFit(
hull=587, # Rifter
name="Shield Buffer",
entries=[
Entry(2889, count=3, charge=21898), # 3 guns, a full load of ammo each
Entry(None, location=Location.HIGH), # an empty high slot
Entry(448, state=State.OFF), # an offline module
Entry(2048), # goes in its own rack
Entry(2456, count=5), # 5 drones
Entry(21898, count=1000, location=Location.CARGO),
],
)
text = esf_format.save([fit], catalog) # canonical text
data = esf_format.save_binary([fit], catalog) # binary
fits = esf_format.load(data, catalog) # text or binary
url = esf_format.to_base64url(data) # the binary form in a URL
data = esf_format.from_base64url(url)
save() and save_binary() take entries in any order, and check every rule
of the spec. load() returns fits in canonical form. All three raise
esf_format.EsfError when a rule is broken. It says where: line for text,
or fit and entry (counting from 1) for fits.
Fits
An EsfFit is one fit: hull, name, tactical mode and its entries.
hull is None for a fit without a ship. A document can hold more than one
fit.
Each Entry is one line of the fit. None means the default:
| field | what it is | None means |
|---|---|---|
type |
The type ID. | An empty slot. |
count |
How many. | One; for fighters, a full squadron. |
fit_name |
The name of another fit in the list, which this ship or container carries. | Carries no fit. |
charge |
The charge loaded. | |
charge_count |
How many charges. | A full load. |
mutaplasmid |
The mutaplasmid applied. | |
overrides |
Attribute values by attribute ID. | |
state |
State.OFF, ON or HEAT. |
Active if the type can be, else on. |
location |
CARGO, BAY or another hold; a rack only for an empty slot. |
Where the type goes by default. |
The Catalog
The library holds no game data. You give it a Catalog: an object that looks
up types and attributes in your copy of the SDE.
class MyCatalog:
def type(self, folded: str) -> esf_format.TypeRecord | None: ...
def type_by_id(self, type_id: int) -> esf_format.TypeRecord | None: ...
def attribute(self, folded: str) -> esf_format.AttributeRecord | None: ...
def attribute_by_id(self, attribute_id: int) -> esf_format.AttributeRecord | None: ...
# Optional. Without them, no hull has tactical modes and no type has mutaplasmids.
def modes(self, hull_id: int) -> Sequence[esf_format.TypeRecord]: ...
def mutaplasmids(self, type_id: int) -> Sequence[esf_format.MutaplasmidRecord]: ...
Names are looked up folded: index them with esf_format.fold(name). Where
names are shared, published wins, then the lowest ID (§4.2).
tests/catalog.py is a complete example.
Tests
The test cases live in esf-format:
git clone --branch v1.0 https://github.com/EVEShipFit/esf-format
uv sync
uv run --project esf-format/tools esf-test -- .venv/bin/python tests/program.py
uv run pytest
Metadata
Release files for esf-format 1.0.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 |
|---|---|---|---|---|
| esf_format-1.0.0.tar.gz | 58.9 kB | Without provenance | Details for esf_format-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| esf_format-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for esf_format-1.0.0-py3-none-any.whl |
Total release size: 81.0 kB
Release files / esf_format-1.0.0.tar.gz
| Download URL | esf_format-1.0.0.tar.gz |
|---|---|
| Size | 58.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f80514d81105297724596377805df039404eb72eaf030e7f733c46ecbcf91744
|
|
BLAKE2b-256 checksum How to use checksums |
ce80bea93b037e654977a50445d290a2f6e4848d4cb41d038ec2af79f324b4f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / esf_format-1.0.0-py3-none-any.whl
| Download URL | esf_format-1.0.0-py3-none-any.whl |
|---|---|
| Size | 22.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35aa8839b014bcfe2e7eddebe5ee1903f39364d354d7d173bce1b08336b0869e
|
|
BLAKE2b-256 checksum How to use checksums |
c7bb6d9d2c1b7fedb4bbc000677967c15da022acb088834ff0708b9998dae67a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for esf-format 1.0.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.