Keep in mind that some reputation events are not available publicly so a script or app might not be able to fully reconstruct reputation.
If you ask a question in this context do include what the source of the reputation data is. Examples could be:
- Scraping User profile
- Scraping /reputation
- SEDE
- API https://api.stackexchange.com/docs/reputation-history