Learning Human Design by Building a Python Library
Deep dive into BodyGraph calculations
PyHD computes complete Human Design charts from birth date and time. It calculates planetary activations for both the Personality (birth) and Design (88° solar arc before birth) imprints, and derives all characteristics.
Status update after a too long period working behind the scenes…
The Project
PyHD: a Python library for Human Design – BodyGraph calculations and analysis.
PyHD computes complete Human Design charts from birth date and time. It calculates planetary activations for both the Personality (birth) and Design (88° solar arc before birth) imprints, and derives all characteristics.
Why I’m Creating This
The main reason is surely simply that I’m a Line 1 developer who’s learning Human Design in an atypical way… 🤷♂️
The trigger was that I wanted to make many calculations to compare the differences. Primarily because my birth time is 8:10 – so it has probably been rounded. I was therefore wondering what changes in the -10 to +5 minutes around (clock accuracy, watching afterward, rounding). So I need structured data that I can easily compare.
The available tools are black boxes that don’t provide easily downloadable structured data.
I didn’t find any open source libraries that match what I want – see list here.
I contacted Jovian Archive explaining my project and need for calculations… and they ”politely” told me they don’t care and don’t want to provide me with any useful information – see their response.
Consciously, philosophically, and ethically, I think this knowledge is too important to be closed source. It must be a common heritage of the world – freely available for anyone. I had the intuition that the time has come for that to spread freely, openly, as much as possible.
This was also a great opportunity to check under the hood and understand how the mechanics/mathematics works. And most importantly to identify what’s really important, what’s less so, what’s problematic, and the edge cases.
I also had the idea to have a pre-calculated database (as open data) – for statistical analysis, identifying trends, etc. Especially as the 2027 shift is near the corner. I’ve also the intuition that some projects I’ve in mind (perfectly aligned with my life themes) will benefit from these data.
In the spirit of atypical, I also had the idea to make the code a course and reference in itself. Some developers/geeks could actually enjoy learning Human Design that way 🤷♂️
So many good reasons to do it 😁
Current State of Development
✔️ Converting the birth time into UTC is easy using the native Python library.
✔️ Swiss Ephemeris is apparently the de-facto library for high-precision ephemeris – i.e. tables that give the trajectory of naturally occurring astronomical objects and artificial satellites in the sky, i.e., the position (and possibly velocity) over time. Luckily, there’s a Python wrapper.
✔️ Calculating the position of a planet using Swiss Ephemeris is just a matter of calling a given function – we just need to convert the Python datetime into Julian date (using a function provided by Swiss Ephemeris).
✔️ Finding the design time at 88° of the Sun before birth was a small challenge – more on that below. It’s basically calculating the position of the Sun at different times until we’re close enough to the target position.
✔️ Calculating the two astronomical snapshots is just a matter of finding the position of 13 planetary bodies at 2 given times (birth and design).
✔️ Calculating the Gate is finding in which segment of the Wheel the planet is positioned (360° ÷ 64 equal segments). But before that, we need to align the Wheel on 0° and that was a small challenge – more details below.
✔️ The Lines are a simple subdivision of the Gates in six equal segments. So it’s the same logic as for the Gate to find in which segment the planet is.
❌ Colors, Tones, and Bases are additions specific to Human Design, and maybe proprietary calculations (or at least “not publicly available”) – more on that below. These are advanced topics and therefore less abundantly documented – so I still have to research that deeper.
✔️ I’m pretty confident I found how to correctly determine all the characteristics in the official book “The Definitive Book of Human Design” (by Ra Uru Hu and Lynda Bunnell). Basically, everything starts from the activated gates. Then it’s just a matter of applying basic logic.
☝️ The confidence level of these affirmations is pretty low as I tested with only 6 known charts.
The Challenges
✔️ 88° of the Sun
The design imprint is not just a date difference but a position of the Sun… so how do we calculate that?! 🤔 Is there a clever direct way or do we have to use trial-and-error?
The Sun doesn’t have a constant speed – it varies in the 0.95-1.02°/day range. I saw that the library to get the planet positions can return the planet’s speed. So we could use a kind of dichotomic search (hey, I remember something from my short passage at university 😂) – trying with average speed and adapting using the returned speed. When discussing this with Claude, he told me there’s actually an algorithm like that: Newton-Raphson. And with that, it’s actually super easy and efficient – we get the position in 2-4 iterations with sub-arcsecond precision (0.000278°).
Getting the result so efficiently, so easily, and so fast was the most satisfying moment of coding 😀 – mainly due to the fact that I thought it would be complicated. So to always be that happy, always start by thinking it’ll be really complicated? 😁
✔️ Aligning the I Ching Wheel
The position of the planet gives us a value in absolute degrees – an angle on the Wheel. But where is the zero-position located, where does the first Gate segment start?
Gate 41 is the first one in the Human Design System and it begins at 02°00’00” Aquarius.
There are 12 zodiac signs, so each spans on a 30° segment (360° ÷ 12). Aquarius is the eleventh sign in the zodiac, so starting at 300° (30° × 10). Therefore the first Gate starts at 302° (in absolute degrees) – spanning on 5.625° segment (360° ÷ 64).
☝️ The Gates are not sequentially ordered around the Wheel so we calculate an index and find the corresponding Gate in a hardcoded table. It’s also worth knowing that they’re listed counterclockwise – which is the same direction as angles.
❌ Colors, Tones, Bases
Human Design introduced three other values for planets: Color, Tone, Base – 6 Colors, 6 Tones, and 5 Bases.
Logically, it would be elegant to have these dividing the Wheel into smaller segments. And that’s exactly how SharpAstrology calculates them (source) – but do they have correct values? My initial tests failed (already with only 6 known charts!). So it’s maybe not that simple. 🤔 That said, I think it was just 1 problem on the 24 values I have (for the 4 variables of the 6 known charts).
Claude (AI) initially told me that this is a proprietary calculation of Jovian Archive – and couldn’t find the answer (or can’t provide me that information due to its copyright restrictions?) So I contacted Jovian Archive and they said: ”with enough reverse engineering, you could get fairly close to replicating the mathematical framework if you’re determined”… 🤔 said like that, it doesn’t seem very obvious. I didn’t do any extensive search yet but it doesn’t seem obvious to find.
Or is there actually a precision problem somewhere?
If we divide the Wheel for Colors, Tones, Bases, the segments are 0.15625°, ~0.026041667°, ~0.005208333°.
🤔 I need to add a way to see how close a value is from the edges.
✔️ Definitions
A Definition is a group of connected Centers. Two Centers are connected when a Channel between them is defined – meaning when both of its Gates are Activated. There can be 0+ Definitions.
To identify these groups we can build an adjacency graph: Center → set of connected Centers. Then counting connected components using BFS/DFS (Breadth-First/Depth-First Searches) – basically looping through all Centers and following the other Centers they’re connected to, adding them to the current group.
✔️ Definition Type & Simple/Wide Split
Finding the Definition Type is actually simply based on the number of Definitions… except for the ”2 groups” case where there’s a distinction whether these groups are close or far apart.
As there’s only 2 groups, we can loop over each Undefined Channel of each Center of the first group and check if it’s connected with a Center in the second group. If so, it’s a direct connection, so Simple-Split. Otherwise, it’s a Wide-Split. Not even a real challenge! 😉
✔️ Direct & Indirect Centers Connection
Two Centers are connected when there’s a ”path” between them. A path is 1+ Defined Channels that allows to get from one Center to the other.
Here too, Definitions come to our rescue. We just need to check if any of the target Centers is in the same group as the reference Center.
What’s Next
I’m currently polishing the code before publishing (perfectionist 🤷♂️) and working on proper test cases.
Colors, Tones, and Bases are put aside for now. This only impacts the Variables – and the logic for these is already written, just need the data.
🫵 If you know how to solve the Color, Tone, Base calculation problem – or spotted any other issues in my reasoning – I’d love to hear from you.
And if you’re a developer curious about Human Design, stay tuned for the repo. The code might just be your favorite way to learn it 😉
Appendices
Existing Libraries
- Pyswisseph: Python extension to the Swiss Ephemeris.
- SharpAstrology.HumanDesign: The Human Design Extension for the SharpAstrology project. See also: Base and SwissEph.
- Human design (HD) engine: Script for calculation of single, composite and multiple human design features.
- Simple Humandesign Calculator - back end
- hdkit: Open source Human Design programming toolkit to generate bodygraphs and planetary position data.
- Celestial-Forecast: Human Design Transits Tracker: Human design system transit tracker.
- Bodygraph API / PHP: A PHP library to calculate values of interest for generating Human Design charts.
- HumanDesignWebAPI: A simple .NET Web API that calculates a Human Design chart using birth time and location. Ideal for use in personal development, spiritual coaching, or self-discovery apps.
Answer from Jovian Archive
Hello Pascal,
Thank you for reaching out to us, I hope you are well.
It’s always great to hear from someone who’s diving deep into the Human Design experiment (and as a 4/1 Splenic Projector, your curiosity and precision make perfect sense 😉).
To clarify, the calculation methods behind the BodyGraph are not publicly available or open source. However, with enough reverse engineering, you could get fairly close to replicating the mathematical framework if you’re determined. Unfortunately, we don’t have a department or documentation we can refer you to for this kind of technical inquiry.
That said, best of luck with your explorations! Your project sounds fascinating, and it’s always inspiring to see developers and experimenters bringing new ideas into the Human Design space.
I hope this was helpful, and please let me know if you have any further questions.
Have a lovely day.