Celestium

Open format

CEXF guide: quick start

Downloads (Markdown, JSON Schema, test vectors, zip): see the overview.

Status of this document: informative, not normative. This guide accompanies the specification CEXF-SPECIFICATION.md. It adds no rule. If this guide and the specification disagree, the specification governs.

Version of this document: describes format version 1.

Location: https://celestium.nl/cexf/v1/CEXF-GUIDE.md, next to the specification, the schema and the test vectors under https://celestium.nl/cexf/v1/.

License. This guide is made available under Creative Commons Attribution 4.0 International (CC BY 4.0): SPDX-License-Identifier: CC-BY-4.0. © 2026 Timothy van der Ham. Rights holder: Timothy van der Ham. A suitable credit reads: "CEXF guide: Celestium EXchange Format, © 2026 Timothy van der Ham, https://celestium.nl/cexf/v1/CEXF-GUIDE.md, licensed under CC BY 4.0." The code examples and the JSON fragments and example files printed in this guide are made available under Creative Commons CC0 1.0 Universal: SPDX-License-Identifier: CC0-1.0. The full license declaration is in the "License" section of the specification.

Names and people. Product names in these documents (other astrology programs, libraries, standards bodies) are trademarks of their owners and are used only to say what they are. "CEXF" and "Celestium" are names of the rights holder's format and programs. They are not licensed: the license gives no right to use either name for a product of your own or to suggest that the rights holder endorses it. Saying that your software reads or writes CEXF is fine. All persons in the examples and in the test vectors are fictitious. Any likeness to a real person is accidental.

What is in this guide. A quick start, the rationale behind the rules of the specification, the full example file (§12), the explanation of the test vectors (§12a) and Appendices A to D. Everything else, the rules themselves, is in the specification.

How the numbering works. A section number with a § and no file name, such as §7.3, refers to the specification. The sections §12 and §12a and the Appendices A, B, C and D keep the number they have in the specification. The rationale passages carry a number of their own, R followed by the section of the specification they belong to (for example R6.4 belongs to §6.4); the specification points to them by that number, and the numbers do not change.


Quick start

What CEXF is. CEXF is an open file format for astrology data. A .cexf file is one JSON document. It holds subjects (people, events, countries, organisations), the charts of each subject, and the notes on those charts. It carries the facts you need to calculate a chart again (moment, place, a few settings), not the calculated positions.

Why you would use it. The format is open and free to implement: no permission, no payment. The data stays yours: it is plain text that you can read without the program that wrote it. A reader that meets something it does not know does not throw the file away, it reports it and reads on.

A minimal valid file. One subject, one chart. This file validates against cexf-schema.json as it stands.

{
  "format": "cexf",
  "version": 1,
  "subjects": [
    {
      "id": 1,
      "displayName": "Johanna van der Berg",
      "charts": [
        {
          "sequence": 0,
          "time": {
            "utc": "1990-04-12T08:15:00Z",
            "timeZone": "Europe/Amsterdam",
            "localTime": "1990-04-12T10:15:00",
            "utcOffset": "+02:00"
          },
          "location": { "latitude": 52.3702, "longitude": 4.8952 }
        }
      ]
    }
  ]
}

sequence: 0 marks the primary chart, which needs no type (§5.1). The four time fields are all required (§7). So are latitude and longitude (§7a).

Build a reader and a writer in five steps.

  1. Parse the file. UTF-8 JSON, one leading byte order mark ignored. Refuse a file that is not valid JSON, or whose format is not "cexf", or whose version or subjects is wrong (rows F1 and F2). Read integers exactly. See "Conformance and conventions" and §2.
  2. Read the records. Folders (§3), subjects (§4), charts (§5), notes (§7b) and references (§8). cexf-schema.json shows the structure of every one of them.
  3. Apply the rows of §10. For each situation §10.3 gives one outcome class, one target and the notice owed. §10.2 gives the order in which the rows apply. A reader never crashes on input.
  4. Calculate. Use utc and location (§7, §7.7), check the identity of §7.3, and show localTime and utcOffset as written (§7.4). For a value you cannot calculate, use your own choice and report it (row CH17). A chart type you do not implement is set aside and reported (row CH1), or, if you take it up as a chart of another kind, calculated as that kind and reported (row CH17). Never guess silently.
  5. Write. Produce what the schema accepts and the rules the schema cannot express (Conformance, "What a writer must do"). Omit what you do not know: never null where it is not allowed, never an empty string. If your program also reads and writes, keep what it does not use: the write-back column of §10.3, unknown parameters keys (§6.4) and unknown extensions keys (§9.3).

