Advice wind direction sensor with I²C interface
Do you really need to know wind direction to better than every 20 degrees?

OK, then; this can be accomplished using an incremental rotary encoder. Encoders are available in enough variety of resolution that you are sure to find one that fits your need. If you can't then investigate resolvers that will provide effectively infinite resolution.

Attach a flag/wind vane to the encoder shaft and it will turn to point into the wind. A small microcontroller with I2C output is then all you need as only two digital inputs are needed to read the encoder. Some mechanical design will be needed to ensure that water, dust, etc. are kept out of the electronics.
A third digital input and a "home" sensor can be used to reset the position every time the wind goes through a certain direction. North would be a good idea.

An incremental encoder only tells you the angular distance from a certain point, hence the "North" sensor. You can dispense with this sensor by making sure that the circuit never loses power after it has been manually set to home. Designing a power system to ensure this is a separate task, or you can instead use an absolute encoder. However, absolute encoders of appreciable resolution are quite expensive.