Let $f:\Bbb C\backslash\Bbb Z \to \Bbb C$ be a meromorphic function with the period of $2$ in the real direction, i.e. $f(z+2)=f(z)$. Each $n\in \Bbb Z$ is a simple pole such that $\text{Res}(f(z),n)=(-1)^n$. These are the only poles of $f$.
From this information alone, is it possible to conclude that $f(z) = \frac {\pi}{\sin{\pi z}}+C$?
I know that $\frac {\pi}{\sin{\pi z}} = \sum_{n=-\infty}^{\infty} \frac {(-1)^n}{z-n}$ so this is certainly a possible candidate for $f$. However, I don't know if it is the only function that fits the bill.
Edit: Thank you for all the comments so far, I just realized that the original question has trivial answer because I forgot to mention a crucial information: $f$ is a primitive of a meromorphic function $g$ that has poles of order $2$ at each $n\in\Bbb Z$.
Taking into account Conrad's comment, would it be enough to get the conclusion provided that we assume some kind of bound for $g$ in the vertical direction?
A $2$-periodic entire function is of the form $$g(z) = \sum_{n=-\infty}^\infty c_n e^{i \pi nz}, \qquad \forall r, \lim_{n \to \infty} c_n e^{rn}=\lim_{n \to \infty} c_{-n} e^{rn}=0$$
Then $f $ is meromorphic $2$-periodic with poles at integers of order $1$ and residue $(-1)^n$ iff $f-\frac{\pi}{\sin \pi z}$ is a $2$-periodic entire function.