A checklist for your first reader. Ten lines to keep next to the editor. They summarise the specification and add no rule.

  1. Apply the rows in the order of §10.2: file (F1 to F4), entries (E1), folders, subjects, charts, references (RF5 first, then RF2, RF3 and RF6, then RF1 and RF4), notes.
  2. Validate per record, never the whole document as a gate. A schema failure in a defining member costs the record that holds it (rows E1 to E3), not the file. A failure in an informative member (E5) costs only that member: report it, leave it out and keep the record. An invalid calculation parameter (CH5) costs nothing either: report it and use your own choice.
  3. Refuse a file only for F1 or F2. A higher version (F3) is read structurally and its version is kept. A stray root key (F4) is reported and the file is read on.
  4. Tell absent from unrecognised. Absent means the documented default or "no opinion". A value you do not recognise is reported and never read as absent.
  5. For a value you cannot calculate, use your own choice, say so (CH17) and keep the value. Set aside a chart type you do not implement (CH1), or report that you took it up as another kind (CH17). Never guess silently, never crash.
  6. Calculate from utc and location, check the identity of §7.3, and show localTime and utcOffset as written.
  7. Write the calculation parameters (§6.4) you know. Write no null (except parentId and folderId) and no empty string.
  8. If you also write, keep what the write-back column of §10.3 says is kept, unknown parameters keys and unknown extensions keys.
  9. Give every notice the row, the record and, when a value caused it, the field and the value.
  10. Support only what you need. A reader may skip any chart type or register value, as long as it reports it and never says it used what it did not use.

Check your work. Run every document in cexf-test-vectors.json through your validator and your reader. Section 12a of this guide says what each one is for.

Where to find things. The rules: CEXF-SPECIFICATION.md. The schema: cexf-schema.json. The test vectors: cexf-test-vectors.json. The reasons behind the rules: the "Rationale" part of this guide. Pitfalls by programming language: Appendix B of this guide. All of them live under https://celestium.nl/cexf/v1/.


Minimum support

This section is a summary and it is informative. "Conformance and conventions" in the specification governs.

A conformant reader applies §10 to every document. For every situation named there it produces the outcome class, the target and the notice that the row gives, and it never crashes on input. It may be partial in what it uses: a reader that shows charts and calculates nothing is conformant, as long as it never claims a record is used that it did not use and never changes a value without a notice. A reader that also writes (a round-tripping reader) satisfies the write-back column of §10 as well.

A conformant writer produces only documents that validate against cexf-schema.json and that satisfy every rule the schema cannot express: the identity of §7.3, unique ids and sequences, references that resolve, and the rules for time per chart type (§7). It writes UTF-8 without a byte order mark, never writes null where it is not allowed or an empty string, and writes the required parameters of a derived chart.

A reader does not need to implement every chart type or every register value. For a value it cannot calculate it uses its own choice and reports that (§10, row CH17). A chart type that it does not implement is set aside and reported (row CH1), or, if it takes the type up as a chart of another kind, calculated as that kind and reported (row CH17). An invalid informative member, such as a blank name or a note with a date that does not exist, is reported and left out, and the record stays (row E5). It never guesses silently. A reader that calculates nothing does not apply rows CH5 and CH13 (it chooses no parameter and draws no houses) and of row CH17 it has only the cases that no reader can calculate. Every other row applies to it, CH19 included: it still shows the local time without knowing the clock. Calculated positions and houses are not part of a file (§11).

How to read the specification

The core of the specification is normative. This guide holds the rationale, the quick start, the worked example files, the full example file (§12), the explanation of the test vectors (§12a) and Appendices A to D, and is informative.

The numbered sections (§1 to §15, with §13 reserved), the sub-sections 7a to 7c and 12a, and the appendices are a lot to take in at once, and not every reader needs all of them. Start with "Minimum support" above and then "Conformance and conventions" in the specification, which defines the words the rules use. Then pick a path based on what you're building:

  • Just reading .cexf files. §1 (basic principles), §2 through §9 (the field reference), and §10 (error handling) are the core. That's the whole vocabulary and the rules for what to do when something doesn't check out. Skim §12 for a worked example once the field reference starts to feel abstract.
  • Also writing .cexf files. Everything above, plus §10's versioning rules and §14 (the two ways of exporting), which matters the moment your writer has more than one destination in mind.
  • Comparing your reader with the reference implementation. All of the above, plus Appendix A, which lists where the reference implementation does less than the format allows and which notice it then issues.
  • About to write your first reader or writer. Appendix B collects what seven independent implementers, working from an earlier version of the specification alone in seven different languages, actually tripped over. It is short.
  • Only validating files, not implementing a reader or writer. cexf-schema.json plus the worked example in §12 will usually get you there without reading the rest. §12a's test vectors give a larger, pre-validated set of accepted and rejected documents to run your own validator against, without writing any of your own.
  • Converting from or to another program's format. Appendix C lists the names other programs use for the ayanamsas in §7c.2. Appendix D summarises how to record a chart from nine other formats in this one, and what is lost on the way.
  • Unfamiliar astrological terms. The Glossary at the end explains ayanamsa, horary, syzygy, and the other terms the specification uses, in plain language, for a competent developer who isn't an astrologer.