If any person, being sheriff, clerk of any court, constable, assessor, or collector of taxes, or holding any county office whatever, or mayor, marshal, or constable, or any other officer of any city, town, or village, shall knowingly or wilfully fail, neglect, or refuse to perform any of the duties required of him by law, or shall fail or refuse to keep any record required to be kept by law, or shall secrete the same, or shall violate his duty in any respect, he shall, on conviction thereof, be fined not exceeding One Thousand Dollars ($1,000.00), or be imprisoned in the county jail not exceeding six (6) months, or both.