The last twelve months have been a confusing time for African democracy. We have seen coups that didn't look like coups and elections that didn't look like elections. In this sense, it was a year of illusions.
As in 2016, the broad trend is clear: with a number of notable exceptions, the gains made in the early 1990s are under threat from governments with little commitment to plural politics. It's true that 2017 provided further evidence of the danger of democratic backsliding. But it also saw powerful presidents suffer embarrassing setbacks in a number of countries.
So what lessons does 2017 have to teach us, and what is going to grab the headlines next year?
1. Don't mess with the military
In November 2016, the Zimbabwean Defence Forces placed President Robert Mugabe under house arrest and subsequently orchestrated his removal. The intervention was cleverly framed as a corrective action to remove "criminal" elements around the president. In reality, it represented an effort by the military to protect its own political and economic interests.
Once General Chiwenga had spoken out against the sacking of Emmerson Mnangagwa - the political leader closest to the security forces - he faced being replaced, arrested and charged with treason. In other words, Chiwenga had little to lose and everything to gain from military intervention. The ousting of Mugabe therefore serves as an important reminder that despite thirty years of multiparty elections in Africa, messing with the military can still be fatal.
2. If you're polite, you can get away with murder
The military intervention in Zimbabwe was also remarkable for being the politest coup in history. To avoid domestic and international criticism, the coup plotters went to remarkable lengths to make their usurpation of power look constitutional. Instead of being executed or sent into exile, Mugabe was allowed to remain in his house and posed for pictures with his captors.
Amazingly, the theatre worked. Delighted to see the back of Mugabe, even some committed democrats were prepared to hold their nose and welcome the "transition".
The willingness of many people to play along with the idea of a bloodless coup is deeply problematic, first because it may encourage security forces in other countries to try and repeat the trick, and second because it is false.
There are growing reports that a number of deaths and human rights abuses occurred as the military moved to exert political control. When the testimonies of the victims are finally heard, it will cast a very different light on the coup and its aftermath.
3. Judges can't promote democracy on their own
The Kenyan Supreme Court made history when it became the first judicial body on the continent to nullify the election of a sitting president - Uhuru Kenyatta - on 1 September. This remarkable assertion of judicial independence was celebrated throughout Africa and beyond, as democrats dared to dream of a new phase of judicial activism.
But any hope that the need to repeat the election would lead to widespread reforms and a better quality process turned out to be overly optimistic. Instead, the second poll was just as controversial as the first as evidence emerged of continued political interference in the electoral commission and the main opposition candidate, Raila Odinga, boycotted the contest.
The Kenyan experience is significant because it demonstrates that while independent judiciaries can have a major impact on democracy, their effectiveness is constrained by weaknesses elsewhere in the political system. Because Supreme Courts lack both legislative and enforcement powers, they are dependent on others for their decisions to be implemented, and so have a limited capacity to enforce the rule of law.
4. Political exclusion breeds secessionism
One of the main stories of the last 12 months is an upsurge of secessionist sentiment in Cameroon, Kenya and Nigeria. Significantly, while the demand for the creation of a separate state has complex roots, in each case it was triggered by perceptions of political and legal exclusion - and the fact that certain ethnic and linguistic communities have not held the presidency for decades, if at all.
Although these movements have very different dynamics, they have all led to protests and met with a hostile state response.
Perhaps somewhat paradoxically, they are also movements full of people who don't really want to secede: in each case, opposition leaders are using the threat of separation as a way to highlight - and contest - their political exclusion. Nonetheless, unless some of their demands are met, secessionist sentiment is likely to harden, undermining national identities and paving the way for future political crises.
5. Western companies are part of the problem
The last year has revealed the extent to which Western companies have become involved in helping political leaders in Africa run divisive public relations campaigns to boost their electoral prospects.
The most high profile example of this was Bell Pottinger, a British "reputational management agency" that was accused of designing a campaign to stir up racial tensions in South Africa as a way of deflecting attention away from the poor performance of the African National Congress government.
The company was paid £100,000 a month, although this proved to be little compensation when the scandal broke and it was forced into administration.
While Bell Pottinger has gone, many of the multinational companies who do this kind of work continue to operate - although exactly what they do remains unclear. Given the lucrative nature of these contacts, we can assume that Western companies will continue to play a questionable role in African elections in the future, unless their activities are exposed.
2018 and beyond
The next 12 months are not likely to be kind to African democracy. Very rarely has the continent seen so many elections scheduled in such unpromising contexts. Early elections in Sierra Leone have the best prospects of going well, but after that a series of general elections will be held in particularly challenging contests: Cameroon, Mali, South Sudan and Zimbabwe.
The great challenge facing Mali and South Sudan is to organise a credible contest against a backdrop of political instability and weak institutions.
The situation is markedly different in Cameroon and Zimbabwe, where entrenched regimes that tightly control the political landscape will hold elections that they have no intention of losing.
But it's important not to be defeatist. In the last few years the most significant democratic breakthroughs - in Gambia, Nigeria, Kenya and beyond - have been unanticipated. The next great democratic moment could be just around the corner.