Pinocchio was originally written by Carlo Lorenzini (known by his pen name, Carlo Collodi) between 1881 and 1883 in Italy. Lorenzini began his writing career in newspapers (Il Lampione and Il Fanfulla ), where he often used satire to express his political views. In 1875, he entered the world of children’s literature and used this outlet to transmit his political convictions. The series Giannettino, for example, often referred to the unification of Italy.
“Lorenzini became fascinated by the idea of using an amiable, rascally character as a means of expressing his own convictions through allegory. In 1880 he began writing Storia di un burattino (“The story of a marionette”), also called Le Avventure di Pinocchio, which was published weekly in Il Giornale dei Bambini (the first Italian newspaper for children).”
-Source
Le Avventure di Pinocchio, a fairy tale describing the adventures of a stubborn marionette in his quest to become a real boy, was published in 1883 (you can read the original book here, if you wish).